Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-devhelp
Navigation:
Lists: gentoo-devhelp: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-devhelp@g.o
From: Dan Douglas <ormaaj@...>
Subject: Re: Trouble with package.env files
Date: Sun, 27 May 2012 15:46:55 -0500
On Sunday, May 27, 2012 11:21:31 PM Nikos Chantziaras wrote:
> I have this in /etc/portage/package.env:
> 
>    app-emulation/emul-linux-x86-soundlibs soundlibs-delete-jack.conf
> 
> and this in /etc/portage/env/soundlibs-delete-jack.conf:
> 
>    if [ "${EBUILD_PHASE}" == "src_prepare"] ;
>    then
>        rm -rf "${S}"/usr/lib32/jack
>        rm -f $(find "${S}" -name 'libjack*')
>    fi

The env/!(bashrc) files are parsed using Python shlex at the time emerge is 
run, accepting essentially the same types of expressions that are valid in 
/etc/make.conf. It never goes through a shell. The reason this is "preferred" 
is certainly for performance, and due to certain things not being possible in 
abashrc such as setting FEATURES.

The two options for defining phase hooks are the portage/bashrc file, and 
portage/env/CATEGORY/PKG. The bashrc file is global and if present always runs, 
while the package-specific ones are of course package-specific.

Personally, I just use the global bashrc and handle the logic for selecting 
packages internally. I find it a bit easier to manage than many separate files.
 
setupHookPtrs() {
    set -- "$@" 'categoryPtrs["$1"]' "$1"'["$2"]'
    local -A categoryPtrs=(
        [app-shells]='(
            [bash]=doBash
            [ksh]=doKsh
            )'
        [media-gfx]='(
            [digikam]=dgKamFix
            )'
        [sys-devel]='(
            [binutils]=doBinutils
            )'
        [www-client]='(
            [chromium]=chromiumHack
            )'
        ) \
        ${categoryPtrs["$1"]+"$1"="${!3}"}
        ${categoryPtrs["$1"]+"${!4-:}"}          # Call whatever function.
}

setupHookPtrs "$CATEGORY" "$PN"

-- 
Dan Douglas
Attachment:
signature.asc (This is a digitally signed message part.)
References:
Trouble with package.env files
-- Nikos Chantziaras
Navigation:
Lists: gentoo-devhelp: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: Trouble with package.env files
Next by thread:
Re: Trouble with package.env files
Previous by date:
Re: Trouble with package.env files
Next by date:
Re: Trouble with package.env files


Updated May 28, 2012

Summary: Archive of the gentoo-devhelp mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.