Gentoo Archives: gentoo-soc

From: darkdefende@×××××.com
To: gentoo-soc@l.g.o
Subject: [gentoo-soc] Ebuild generator Final report
Date: Mon, 22 Aug 2011 16:30:40
Message-Id: cone.1314030627.192663.17186.1000@DarkRain
1 This is the final weekly update for my ebuild generator project.
2
3 The goal of this project is to be able to generate ebuilds for fairly
4 simple programs/projects. You should just be able to point it to the source
5 code repo/mirror and it should download, scan the source and figure out what
6 to do and what dependencies are required.
7 You should not have to have the required dependencies installed to generate
8 an ebuild with this program.
9
10 Last week I worked mostly on fixing some small bugs, fixing a website and
11 writing an ebulid for my ebuild generator.
12 You can find the ebuild in the overlay dir in the git repo.
13
14 Website: http://soc.dev.gentoo.org/~darkdefender/ebuildgenerator
15 Github: https://github.com/DarkDefender/ebuildgen
16 Gentoo git: http://git.overlays.gentoo.org/gitweb/?p=proj/ebuildgen.git
17
18 The plan was to support makefile and autotools projects at the end of GSoC.
19 There where also plans for cmake/scons and even pure python project if there
20 were any time left.
21 Sadly only autotools project are now working good. There is some basic
22 makefile support. But I have disabled it for the time being as it where too
23 incomplete/buggy. It also only support SCM projects at the moment
24 (svn/git/hg). IE no tarballs yet. It shouldn't be hard to implement later.
25
26 It currently works like this:
27 - Ebuild generator gets called with a code repo
28 - It clones the repo to /tmp/ebuildgen/
29 - Scans the project for configure.ac, take the top most one (if here is
30 multiple)
31 - Scan the configure.ac for possible useflags, variables that might be used
32 in automake/source files
33 - Scan the makefile.am in the same dir as configure.ac and other automake
34 files that gets pulled in by this makefile.am
35 - Link optional source files to useflags with the information that we have
36 from the configure.ac scan
37 - Scan all sourcefiles that we got from the automake scan
38 - Link "#includes" that are in ifdefs to useflags
39 - Search in the include paths if the includes are local or if it's from a
40 external dependency.
41 - Try to link the "globaly" #included to packages
42 - Use qfile to try to find the packages
43 - Use the pfl online database to guess
44 - Check if the guessed package exists in the package manager
45 - Output an ebuild to /tmp/ebuildgen/generated.ebuild
46
47 I think it works ok for the autotool projects that I've tried out so far.
48 It guesses quite well. But because the generator only "looks" at the code
49 and doesn't run it there will be cases where it will miss dependencies or
50 include bogus ones.
51 I think it would be really good to run the "auto dependency builder" by
52 Alexander Bersenev on the generated ebuild to check if it is sane dependency
53 wise.
54
55 For the future there is a lot features left to implement from autotools.
56 So the plan for the time being is to flesh out that till it's good enough
57 for most projects.
58 After that work will go into supporting other build methods.
59 I hope this project will at least help people when writing ebuilds for
60 projects. So you can generate the ebuild and then just do some small tweaks.
61
62 I will be quite busy with my studies so if anyone wants to help out/improve
63 the program just ask.