1 |
commit: 6ab61c4820d0c4961a3388ffb548bc3670f5fdd1 |
2 |
Author: Stephen L Arnold <nerdboy <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jun 4 03:47:36 2016 +0000 |
4 |
Commit: Steve Arnold <nerdboy <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jun 4 04:04:45 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6ab61c48 |
7 |
|
8 |
app-eselect/eselect-gnat: version bump to 1.5-r1 |
9 |
|
10 |
This is required to support new gnat-gcc ebuilds (4.9.3 and higher). |
11 |
|
12 |
Package-Manager: portage-2.2.28 |
13 |
|
14 |
.../eselect-gnat/eselect-gnat-1.3-r1.ebuild | 4 +- |
15 |
.../eselect-gnat/eselect-gnat-1.4-r1.ebuild | 4 +- |
16 |
app-eselect/eselect-gnat/eselect-gnat-1.4.ebuild | 4 +- |
17 |
...-gnat-1.5.ebuild => eselect-gnat-1.5-r1.ebuild} | 8 +- |
18 |
app-eselect/eselect-gnat/eselect-gnat-1.5.ebuild | 4 +- |
19 |
.../eselect-gnat/files/gnat-common-1.5.bash | 227 +++++++++++++++++++++ |
20 |
6 files changed, 244 insertions(+), 7 deletions(-) |
21 |
|
22 |
diff --git a/app-eselect/eselect-gnat/eselect-gnat-1.3-r1.ebuild b/app-eselect/eselect-gnat/eselect-gnat-1.3-r1.ebuild |
23 |
index 5b2f89d..13e576c 100644 |
24 |
--- a/app-eselect/eselect-gnat/eselect-gnat-1.3-r1.ebuild |
25 |
+++ b/app-eselect/eselect-gnat/eselect-gnat-1.3-r1.ebuild |
26 |
@@ -1,7 +1,9 @@ |
27 |
-# Copyright 1999-2015 Gentoo Foundation |
28 |
+# Copyright 1999-2016 Gentoo Foundation |
29 |
# Distributed under the terms of the GNU General Public License v2 |
30 |
# $Id$ |
31 |
|
32 |
+EAPI=5 |
33 |
+ |
34 |
inherit eutils |
35 |
|
36 |
DESCRIPTION="gnat module for eselect" |
37 |
|
38 |
diff --git a/app-eselect/eselect-gnat/eselect-gnat-1.4-r1.ebuild b/app-eselect/eselect-gnat/eselect-gnat-1.4-r1.ebuild |
39 |
index f374aa6..9629b8a 100644 |
40 |
--- a/app-eselect/eselect-gnat/eselect-gnat-1.4-r1.ebuild |
41 |
+++ b/app-eselect/eselect-gnat/eselect-gnat-1.4-r1.ebuild |
42 |
@@ -1,7 +1,9 @@ |
43 |
-# Copyright 1999-2015 Gentoo Foundation |
44 |
+# Copyright 1999-2016 Gentoo Foundation |
45 |
# Distributed under the terms of the GNU General Public License v2 |
46 |
# $Id$ |
47 |
|
48 |
+EAPI=5 |
49 |
+ |
50 |
inherit eutils |
51 |
|
52 |
DESCRIPTION="gnat module for eselect" |
53 |
|
54 |
diff --git a/app-eselect/eselect-gnat/eselect-gnat-1.4.ebuild b/app-eselect/eselect-gnat/eselect-gnat-1.4.ebuild |
55 |
index 8125318..0931dc3 100644 |
56 |
--- a/app-eselect/eselect-gnat/eselect-gnat-1.4.ebuild |
57 |
+++ b/app-eselect/eselect-gnat/eselect-gnat-1.4.ebuild |
58 |
@@ -1,7 +1,9 @@ |
59 |
-# Copyright 1999-2015 Gentoo Foundation |
60 |
+# Copyright 1999-2016 Gentoo Foundation |
61 |
# Distributed under the terms of the GNU General Public License v2 |
62 |
# $Id$ |
63 |
|
64 |
+EAPI=5 |
65 |
+ |
66 |
inherit eutils |
67 |
|
68 |
DESCRIPTION="gnat module for eselect" |
69 |
|
70 |
diff --git a/app-eselect/eselect-gnat/eselect-gnat-1.5.ebuild b/app-eselect/eselect-gnat/eselect-gnat-1.5-r1.ebuild |
71 |
similarity index 81% |
72 |
copy from app-eselect/eselect-gnat/eselect-gnat-1.5.ebuild |
73 |
copy to app-eselect/eselect-gnat/eselect-gnat-1.5-r1.ebuild |
74 |
index 0329167..7bf2ce5 100644 |
75 |
--- a/app-eselect/eselect-gnat/eselect-gnat-1.5.ebuild |
76 |
+++ b/app-eselect/eselect-gnat/eselect-gnat-1.5-r1.ebuild |
77 |
@@ -1,7 +1,9 @@ |
78 |
-# Copyright 1999-2015 Gentoo Foundation |
79 |
+# Copyright 1999-2016 Gentoo Foundation |
80 |
# Distributed under the terms of the GNU General Public License v2 |
81 |
# $Id$ |
82 |
|
83 |
+EAPI=5 |
84 |
+ |
85 |
inherit eutils |
86 |
|
87 |
DESCRIPTION="gnat module for eselect" |
88 |
@@ -10,7 +12,7 @@ SRC_URI="" |
89 |
|
90 |
LICENSE="GPL-2" |
91 |
SLOT="0" |
92 |
-KEYWORDS="~amd64 ~ppc ~x86 ~sparc" |
93 |
+KEYWORDS="~amd64 ~arm ~ppc ~x86 ~sparc" |
94 |
|
95 |
IUSE="" |
96 |
RDEPEND=">=app-admin/eselect-1.2.5" |
97 |
@@ -31,5 +33,5 @@ src_install() { |
98 |
# !ATTN! |
99 |
# Make sure to adjust version of installed file to a proper one if there is |
100 |
# a change! |
101 |
- newins "${FILESDIR}"/gnat-common-1.4-r1.bash gnat-common.bash |
102 |
+ newins "${FILESDIR}"/gnat-common-${PV}.bash gnat-common.bash |
103 |
} |
104 |
|
105 |
diff --git a/app-eselect/eselect-gnat/eselect-gnat-1.5.ebuild b/app-eselect/eselect-gnat/eselect-gnat-1.5.ebuild |
106 |
index 0329167..aee7344 100644 |
107 |
--- a/app-eselect/eselect-gnat/eselect-gnat-1.5.ebuild |
108 |
+++ b/app-eselect/eselect-gnat/eselect-gnat-1.5.ebuild |
109 |
@@ -1,7 +1,9 @@ |
110 |
-# Copyright 1999-2015 Gentoo Foundation |
111 |
+# Copyright 1999-2016 Gentoo Foundation |
112 |
# Distributed under the terms of the GNU General Public License v2 |
113 |
# $Id$ |
114 |
|
115 |
+EAPI=5 |
116 |
+ |
117 |
inherit eutils |
118 |
|
119 |
DESCRIPTION="gnat module for eselect" |
120 |
|
121 |
diff --git a/app-eselect/eselect-gnat/files/gnat-common-1.5.bash b/app-eselect/eselect-gnat/files/gnat-common-1.5.bash |
122 |
new file mode 100644 |
123 |
index 0000000..2aa5cfe |
124 |
--- /dev/null |
125 |
+++ b/app-eselect/eselect-gnat/files/gnat-common-1.5.bash |
126 |
@@ -0,0 +1,227 @@ |
127 |
+# Copyright 1999-2015 Gentoo Foundation |
128 |
+# Distributed under the terms of the GNU General Public License v2 |
129 |
+# $Id$ |
130 |
+ |
131 |
+# |
132 |
+# Author: George Shapovalov <george@g.o> |
133 |
+# Purpose: Contains common vars/locations and functions for use by gnat.eclass, |
134 |
+# gnat.eselect and gnatbuild.eclass. |
135 |
+# |
136 |
+# NOTE!!! |
137 |
+# This code should just define vars (try to limit these!) and simple functions. |
138 |
+# No bash extensions!! |
139 |
+# That is, no portage or eclass constructs are allowed! |
140 |
+# |
141 |
+ |
142 |
+ |
143 |
+ |
144 |
+# ---------------------------------- |
145 |
+# Globals |
146 |
+ |
147 |
+# Environmantal stuff (for env update) |
148 |
+SPECSDIR="/usr/share/gnat/eselect" |
149 |
+ENVDIR="/etc/env.d" |
150 |
+MARKER="55gnat-" |
151 |
+ |
152 |
+# User configurable settings |
153 |
+SETTINGSDIR="/etc/ada" |
154 |
+PRIMELIST="${SETTINGSDIR}/primary_compilers" |
155 |
+ |
156 |
+## Lib install locations |
157 |
+## |
158 |
+## Gnat profile dependent files go under under ${LibTop}/${Gnat_Profile}/${PN} |
159 |
+## and common files go unde SpecsDir, DataDir |
160 |
+#PREFIX=/usr |
161 |
+## Replace %LIBDIR% below with $(get_libdir) in eclasses and ebuilds (top level Ok, inherit multilib) |
162 |
+## or $(profile2libdir ${profile}) in this code, eselect module or anywhere |
163 |
+## outside portage (as profile will be available only during actual execution, this only should |
164 |
+## be done inside corresponding functions). |
165 |
+#AdalibSpecsDir=${PREFIX}/include/ada |
166 |
+#AdalibDataDir=${PREFIX}/share/ada |
167 |
+#AdalibLibTop=${PREFIX}/%LIBDIR%/ada |
168 |
+ |
169 |
+ |
170 |
+# ------------------------------------ |
171 |
+# Helpers |
172 |
+# |
173 |
+ |
174 |
+# get_all_profile_components splits gnat profile and returns pace separated list of its components: |
175 |
+# x86_64-pc-linux-gnu-gnat-gcc-4.1 -> x86_64-pc-linux-gnu gcc 4.1 |
176 |
+# args: |
177 |
+# $1 - the string to split |
178 |
+get_all_profile_components() { |
179 |
+ local GnatSLOT=${1##*-} |
180 |
+ local remainder=${1%-*} |
181 |
+ local GnatPkg=${remainder##*-} |
182 |
+ remainder=${remainder%-gnat-*} |
183 |
+ echo "${remainder} ${GnatPkg} ${GnatSLOT}" |
184 |
+} |
185 |
+ |
186 |
+# similar to above, returns only SLOT component: |
187 |
+# x86_64-pc-linux-gnu-gnat-gcc-4.1 -> 4.1 |
188 |
+# args: |
189 |
+# $1 - the string to extract the slot from |
190 |
+get_gnat_SLOT() { |
191 |
+ echo "${1##*-}" |
192 |
+} |
193 |
+ |
194 |
+# returns only Pkg component: |
195 |
+# x86_64-pc-linux-gnu-gnat-gcc-4.1 -> gcc |
196 |
+# args: |
197 |
+# $1 - the string to extract the slot from |
198 |
+get_gnat_Pkg() { |
199 |
+ local remainder=${1%-*} |
200 |
+ echo "${remainder##*-}" |
201 |
+} |
202 |
+ |
203 |
+# returns only Arch component: |
204 |
+# x86_64-pc-linux-gnu-gnat-gcc-4.1 -> x86_64-pc-linux-gnu |
205 |
+# args: |
206 |
+# $1 - the string to extract the slot from |
207 |
+get_gnat_Arch() { |
208 |
+ echo ${1%-gnat-*} |
209 |
+} |
210 |
+ |
211 |
+ |
212 |
+ |
213 |
+## ------------------------------------------- |
214 |
+# gnat profile and lib detection functions |
215 |
+ |
216 |
+ |
217 |
+# create a list of all gnat env.d files |
218 |
+# for now use trivial implementation - store name of active profile in the |
219 |
+# env file name, so it gets called 55gnat-${ARCH}-${PN}-${SLOT} |
220 |
+get_env_list() { |
221 |
+ for fn in ${ENVDIR}/${MARKER}*; do |
222 |
+ echo $(basename ${fn}) |
223 |
+ done |
224 |
+} |
225 |
+ |
226 |
+ |
227 |
+ |
228 |
+# find all installed compilers and return a list |
229 |
+find_all_compilers() { |
230 |
+ [[ ! -d ${SPECSDIR} ]] && exit |
231 |
+ for fn in ${SPECSDIR}/*; do |
232 |
+ [[ ! -d ${fn} ]] && echo $(basename ${fn}); |
233 |
+ done |
234 |
+} |
235 |
+ |
236 |
+# find installed primary compilers and return a list |
237 |
+find_primary_compilers() { |
238 |
+ [[ ! -f ${PRIMELIST} ]] && exit |
239 |
+ for fn in $(cat ${PRIMELIST}); do |
240 |
+ [[ -f ${SPECSDIR}/${fn} ]] && echo ${fn}; |
241 |
+ done |
242 |
+} |
243 |
+ |
244 |
+# find installed libs and return a list |
245 |
+find_all_libs() { |
246 |
+ [[ ! -d ${SPECSDIR} ]] && exit |
247 |
+ for fn in ${SPECSDIR}/*; do |
248 |
+ [[ -d ${fn} ]] && echo $(basename ${fn}); |
249 |
+ done |
250 |
+} |
251 |
+ |
252 |
+# find libs that have been built for a given profile |
253 |
+# Arguments: |
254 |
+# $1 - gnat profile for which to detect active libs |
255 |
+find_libs4profile() { |
256 |
+ libs=( $(find_all_libs) ) |
257 |
+ |
258 |
+ for (( i = 0 ; i < ${#libs[@]} ; i = i + 1 )) ; do |
259 |
+ [[ -f ${SPECSDIR}/${libs[$i]}/$1 ]] && echo "${libs[$i]}" |
260 |
+ done |
261 |
+} |
262 |
+ |
263 |
+ |
264 |
+ |
265 |
+ |
266 |
+## ----------------------- |
267 |
+# main action - central part of do_set and helpers |
268 |
+ |
269 |
+ |
270 |
+# extracts values of the passed var definition from given spec file |
271 |
+# params: |
272 |
+# $1: spec file (as generated by gnabuild.eclass) |
273 |
+# $2: variable name |
274 |
+get_var_from_spec() { |
275 |
+ local var=$(grep -e "^ *$2=" $1|cut -d= -f2) |
276 |
+ echo ${var} |
277 |
+} |
278 |
+ |
279 |
+ |
280 |
+# Cycle through given libs and form a ':' separated list of settings for the given |
281 |
+# var. Repeating settings are omitted, that is unique entry is added only first |
282 |
+# time it is encountered. |
283 |
+# |
284 |
+# params: |
285 |
+# $1 - name of env var to process |
286 |
+# $2 - name of gnat profile |
287 |
+# $3.. - list of libs to check (to avoid its composition every time) |
288 |
+# - the list is expanded to list of args at the point of call |
289 |
+get_lib_var_settings() { |
290 |
+ local envVar=$1 |
291 |
+ local toset=$2 |
292 |
+ #echo "get_lib_var_settings params:$@" >> /tmp/eselect-gnat.rep |
293 |
+ if [[ "none" != ${3} ]]; then |
294 |
+ local envString |
295 |
+ local specLine=$(get_var_from_spec ${SPECSDIR}/$3/${toset} ${envVar}) |
296 |
+ if [[ -n ${specLine} ]]; then |
297 |
+ envString="${specLine}" |
298 |
+ fi |
299 |
+ shift |
300 |
+ # |
301 |
+ while [[ -n $3 ]]; do |
302 |
+ specLine=$(get_var_from_spec ${SPECSDIR}/$3/${toset} ${envVar}) |
303 |
+ #echo "$3:${specLine}." >> /tmp/eselect-gnat.rep |
304 |
+ if [[ -n ${specLine} ]] && [[ ! ${envString} =~ ${specLine} ]]; then |
305 |
+ envString="${envString}:${specLine}" |
306 |
+ fi |
307 |
+ shift |
308 |
+ done |
309 |
+ echo "${envString}" |
310 |
+ fi |
311 |
+} |
312 |
+ |
313 |
+ |
314 |
+ |
315 |
+# The action! |
316 |
+# Part common for do_set and do_update of gnat.eselect, also used in gnat.eclass |
317 |
+# to set environment during lib build and installation |
318 |
+# |
319 |
+# params: |
320 |
+# $1 - profile to set (toset param inside) |
321 |
+# $2 - envfile |
322 |
+ |
323 |
+generate_envFile() { |
324 |
+ local toset=$1 |
325 |
+ local envfile=$2 |
326 |
+ |
327 |
+ local binpath="$(get_var_from_spec ${SPECSDIR}/${toset} binpath)" |
328 |
+ local libexecpath="$(get_var_from_spec ${SPECSDIR}/${toset} libexecpath)" |
329 |
+ local libs=( $(find_libs4profile ${toset}) ) |
330 |
+ #echo "generate_envFile: ${libs[@]}" >> /tmp/eselect-gnat.rep |
331 |
+ if (( 0 == ${#libs[@]} )); then |
332 |
+ libs="none" |
333 |
+ fi |
334 |
+ |
335 |
+ local MyPath="${binpath}:${libexecpath}:$(get_lib_var_settings PATH ${toset} ${libs[@]})" |
336 |
+ echo "PATH=${MyPath}" > "${envfile}" |
337 |
+ echo "ROOTPATH=${MyPath}" >> "${envfile}" |
338 |
+ echo "MANPATH=$(get_var_from_spec ${SPECSDIR}/${toset} manpath):$(get_lib_var_settings MANPATH ${toset} ${libs[@]})" >> "${envfile}" |
339 |
+ echo "INFOPATH=$(get_var_from_spec ${SPECSDIR}/${toset} infopath):$(get_lib_var_settings INFOPATH ${toset} ${libs[@]})" >> "${envfile}" |
340 |
+ # the next three use the common base |
341 |
+ local libBase=$(get_var_from_spec ${SPECSDIR}/${toset} ldpath) |
342 |
+ echo "COMPILER_PATH=${libexecpath}:${libBase}:" >> "${envfile}" |
343 |
+ echo "LDPATH=${libBase}:${libBase}/adalib:$(get_lib_var_settings LDPATH ${toset} ${libs[@]})" >> "${envfile}" |
344 |
+ echo "ADA_INCLUDE_PATH=${libBase}/adainclude:$(get_lib_var_settings ADA_INCLUDE_PATH ${toset} ${libs[@]})" >> "${envfile}" |
345 |
+ echo "ADA_OBJECTS_PATH=${libBase}/adalib:$(get_lib_var_settings ADA_OBJECTS_PATH ${toset} ${libs[@]})" >> "${envfile}" |
346 |
+ # ADA_PROJECT_PATH may not be set in any of the installed packages, |
347 |
+ # we should only create this line if cumulative var is non-empty |
348 |
+ My_ProjectPath=$(get_lib_var_settings ADA_PROJECT_PATH ${toset} ${libs[@]}) |
349 |
+ if [[ -n ${My_ProjectPath} ]]; then |
350 |
+ echo "ADA_PROJECT_PATH=${My_ProjectPath}" >> "${envfile}" |
351 |
+ fi |
352 |
+} |
353 |
+ |