Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 315129 - Additional variables available within ebuilds
Summary: Additional variables available within ebuilds
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Quality Assurance Team
URL: http://www.gentoo.org/proj/en/glep/gl...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-13 22:05 UTC by Tim Cera
Modified: 2012-06-23 23:13 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Cera 2010-04-13 22:05:00 UTC
Currently the $ARCH variable is available within ebuilds, but not the other parts of GLEP 22.  Propose $USERLAND, $LIBC, and $KERNEL.

Reference: 
http://www.gentoo.org/proj/en/glep/glep-0022.html
Comment 1 Chí-Thanh Christopher Nguyễn gentoo-dev 2010-04-14 00:00:26 UTC
GLEP 22 refers to KEYWORDS not variables. Please clarify.
Comment 2 Tim Cera 2010-04-14 01:06:01 UTC
GLEP 22 defines KEYWORDS as a combination of ARCH-KERNEL-USERLAND-LIBC

When writing ebuilds I can use $ARCH, for example:

        case ${ARCH} in
                x86)        PLATFORM="IA32";;
                ppc|ppc64)  PLATFORM="POWERPC";;
                amd64)      PLATFORM="AMD64";;
                ia64)       PLATFORM="IA64";;
                *)          die "Architecture ${ARCH} not supported" ;;
        esac

It would be nice to have the a similar ability with KERNEL, for example:

        case ${KERNEL} in
                freebsd|netbsd|openbsd|dragonfly)  OSNAME="BSD" ;;
                macosx)                            OSNAME="OSX" ;;
                *)                                 OSNAME="LINUX" ;;
        esac

This is just an example, and I think that KERNEL would be a poor name which would probably interfere with other things...  
Comment 3 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-08-10 14:26:40 UTC
(In reply to comment #2)

> It would be nice to have the a similar ability with KERNEL, for example:

It is.

%% portageq envvar ARCH
amd64
%% portageq envvar KERNEL
linux