Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to correct the makefile for sfml ebuild
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
mattmatteh
Guru
Guru


Joined: 10 Mar 2004
Posts: 449
Location: near chicago

PostPosted: Thu Feb 12, 2009 3:14 am    Post subject: how to correct the makefile for sfml ebuild Reply with quote

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
View user's profile Send private message
sethleon
Guru
Guru


Joined: 14 Dec 2003
Posts: 398
Location: Germany

PostPosted: Thu Feb 12, 2009 2:09 pm    Post subject: Reply with quote

You find an ebuild by google'ing. ;) http://www.emilienkia.fr/public/gentoo/media-libs/sfml/sfml-1.2.ebuild

Nevertheless these Links may be usefull:
http://www.gentoo.org/proj/en/devrel/handbook/handbook.xml?part=2&chap=1
http://devmanual.gentoo.org/

The basics are that an ebuild is seperated in functions called by python.
All actions are performed in a sandbox, no operation may install anything outside the temp directory.

The install section could be:
Code:
src_install() {
   emake DESTDIR="${D}" install || die "failed"
}

_________________
Mess with the best, die like the rest.
Back to top
View user's profile Send private message
mattmatteh
Guru
Guru


Joined: 10 Mar 2004
Posts: 449
Location: near chicago

PostPosted: Thu Feb 12, 2009 7:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
sethleon
Guru
Guru


Joined: 14 Dec 2003
Posts: 398
Location: Germany

PostPosted: Thu Feb 12, 2009 9:03 pm    Post subject: Reply with quote

Ok, that is kind'a easy :wink:

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
View user's profile Send private message
mattmatteh
Guru
Guru


Joined: 10 Mar 2004
Posts: 449
Location: near chicago

PostPosted: Thu Feb 12, 2009 9:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
sethleon
Guru
Guru


Joined: 14 Dec 2003
Posts: 398
Location: Germany

PostPosted: Thu Feb 12, 2009 9:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
mattmatteh
Guru
Guru


Joined: 10 Mar 2004
Posts: 449
Location: near chicago

PostPosted: Fri Feb 13, 2009 12:02 am    Post subject: Reply with quote

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
View user's profile Send private message
sethleon
Guru
Guru


Joined: 14 Dec 2003
Posts: 398
Location: Germany

PostPosted: Fri Feb 13, 2009 11:39 am    Post subject: Reply with quote

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
View user's profile Send private message
mattmatteh
Guru
Guru


Joined: 10 Mar 2004
Posts: 449
Location: near chicago

PostPosted: Fri Feb 13, 2009 8:10 pm    Post subject: Reply with quote

there are no errors.
Back to top
View user's profile Send private message
Bluespear
Apprentice
Apprentice


Joined: 20 Jul 2005
Posts: 164
Location: Switzerland

PostPosted: Sun Oct 04, 2009 4:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
mattmatteh
Guru
Guru


Joined: 10 Mar 2004
Posts: 449
Location: near chicago

PostPosted: Sun Oct 04, 2009 6:41 pm    Post subject: Reply with quote

http://gpo.zugaina.org/Search?search=sfml

Overlay: sping

use layman to add that. or just copy from that site.

matt
Back to top
View user's profile Send private message
Bluespear
Apprentice
Apprentice


Joined: 20 Jul 2005
Posts: 164
Location: Switzerland

PostPosted: Sun Oct 04, 2009 7:31 pm    Post subject: Reply with quote

Thanks you :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum