1 |
This question relates to ebuild development, and is being asked by a |
2 |
non-developer. Apologies if there's a better forum for the question |
3 |
(perhaps gentoo-toolchain?) |
4 |
|
5 |
I've developed an ebuild for a package which requires GCJ >= 3.4.2 |
6 |
(GCJ is specifically required for its ability to translate Java to C |
7 |
for embedding). |
8 |
|
9 |
I run a x86-stable desktop, so my profile's basic GCC is at 3.3.5 |
10 |
(which was built without a GCJ use flag). I've installed a 3.4.3 GCC |
11 |
with GCJ using slots. |
12 |
|
13 |
Are there any suggestions for how my ebuild might identify whether |
14 |
there is a GCC installed, in any slot, which matches both the version |
15 |
requirement (>3.4.2) and the "gcj" USE requirement? |
16 |
|
17 |
The ebuild has this: |
18 |
|
19 |
DEPEND="${RDEPEND} |
20 |
>=sys-devel/gcc-3.4.2" |
21 |
|
22 |
which succeeds since that is installed. I also have this block |
23 |
commented out in my ebuild: |
24 |
|
25 |
#pkg_setup() { |
26 |
# if [[ ! $(built_with_use gcc gcj) ]] ; then |
27 |
# eerror 'Chandler build requires that GCC be built with the "gcj" USE flag' |
28 |
# die "exiting because of GCJ dependency" |
29 |
# fi |
30 |
#} |
31 |
|
32 |
If I uncomment it, this block will fail because my 3.3.5 GCC isn't |
33 |
"built_with_use" gcj and I think "best_version" (which built_with_use |
34 |
uses) only looks at my 3.3.5 installation. Even if I 'gcc-config' the |
35 |
3.4.3 version, best_version still looks at my 3.3.5. |
36 |
|
37 |
My goal is to make this ebuild find and use a working GCC if it is |
38 |
present, even in the presence of slots and mixed use flags. |
39 |
|
40 |
I'm not sure this is possible without some fairly serious scripting. |
41 |
Suggestions are welcome. |
42 |
|
43 |
One improvement might be to replace the built_with_use check with |
44 |
something like a `gcc-config -B`/gcj check, and check at runtime that |
45 |
it's version 3.4.2 or higher. That seems straightforward. |
46 |
|
47 |
I might also look at every profile returned by `gcc-config -l`, and |
48 |
try them one at a time until I found one that works. That's sort of |
49 |
what I want to encode, but may be more scripting than it is worth. |
50 |
|
51 |
Are there any other options, eclasses, or general approaches I should |
52 |
consider for this problem? |
53 |
|
54 |
Thanks for your time. |
55 |
|
56 |
-- jared@×××××××.com |
57 |
|
58 |
"One cannot mark the point without marking the path." |
59 |
-- |
60 |
gentoo-dev@g.o mailing list |