Gentoo Logo

Ebuild Generator GSoC 2011

Content:

1.  Introduction

What problem does this project try to solve?

When writing ebuilds it can be a hassle to hunt down dependecies for the program and link them to the useflag that triggers them.

The point of this program is to help users write ebuilds by generating the useflags, dependecies and link useflags to dependecies for them. It is able to guess dependecies for packages that are not installed on the system.

Note that if the program that you try to generate the ebuild for is a simple "./configure && make && make install" project the generated ebuild should not need any edits to work

2.  How to use

Installation

At this time the ebuild for the ebuild generator is not in portage, get it from the overlay dir on: https://github.com/DarkDefender/ebuildgen . After you have emerged it you should be able to run the program with the command "genebuild"

Gererating an ebuild

Lets say I want to generate an ebuild for the "moc" project (http://moc.daper.net). It's svn based so I simply type the following command.

Code Listing 2.1: Generating and ebuild from svn

                    $ genebuild --svn svn://daper.net/moc/trunk
                

Note: At this time the ebuild generator only supports GIT, HG and SVN

It will go ahead and download the source code to /tmp/ebuildgen/curproj/ and then search the project for the topmost configure.{in,ac}. Then it will use the Makefile.ac in the same dir as the configure script and then scan the source files.

When it is done scanning source files it will try to link the includes it found in the source files to packages using qfile and the pfl online database.

Important: Make sure to double check that the dependecies that it pulls in are sane!

After the generator is done it will place the generated ebuild in /tmp/ebuildgen/generated.ebuild. Rename and edit the ebuild to you liking, put it in your local portage and emerge away.

3.  Where to go from here

Sanity checks

Because the generator doesn't run anycode from the projects that it will generate an ebuild for, it is likely that there will be cases where it guesses wrong dependecies. There for it would be good to have a check that tells the uses if the generator pulled in any obsolete packages or missed some vital ones.

If the "auto dependency builder" by Alexander Bersenev doesn't get included in portage I'll try to implement it to solve this problem. That way my ebuild generator "guesses" and the auto dependency builder confirms if the generator has guessed right.

Support for more languages and build scripts

There is very basic support for pure makefile projects in the generator. But I've disabled it as it is not good enough yet to be useful.

Before I start to try supporting other stuff I have to flesh out the current support that I have. There is alot for missing features and/or incomplete features that needs to be done.

But after that I think I'll try to support scons/cmake and later perhaps python projects.

Interested in contributing to the project?

Please contact me with the email on this page or pm/ping me on IRC. I usually hang out in #gentoo-chat on freenode by the name "DarkDefender"

The source code is located on github https://github.com/DarkDefender/ebuildgen



Print

Updated August 16, 2011

Summary: Generate ebuilds for autotools C/C++ based projects. The main goal is to help users write ebuilds by guessing useflags and dependecies.

Sebastian Parborg
Author

Donate to support our development efforts.

Copyright 2001-2011 Gentoo Foundation, Inc. Questions, Comments? Contact us.