Gentoo Archives: gentoo-commits

From: "George Shapovalov (george)" <george@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: gnat.eclass
Date: Wed, 19 Sep 2007 20:35:27
Message-Id: E1IY68r-0002Ck-My@stork.gentoo.org
1 george 07/09/19 20:27:25
2
3 Modified: gnat.eclass
4 Log:
5 adapted gnat.eclass to use split off common code in eselect-gnat (##192505 and 167000)
6
7 Revision Changes Path
8 1.25 eclass/gnat.eclass
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.25&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.25&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?r1=1.24&r2=1.25
13
14 Index: gnat.eclass
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v
17 retrieving revision 1.24
18 retrieving revision 1.25
19 diff -u -r1.24 -r1.25
20 --- gnat.eclass 28 May 2007 15:49:48 -0000 1.24
21 +++ gnat.eclass 19 Sep 2007 20:27:25 -0000 1.25
22 @@ -1,6 +1,6 @@
23 # Copyright 1999-2004 Gentoo Foundation
24 # Distributed under the terms of the GNU General Public License v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.24 2007/05/28 15:49:48 george Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.25 2007/09/19 20:27:25 george Exp $
27 #
28 # Author: George Shapovalov <george@g.o>
29 # Belongs to: ada herd <ada@g.o>
30 @@ -14,17 +14,29 @@
31 # called from the (exported) gnat_src_compile function of eclass. These
32 # functions should operate similarly to the starndard src_compile and
33 # src_install. The only difference, that they should use $SL variable instead of
34 -# $S (this is where the working cop of source is held) and $DL instead of $D as
35 +# $S (this is where the working copy of source is held) and $DL instead of $D as
36 # its installation point.
37
38 inherit flag-o-matic eutils
39
40 -EXPORT_FUNCTIONS pkg_setup pkg_postinst src_unpack src_compile
41 +# The environment is set locally in src_compile and src_install functions
42 +# by the common code sourced here and in gnat-eselect module.
43 +# This is the standard location for this code (belongs to eselect-gnat,
44 +# since eselect should work even in the absense of portage tree and we can
45 +# guarantee to some extent presence of gnat-eselect when anything gnat-related
46 +# gets processed. See #192505)
47 +#
48 +# Note!
49 +# It may not be safe to source this at top level. Only source inside local
50 +# functions!
51 +GnatCommon="/usr/share/gnat/lib/gnat-common.bash"
52 +
53 +EXPORT_FUNCTIONS pkg_setup pkg_postinst src_compile
54
55 DESCRIPTION="Common procedures for building Ada libs using split gnat compilers"
56
57 # really need to make sure we have eselect with new eclass version
58 -DEPEND=">=app-admin/eselect-gnat-0.8"
59 +DEPEND=">=app-admin/eselect-gnat-1.1"
60
61
62 # ----------------------------------
63 @@ -47,9 +59,6 @@
64 # installed in lib_install
65 DL=${WORKDIR}/LocalDest
66
67 -# location of cleaned-up eselect script, for sourcing
68 -EselectScript=${WORKDIR}/gnat.eselect
69 -
70 # file containing environment formed by gnat-eselect (build-time)
71 BuildEnv=${WORKDIR}/BuildEnv
72
73 @@ -225,15 +234,6 @@
74
75
76
77 -gnat_src_unpack() {
78 - debug-print-function $FUNCNAME $*
79 - unpack ${A}
80 - cat /usr/share/eselect/modules/gnat.eselect | \
81 - grep -v svn_date_to_version | \
82 - grep -v DESCRIPTION | \
83 - grep -v env-update > ${EselectScript}
84 -}
85 -
86
87 # standard lib_compile plug. Adapted from base.eclass
88 lib_compile() {
89 @@ -274,7 +274,7 @@
90
91 # We source the eselect-gnat module and use its functions directly, instead of
92 # duplicating code or trying to violate sandbox in some way..
93 - . ${EselectScript} || die "cannot source eselect-gnat module"
94 + . ${GnatCommon} || die "failed to source gnat-common lib"
95
96 compilers=( $(find_compilers ) )
97 if [[ -n ${compilers[@]} ]] ; then
98 @@ -289,9 +289,9 @@
99 # setup environment
100 # As eselect-gnat also manages the libs, this will ensure the right
101 # lib profiles are activated too (in case we depend on some Ada lib)
102 - do_set ${compilers[${i}]} ${BuildEnv}
103 - expand_BuildEnv ${BuildEnv}
104 - . ${BuildEnv}
105 + generate_envFile ${compilers[${i}]} ${BuildEnv} && \
106 + expand_BuildEnv ${BuildEnv} && \
107 + . ${BuildEnv} || die "failed to switch to ${compilers[${i}]}"
108 # many libs (notably xmlada and gtkada) do not like to see
109 # themselves installed. Need to strip them from ADA_*_PATH
110 # NOTE: this should not be done in pkg_setup, as we setup
111 @@ -323,7 +323,7 @@
112 debug-print-function $FUNCNAME $*
113
114 # prep lib specs directory
115 - . ${EselectScript} || die "cannot source eselect-gnat module"
116 + . ${GnatCommon} || die "failed to source gnat-common lib"
117 dodir ${SPECSDIR}/${PN}
118
119 compilers=( $(find_compilers ) )
120
121
122
123 --
124 gentoo-commits@g.o mailing list