Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO: Build a svn-based ebuild.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 2391
Location: The Peanut Gallery

PostPosted: Sun Oct 01, 2006 5:50 pm    Post subject: HOWTO: Build a svn-based ebuild. Reply with quote

Hi,

I'm posting this here in case someone else has a use for it, and also to get feedback and maybe give some hints to anyone else starting out on writing ebuilds.

These are for Synfig, "an industrial-strength vector-based 2D animation software package." The website is at http://www.synfig.com/ and the actual ebuilds can be downloaded from bugzilla (there are two other bugs for supporting packages.)

Make a portage overlay directory (eg /usr/local/portage) if you don't already have one.

Underneath that you will need 2 directories, dev-cpp and media-gfx.
In dev-cpp you will need another directory, ETL.
In media-gfx you will need another 2 directories, synfig and synfig-studio.

The ebuilds should be placed in the appropriate directories.

You will wish to rename the ebuilds to use the latest checkout number, as we'll be downloading the files from subversion; if you do this, you'll also need to change all the filenames in the code below (so instead of ETL-231 use ETL-237 or whatever.) In the following instructions, stuff in code blocks needs to be typed in at the command-line. Other steps can be done from a GUI. NB: don't change any of the `svn co http...' lines (unless you have better info;), as they refer to the project names as set by the developer.
If you don't have subversion already you'll first need to do:
Code:
emerge -av subversion

Now, say in your home dir, make a new directory (eg synfig) and start a terminal in it (or cd to it if you're already in a shell)
Then we download the latest code, and export it to another directory:
Code:
svn co http://svn.voria.com/code/ETL/trunk/ etl
svn export etl ETL-231

In this example, I'm using 231 as the version number of the ebuilds, as that was the svn checkout no.
Make a new folder called CVS in the ETL-231 directory; this stops a bootstrap warning from the config stage. Then make a source file we can hand over to portage:
Code:
mkdir -p ETL-231/CVS
tar -cjf ETL-231.tar.bz2 ETL-231/

Move the tarball to distfiles:
Code:
mv ETL-231.tar.bz2 /usr/portage/distfiles

Then use repoman to generate the Manifest file (checksums for the ebuild, files/ and any distfiles mentioned in SRC_URI):
Code:
cd /usr/local/portage/dev-cpp/ETL/
repoman manifest

(BTW if you're not great at the CLI, remember you can use TAB completion, so /u<TAB> gives /usr/ then lo<TAB> gives local and so on.)

The same procedure applies to the other 2 ebuilds:
Code:
svn co http://svn.voria.com/code/synfig-core/trunk/ synfig
svn export synfig synfig-231
mkdir -p synfig-231/CVS
tar -cjf synfig-231.tar.bz2 synfig-231/
mv synfig-231.tar.bz2 /usr/portage/distfiles
cd /usr/local/portage/media-gfx/synfig
repoman manifest

And for synfig-studio (the actual program you see):
Code:
svn co http://svn.voria.com/code/synfig-studio/trunk/ synfig-studio
svn export synfig-studio synfig-studio-231
mkdir -p synfig-studio-231/CVS
tar -cjf synfig-studio-231.tar.bz2 synfig-studio-231/
mv synfig-studio-231.tar.bz2 /usr/portage/distfiles
cd /usr/local/portage/media-gfx/synfig-studio
repoman manifest


Note that this is all getting close to something we can script. (We'd just need to get the subversion checkout number, but I'm not sure how you do that, apart from svn status -v folder | cut .., but there must be a cleaner way.) Also, we could automatically delete the source directory we've created just for the tarball by adding && rm -fr dir/ after the tar command, eg:
Code:
tar -cjf synfig-studio-231.tar.bz2 synfig-studio-231/ && rm -fr synfig-studio-231/

This would be more suitable if we were scripting updates, and is feasible in the command-line since the directory name already exists, so is easy to tab to.

Before you actually emerge any of the packages, you need to add them to your package.keywords file (in /etc/portage - create it as an empty text file if it doesn't exist, or use a file underneath the directory):
Code:
dev-cpp/ETL
media-gfx/synfig
media-gfx/synfig-studio

I also recommend adding
Code:
media-gfx/synfig-studio fmod

to /etc/portage/package.use for sound support (this will also pull in the fmod3.7 package if you don't already have it.) Synfig (the core libs) uses:
Code:
dv ffmpeg fontconfig imagemagick jpeg openexr png tiff truetype
all of which are set in my standard USE flags, plus the debug flag, which I don't have set. (It might be a good idea to set this later if you're going to submit bug reports back to the developer, which we should.)

And finally, emerge the software:
Code:
emerge -av synfig-studio

Hope this is of use,
Steve.

Hint: use the ebuild command while you are developing your own ebuilds, eg:
Code:
ebuild /usr/local/portage/media-gfx/synfig/synfig-231.ebuild qmerge
ebuild /usr/local/portage/media-gfx/synfig/synfig-231.ebuild install


edit: amended bugzilla so other bugs (111277/8/9) have updated ebuilds.
edit: changed title, proper links to bugs.
edit: changed to use svn checkout numbers.
edit: changed title to reflect function
edit(2012): change to use repoman, thanks DaggyStyle
edit(2014): remove reference to PORTDIR_OVERLAY


Last edited by steveL on Tue Jun 24, 2014 12:47 am; edited 7 times in total
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 2391
Location: The Peanut Gallery

PostPosted: Wed Dec 20, 2006 5:39 am    Post subject: Reply with quote

Just an update on the process of getting involved with gentoo ebuild maintenance.

So far I've learnt:
  • post to bugzilla
  • expect bad manners if it's a whinge ;)
  • once you've submitted a build, watch for the pkg to go to maintainer-wanted
  • bump the bugs with new versions as they come out
  • live svn and cvs builds don't go very far.
  • Once it's on maintainer-wanted find out which herd would be responsible for it and mail them asking if someone can proxy maintain for you.
  • Get it into sunrise -- join #gentoo-sunrise
  • if you need help ask on irc.freenode.net#gentoo-dev-help


Thanks to antarus and astinus for the help so far.

edit: added IRC channel
edit: removed IRC log


Last edited by steveL on Tue Apr 15, 2008 5:56 pm; edited 1 time in total
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 2391
Location: The Peanut Gallery

PostPosted: Tue Jan 09, 2007 11:01 am    Post subject: Reply with quote

Check out the thread on becoming a dev especially the bash links and the stuff about mailing lists (you don't want to be embarrassed like I was ;) And this one has info on using epatches. Note that you apply the patches in the ebuild, and they become part of your file list. -p1 means strip one directory from path names.

Last edited by steveL on Sat Apr 14, 2007 2:38 am; edited 1 time in total
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 2391
Location: The Peanut Gallery

PostPosted: Tue Jan 30, 2007 7:00 am    Post subject: Reply with quote

Just a quick note on making docs; in these ebuilds (well ETL and synfig, not synfig-studio) programming documentation is made using doxygen. So I added a doc USE flag (in IUSE) and made the ebuilds build the docs conditionally on that use flag. The interesting (for a geek ;) part is how you get those files across to the main system- you have to use dohtml not dodoc or otherwise the files will be compressed which obviously makes it tricky to view them in a browser. This also means you need to use insinto beforehand to set the correct directory.
Code:
if use doc; then
   insinto /usr/share/doc/${PF}
   dohtml doc/html/*
fi
NB the html directory is copied over as well (but not the doc dir.)
Back to top
View user's profile Send private message
aCOSwt
Moderator
Moderator


Joined: 19 Oct 2007
Posts: 2537
Location: Hilbert space

PostPosted: Wed Apr 18, 2012 9:00 am    Post subject: Reply with quote

Could my post be reported for necromancy ? :D

Well, I mean is this howto building from an upstream subversion repository still valid, still to be preferred to an ebuild based on the subversion eclass ?
_________________
Back to top
View user's profile Send private message
DaggyStyle
Advocate
Advocate


Joined: 22 Mar 2006
Posts: 4915

PostPosted: Wed Apr 18, 2012 9:47 am    Post subject: Reply with quote

instead of using
Code:
ebuild /usr/local/portage/media-gfx/synfig-studio/synfig-studio-231.ebuild digest

it is recommended to use
Code:
cd /usr/local/portage/media-gfx/synfig-studio; repoman manifest

_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
ProjectFootball
Back to top
View user's profile Send private message
aCOSwt
Moderator
Moderator


Joined: 19 Oct 2007
Posts: 2537
Location: Hilbert space

PostPosted: Wed Apr 18, 2012 10:00 am    Post subject: Reply with quote

DaggyStyle wrote:
instead of using
Code:
ebuild /usr/local/portage/media-gfx/synfig-studio/synfig-studio-231.ebuild digest

it is recommended to use
Code:
cd /usr/local/portage/media-gfx/synfig-studio; repoman manifest

Will do !
Thank you DaggyStyle.
_________________
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 2391
Location: The Peanut Gallery

PostPosted: Thu Nov 08, 2012 5:24 am    Post subject: Reply with quote

Thanks DaggyStyle, update the original post to reflect that.

Can't believe anyone still finds this useful heh.
_________________
creaker wrote:
systemd. It is a really ass pain

update - "a most excellent portage wrapper"

#friendly-coders -- We're still here for you™ ;)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software 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