View previous topic :: View next topic |
Author |
Message |
mattmatteh Guru
Joined: 10 Mar 2004 Posts: 449 Location: near chicago
|
Posted: Thu Feb 12, 2009 3:14 am Post subject: how to correct the makefile for sfml ebuild |
|
|
i was trying to write an ebuild for sfml http://www.sfml-dev.org/
the makefile has DESTDIR, DESTLIBDIR, DESTINCDIR. should be using $(DESTDIR)/$(PREFIX). how can i tell it the install dir ?
could anyone suggest how to fix this or some www page that could help explain how to fix ?
matt |
|
Back to top |
|
|
sethleon Guru
Joined: 14 Dec 2003 Posts: 398 Location: Germany
|
|
Back to top |
|
|
mattmatteh Guru
Joined: 10 Mar 2004 Posts: 449 Location: near chicago
|
Posted: Thu Feb 12, 2009 7:54 pm Post subject: |
|
|
yes, i did all that. sorry, i should have said that in my first post
i was using that ebuild. that works kinda but has problems. there is a QA issue with linking. i asked in #gentoo-dev-help and i think zlin said i had to fix the makefile. the makefile is using DESTDIR as PREFIX, and it needs to be changed so that it uses both variables correctly, this is what i am trying to do, create a makefile patch. |
|
Back to top |
|
|
sethleon Guru
Joined: 14 Dec 2003 Posts: 398 Location: Germany
|
Posted: Thu Feb 12, 2009 9:03 pm Post subject: |
|
|
Ok, that is kind'a easy
First we need the unpacked sources, let's assume <ebuild> is the ebuild you have, unpacking is as follows:
Code: | ebuild <ebuild> unpack | (you need the full ebuild directory or ebuild directory as current directory)
The unpacked source folder should be at the following directory: /var/tmp/portage/media-libs/sfml-1.4/work
"Change dir" to it. Do the following, that will be our reference copy:
Code: | cp -R sfml-1.4 sfml-1.4-old |
Now change your Makefile in directory sfml-1.4. Create the patch as follows (you should be in directory work):
Code: | diff -Naur sfml-1.4-old sfml-1.4 >correct-Makefile.patch |
Now you can move the patch to the files directory in your ebuild directory (by the way it should be a local portage, not being synced by rsync).
Concerning your ebuild, you need the src_unpack function in your ebuild:
Code: | src_unpack() {
unpack ${A}
cd "${S}"
epatch "${FILESDIR}/correct-Makefile.patch"
} |
Finally you need a new digest or Manifest for your ebuild:
Code: | ebuild <ebuild> digest |
Ok, now your ebuild should work. _________________ Mess with the best, die like the rest. |
|
Back to top |
|
|
mattmatteh Guru
Joined: 10 Mar 2004 Posts: 449 Location: near chicago
|
Posted: Thu Feb 12, 2009 9:18 pm Post subject: |
|
|
nice, thanks for the help. but i have not made the patch yet ( that would have been the next question). i was trying to figure out how to fix the makefile. do you know the correct usage for PREFIX and DESTDIR ? perhaps you could look at the makefile ?
http://downloads.sourceforge.net/sfml/SFML-1.4-sdk-linux.tar.gz
src/SFML/Makefile
thanks
matt |
|
Back to top |
|
|
sethleon Guru
Joined: 14 Dec 2003 Posts: 398 Location: Germany
|
Posted: Thu Feb 12, 2009 9:49 pm Post subject: |
|
|
In general PREFIX stands for the part of the path to add before another part of a path.
DESTDIR stands for the directory, to which to install to.
Concerning the Makefile, following lines need to be fixed:
Code: | export DESTDIR = /usr
export DESTLIBDIR = $(DESTDIR)/lib
export DESTINCDIR = $(DESTDIR)/include |
to the following, which allows the correct install (first to the image directory, next to the system):
Code: | export PREFIX = /usr
export DESTLIBDIR = $(DESTDIR)$(PREFIX)/lib
export DESTINCDIR = $(DESTDIR)$(PREFIX)/include |
This allows the setting of a PREFIX, usually /usr or /usr/local and the DESTDIR usually ${D} which contains /var/tmp/portage/media-libs/srfm-1.4/image/ _________________ Mess with the best, die like the rest. |
|
Back to top |
|
|
mattmatteh Guru
Joined: 10 Mar 2004 Posts: 449 Location: near chicago
|
Posted: Fri Feb 13, 2009 12:02 am Post subject: |
|
|
thanks, that was the help i was looking for. here is the ebuild. any comments or suggestions before i file a bug to have it added ?
Code: | inherit eutils autotools
HOMEPAGE="http://sfml.sourceforge.net/"
SRC_URI="http://downloads.sourceforge.net/sfml/SFML-${PV}-sdk-linux.tar.gz"
IUSE=""
LICENSE="ZLIB as-is"
SLOT="0"
DEPEND="media-libs/freetype
media-libs/libsndfile
media-libs/openal"
# media-libs/libvorbis was listed as a dependency for the ebuild i found. but is not listed on sfml website
# http://www.sfml-dev.org/tutorials/1.4/start-linux.php
RDEPEND="${DEPEND}"
DESCRIPTION="Simple and fast multimedia library"
KEYWORDS="~x86 ~amd64 ~ppc"
S="${WORKDIR}/SFML-${PV}"
src_unpack()
{
unpack ${A}
cd "${S}"
sed -i 's:DESTDIR:PREFIX:' src/SFML/Makefile
sed -i 's:$(PREFIX):$(DESTDIR)$(PREFIX):' src/SFML/Makefile
}
src_compile()
{
emake || die
}
src_install()
{
emake install DESTDIR="${D}"/usr || die
} |
|
|
Back to top |
|
|
sethleon Guru
Joined: 14 Dec 2003 Posts: 398 Location: Germany
|
Posted: Fri Feb 13, 2009 11:39 am Post subject: |
|
|
Have you tried emerging it?
I can't find any error, this should be ok. _________________ Mess with the best, die like the rest. |
|
Back to top |
|
|
mattmatteh Guru
Joined: 10 Mar 2004 Posts: 449 Location: near chicago
|
Posted: Fri Feb 13, 2009 8:10 pm Post subject: |
|
|
there are no errors. |
|
Back to top |
|
|
Bluespear Apprentice
Joined: 20 Jul 2005 Posts: 164 Location: Switzerland
|
Posted: Sun Oct 04, 2009 4:49 pm Post subject: |
|
|
Hello, I tried to pick up your ebuild to install the 1.5 but there is a path problem: includes gets installed in /usr/usr/include/SFML ... tried without fixing paths but problem is even worse (I install it on usr/include... instead of /usr/include).
Someone having an ebuild for 1.5 ? |
|
Back to top |
|
|
mattmatteh Guru
Joined: 10 Mar 2004 Posts: 449 Location: near chicago
|
|
Back to top |
|
|
Bluespear Apprentice
Joined: 20 Jul 2005 Posts: 164 Location: Switzerland
|
Posted: Sun Oct 04, 2009 7:31 pm Post subject: |
|
|
Thanks you |
|
Back to top |
|
|
|