| View previous topic :: View next topic |
| Author |
Message |
big_gie Apprentice


Joined: 31 Aug 2004 Posts: 158
|
Posted: Mon Jan 09, 2012 9:12 pm Post subject: Best way to detect architecture in ebuild? |
|
|
Hi all,
I'm looking for the official way of detecting the machine's architecture in an ebuild.
I need this because some binary packages have different SRC_URI for different architectures and thus a different S too.
I was using if "[[ "${ARCH}" == "amd64" ]]; then" before but a user reported that ARCH was not set when using cave/paludis (https://github.com/nbigaouette/ebuilds/issues/8), so I changed this to "if use amd64; then". It seems that doing so breaks every other users though...
I could not find any information on the best way to handle these architecture dependencies in ebuilds... It seems SRC_URI can take advantage of use flags:
| Code: | SRC_URI="
x86? ( http://url/${ARCHIVE_X86} )
amd64? ( http://url/${ARCHIVE_AMD64} )
" |
but what about setting "S" (or other variables)? I tried:
| Code: | S="
x86? ( http://url/${ARCHIVE_X86} )
amd64? ( http://url/${ARCHIVE_AMD64} )
" | without success... the "arch ? ..." usage seems to be available only inside functions and not for variables. Thus the ebuilds get complicated because of that...
Where can I find information on how to manage different architecture more easily?
Thanks a lot. |
|
| Back to top |
|
 |
avx Advocate


Joined: 21 Jun 2004 Posts: 2152
|
Posted: Tue Jan 10, 2012 12:14 am Post subject: |
|
|
?
Just did a quick try with this in an "einfo" and it gets evaluated, so should work everywhere in the ebuild - can't say anything about paludis or other packagemanagers, though. _________________ ++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>. |
|
| Back to top |
|
 |
dol-sen Retired Dev


Joined: 30 Jun 2002 Posts: 2805 Location: Richmond, BC, Canada
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|