Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ebuilds and CVS
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
phunni
Apprentice
Apprentice


Joined: 05 May 2003
Posts: 217
Location: Bristol, UK

PostPosted: Mon Jun 02, 2003 12:16 pm    Post subject: ebuilds and CVS Reply with quote

I am trying to write an ebuild for clanbomber that installs from CVS. I have searched to see if this topic is already answered and can't find it anywhere.

I have looked through some ebuilds that seem to install from cvs but I can't really clearly understand what's going on - this is my first attempt at writing an ebuild.

Can anyone give me some tips on writing an ebuild which installs from cvs? In particular, how do I find out which moduels are available? Which drectory will be created that I need to cd to for the compile?

Any other tips would be gratefully accepted
_________________
Old School is the way forward!
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Mon Jun 02, 2003 12:52 pm    Post subject: Reply with quote

Quote:
In particular, how do I find out which moduels are available?


I'm not sure what you mean here. CVS modules to checkout?

Quote:
Which drectory will be created that I need to cd to for the compile?


I think the cleanest example I've seen of a CVS ebuild is media-sound/jack-cvs. Its very easy to follow and uses the cvs eclass to do all the cvs work.

net-www/phoenix-cvs is also a good example, but takes more work because it doesn't use the CVS eclass.
Back to top
View user's profile Send private message
phunni
Apprentice
Apprentice


Joined: 05 May 2003
Posts: 217
Location: Bristol, UK

PostPosted: Mon Jun 02, 2003 1:13 pm    Post subject: Reply with quote

Pythonhead wrote:
Quote:
In particular, how do I find out which moduels are available?


I'm not sure what you mean here. CVS modules to checkout?



The sourceforge instructions say that I need to specify a module name - I guessed clanbomber, but that doesn't appear to be correct
_________________
Old School is the way forward!
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Mon Jun 02, 2003 1:29 pm    Post subject: Reply with quote

Quote:

The sourceforge instructions say that I need to specify a module name - I guessed clanbomber, but that doesn't appear to be correct



Take a look here:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/clanbomber/

Therere are two modules. The name is case-sensitive.
As for my previous post, what you need to do in your ebuild is put in the line:

Code:
inherit cvs



Make sure you have these variables set:
Code:

ECVS_SERVER="cvs.clanbomber.sourceforge.net:/cvsroot/clanbomber"
ECVS_MODULE="ClanBomber"
#or ClanBomber2
ECVS_TOP_DIR="${DISTDIR}/cvs-src/clanbomber"


Using the cvs eclass makes it very easy. Now you just treat it as any other ebuild. It will automagically download the latest cvs and put it in /usr/portage/distfiles/cvs-source/clanbomber/ and then build it from there.
Back to top
View user's profile Send private message
phunni
Apprentice
Apprentice


Joined: 05 May 2003
Posts: 217
Location: Bristol, UK

PostPosted: Mon Jun 02, 2003 1:57 pm    Post subject: Reply with quote

Using exactly your code in the ebuild results in the following:

Code:
Calculating dependencies ...done!
>>> emerge (1 of 1) app-games/clanbomber-1.2_alpha to /
>>> Unpacking source...
checking out from CVS...
Logging in to :pserver:anonymous@cvs.sourceforge.net:2401/cvs
root/clanbomber
CVS password:
cvs [login aborted]: end of file from server (consult above messages if any)
cvs checkout: warning: failed to open /root/.cvspass for reading: No such file or directory
cvs [checkout aborted]: end of file from server (consult above messages if any)
/usr/sbin/ebuild.sh: line 23: cd: /var/tmp/portage/clanbomber-1.2_alpha/work/clanbomber-1.02a: No such file or directory
>>> Source unpacked.
/usr/sbin/ebuild.sh: line 29: cd: /var/tmp/portage/clanbomber-1.2_alpha/work/clanbomber-1.02a: No such file or directory
/usr/sbin/ebuild.sh: line 30: ./configure: No such file or directory

!!! ERROR: app-games/clanbomber-1.2_alpha failed.
!!! Function src_compile, Line 30, Exitcode 127
!!! (no error message)


not sure if this is a problem with my ebuild or the cvs server.

I will post my ebuild here for reference - please remember that it's my first attempt :oops:
Code:
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit cvs



S=${WORKDIR}/ClanBomber
DESCRIPTION="Bomberman clone - fantastic game!"
# SRC_URI="http://heanet.dl.sourceforge.net/sourceforge/clanbomber/clanbomber-1.02a.tar.gz"
HOMEPAGE="http://clanbomber.sourceforge.net"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86"
IUSE=""
ECVS_SERVER="cvs.clanbomber.sourceforge.net:/cvsroot/clanbomber"
ECVS_MODULE="ClanBomber"
ECVS_TOP_DIR="${DISTDIR}/cvs-src/clanbomber"


DEPEND="sys-libs/zlib
   app-games/clanlib
   media-libs/hermes"
 


src_compile() {

   
   cd ${S}
   
   export WANT_AUTOCONF_2_5=1
   sh autogen.sh
   econf || die
   emake || die

}

src_install () {
   cd ${S}
   einstall || die

}



Edit: I have updated the above code to be the latest ebuild
Edit #2: Have updated again
_________________
Old School is the way forward!


Last edited by phunni on Mon Jun 02, 2003 5:09 pm; edited 2 times in total
Back to top
View user's profile Send private message
phunni
Apprentice
Apprentice


Joined: 05 May 2003
Posts: 217
Location: Bristol, UK

PostPosted: Mon Jun 02, 2003 2:18 pm    Post subject: Reply with quote

Made some progress - it's now failing at the configure stage:
Code:
creating cache ./config.cache
./configure: line 525: syntax error near unexpected token `config.h'
./configure: line 525: `AM_CONFIG_HEADER(config.h)'


I suppose this could be because I'm using cvs code - but I'm not sure
_________________
Old School is the way forward!
Back to top
View user's profile Send private message
Lin_Matt
Guru
Guru


Joined: 23 Jun 2002
Posts: 581
Location: TechWasteland (Mississippi)

PostPosted: Mon Jun 02, 2003 3:38 pm    Post subject: Reply with quote

You might want to try setting WANT_AUTOCONF at some point before the autoconf in the ebuild as such:
"WANT_AUTOCONF_2_5=1 autoconf"

That should take care of your config problem...
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Mon Jun 02, 2003 3:41 pm    Post subject: Reply with quote

phunni wrote:
Made some progress - it's now failing at the configure stage:
Code:
creating cache ./config.cache
./configure: line 525: syntax error near unexpected token `config.h'
./configure: line 525: `AM_CONFIG_HEADER(config.h)'


I suppose this could be because I'm using cvs code - but I'm not sure


Yeah, it looks like it. You may have to do some steps before you get a good 'configure' file. I'd try working directly with the cvs code now and work on the ebuild after you get it compiling correctly.

Again, take a look at the media-audio/jack-cvs ebuild. Use that as your template, take out the stuff that doesn't pertain. In particular look in the src_compile() function. You'll see:

Code:

export WANT_AUTOCONF_2_5=1
sh autogen.sh


So, before you continue with the ebuild, try runing ./autogen.sh && ./configure && make and see if you can get it to build. Then use the jack-cvs ebuild to finish up.
Back to top
View user's profile Send private message
phunni
Apprentice
Apprentice


Joined: 05 May 2003
Posts: 217
Location: Bristol, UK

PostPosted: Mon Jun 02, 2003 5:13 pm    Post subject: Reply with quote

./autogen.sh && ./configure && make results in a sucesful build. I then edited my ebuild to follow the jack-cvs, but I get the following error when I try to emerge it (I ran make clean after the succesful build):

Code:
Bomb.cpp:150: warning: passing `float' for argument 2 of `
   Explosion::Explosion(int, int, int, Bomber*, ClanBomberApplication*)'
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/var/tmp/portage/clanbomber-1.2_alpha/work/ClanBomber/clanbomber'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/clanbomber-1.2_alpha/work/ClanBomber/clanbomber'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/clanbomber-1.2_alpha/work/ClanBomber'
make: *** [all-recursive-am] Error 2

!!! ERROR: app-games/clanbomber-1.2_alpha failed.
!!! Function src_compile, Line 39, Exitcode 2
!!! (no error message)


Not sure what causes this. I have reposted the ebuild above so you can see it as it currently is. I will continue to try and figure this out and post my results

Edit: I changed the emake to make and it seems to have compiled ok - although I got some access denied messages (I'm running all this as root):
Code:
--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE = "/tmp/sandbox-clanbomber-1.2_alpha-21677.log"

open_wr:   /dev/dsp
--------------------------------------------------------------------------------



oddly, despite not getting any compile errors, the einstall was never run. Will try again using make install instead of einstall and post my results

Edit #2: replacing einstall with make install returns exactly the same results
_________________
Old School is the way forward!
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Mon Jun 02, 2003 5:51 pm    Post subject: Reply with quote

Quote:

oddly, despite not getting any compile errors, the einstall was never run. Will try again using make install instead of einstall and post my results


You'll need to have the emake instead of make or you'll get that access violation. I'm not sure what the problem is, but you might try

rm -rf /var/tmp/portage/clanbomber-1.2_alpha

And then try again

I think you can remove the 'cd ${S}' from src_compile and src_install also.
Back to top
View user's profile Send private message
phunni
Apprentice
Apprentice


Joined: 05 May 2003
Posts: 217
Location: Bristol, UK

PostPosted: Mon Jun 02, 2003 6:49 pm    Post subject: Reply with quote

removed all directories and tried again. It takes a few attempts for the CVS download to work, but I think that's a server problem rather than anything to do with my ebuild.

I'm now back to the point where the build fails with the same error message as before. It seems odd to me that it builds using make, but i get file access errors, but it won't build using emake.

What also strikes me as odd is that if I run make outside of portage it works fine.

Any help to get this to work would be much aprpeciated. Obviously I could just installl it after building outside of portage - but I don't want to fail with my first ever attempt to build a succesful ebuild
_________________
Old School is the way forward!
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Mon Jun 02, 2003 7:19 pm    Post subject: Reply with quote

I think this is the problem, switch your S to:
Code:

S="${WORKDIR}/${PN/-cvs/}"
Back to top
View user's profile Send private message
phunni
Apprentice
Apprentice


Joined: 05 May 2003
Posts: 217
Location: Bristol, UK

PostPosted: Mon Jun 02, 2003 7:39 pm    Post subject: Reply with quote

You may be onto something with the need to change S, but that directory can't be right - it can no longer find any autogen.sh
_________________
Old School is the way forward!
Back to top
View user's profile Send private message
phunni
Apprentice
Apprentice


Joined: 05 May 2003
Posts: 217
Location: Bristol, UK

PostPosted: Mon Jun 02, 2003 7:45 pm    Post subject: Reply with quote

The files seem to be copied into /var/tmp/portage/clanbomber-1.2_alpha/work in a ClanBomber directory. This is where I got the original location of S from adn this seems to work in terms of finding all the appropriate files - but build fails (unless build it indepenently of emerge)
_________________
Old School is the way forward!
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Mon Jun 02, 2003 8:21 pm    Post subject: Reply with quote

Found one more possible problem, you should set all the cvs-related variables before you 'inherit cvs'

From the eclass HOWTO:

Quote:

Before inheriting cvs.eclass, set any non-default settings you want (at least the server address and module name). See the list of configurable settings and default values at the beginning of cvs.eclass, marked as 'ebuild-configurable settings'.

Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Mon Jun 02, 2003 10:38 pm    Post subject: Reply with quote

Well, I'm stumped. I can get it to download from CVS, unpack, autogen, configure and start compiling, but I get that odd error too.

ACCESS DENIED open_wr: /dev/dsp

And the log file simply says:
open_wr: /dev/dsp

I looked all through the source and didn't find any reference to /dev/dsp, but in a binary data file, which it seemed to bomb on, there is 'dsp' in it (clanbomber.dat)

I could only get make to work, emake fails.

Oddly enough, if I cd to /var/tmp/portage/clan...
and run make, everything is compiled. I did a 'make install' and its running fine.

Here's the ebuild I have so far:
Code:

# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: $


DESCRIPTION="Bomberman clone"
SRC_URI=""
HOMEPAGE="http://clanbomber.sourceforge.net"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86"
IUSE=""
ECVS_SERVER="cvs.clanbomber.sourceforge.net:/cvsroot/clanbomber"
ECVS_MODULE="ClanBomber"
ECVS_TOP_DIR="${DISTDIR}/cvs-src/clanbomber"

inherit cvs

S="${WORKDIR}/${ECVS_MODULE}"

DEPEND="sys-libs/zlib
    app-games/clanlib
    media-libs/hermes"

src_compile() {
    cd ${S}
    export WANT_AUTOCONF_2_5=1
    sh autogen.sh
    econf || die
    make || die

}

src_install () {
    einstall || die

}
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