Gentoo Archives: gentoo-alt

From: Fabian Groffen <grobian@g.o>
To: gentoo-alt@l.g.o
Cc: drizzt@g.o
Subject: [gentoo-alt] Re: gnulib.eclass implementation
Date: Wed, 04 Mar 2009 18:00:44
Message-Id: 20090304180022.GB6060@gentoo.org
1 (I prefer using the -alt mailing list)
2
3 On 04-03-2009 18:47:43 +0100, Timothy Redaelli wrote:
4 > I start to implement a gnulib.eclass that allows to include the modules that
5 > the ebuild wants.
6 >
7 > IMHO it's better than the pre-compiled libgnu.a with some modules, since we
8 > cannot know if an ebuild wants another module.
9
10 At one point we just went for this and decided to just extend gnulib
11 with a version bump if needed.
12
13 > diff --git a/app-portage/portage-utils/portage-utils-0.1.29-r00.1.ebuild b/app-portage/portage-utils/portage-utils-0.1.29-r00.1.ebuild
14 > index f20afce..da0921d 100644
15 > --- a/app-portage/portage-utils/portage-utils-0.1.29-r00.1.ebuild
16 > +++ b/app-portage/portage-utils/portage-utils-0.1.29-r00.1.ebuild
17 > @@ -4,7 +4,7 @@
18 >
19 > EAPI="prefix"
20 >
21 > -inherit toolchain-funcs eutils flag-o-matic
22 > +inherit toolchain-funcs eutils flag-o-matic gnulib
23 >
24 > DESCRIPTION="small and fast portage helper tools written in C"
25 > HOMEPAGE="http://www.gentoo.org/"
26 > @@ -16,16 +16,19 @@ KEYWORDS="~ppc-aix ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos
27 > IUSE=""
28 >
29 > DEPEND="
30 > - ppc-aix? ( dev-libs/gnulib )
31 > - sparc-solaris? ( dev-libs/gnulib )
32 > - sparc64-solaris? ( dev-libs/gnulib )
33 > - x86-solaris? ( dev-libs/gnulib )
34 > - x64-solaris? ( dev-libs/gnulib )
35 > + ppc-aix? ( >=dev-libs/gnulib-2009.03.03.14.07.45 )
36 > + sparc-solaris? ( >=dev-libs/gnulib-2009.03.03.14.07.45 )
37 > + sparc64-solaris? ( >=dev-libs/gnulib-2009.03.03.14.07.45 )
38 > + x86-solaris? ( >=dev-libs/gnulib-2009.03.03.14.07.45 )
39 > + x64-solaris? ( >=dev-libs/gnulib-2009.03.03.14.07.45 )
40 > "
41 >
42 > +[[ ${CHOST} == *-aix* || ${CHOST} == *-solaris* ]] && \
43 > + WANT_GNULIB_MODULES="alphasort getopt scandir setenv stdint strcasestr xvasprintf"
44
45 This idea looks good to me
46
47 Does it mean gnulib is recompiled all the time? Especially configuring
48 it is a beast...
49
50 > src_unpack() {
51 > unpack ${A}
52 > - cd ${S}
53 > + cd "${S}"
54
55 In general, don't do this in Prefix.
56
57 > epatch "${FILESDIR}"/${P}-solaris.patch
58 > epatch "${FILESDIR}"/${P}-darwin.patch
59 > @@ -33,15 +36,15 @@ src_unpack() {
60 > epatch "${FILESDIR}"/${P}-aix.patch
61 > epatch "${FILESDIR}"/${P}-interix.patch
62 > eprefixify main.c qlop.c
63 > +
64 > + gnulib_src_unpack
65
66 I guess gnulib_src_unpack extracts the gnulib sources?
67
68 > - if [[ ${CHOST} == *-aix* || ${CHOST} == *-solaris* ]]; then
69 > - append-flags -I"${EPREFIX}"/usr/$(get_libdir)/gnulib/include
70 > - append-ldflags -L"${EPREFIX}"/usr/$(get_libdir)/gnulib/lib
71 > - append-libs -lgnu
72 > - fi
73 > + gnulib_build
74 > + gnulib_append-flags
75
76 what does this do? The -I stuff?
77
78 > + gnulib_append-lib-as-ldflags
79
80 What does this do? A joint of append-ldflags and append-libs?
81
82 > emake || die
83
84 Maybe the eclass could set this stuff by itself? Would make sense to
85 me.
86
87
88 --
89 Fabian Groffen
90 Gentoo on a different level

Replies

Subject Author
Re: [gentoo-alt] Re: gnulib.eclass implementation Michael Haubenwallner <haubi@g.o>