public inbox for gentoo-devhelp@lists.gentoo.org
 help / color / mirror / Atom feed
From: Dan Douglas <ormaaj@gmail.com>
To: gentoo-devhelp@lists.gentoo.org
Subject: Re: [gentoo-devhelp] Trouble with package.env files
Date: Sun, 27 May 2012 15:46:55 -0500	[thread overview]
Message-ID: <1618304.LGGTs6sFNt@smorgbox> (raw)
In-Reply-To: <jpu2dd$sgo$1@dough.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1703 bytes --]

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 #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  parent reply	other threads:[~2012-05-27 20:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-27 20:21 [gentoo-devhelp] Trouble with package.env files Nikos Chantziaras
2012-05-27 20:33 ` [gentoo-devhelp] " Nikos Chantziaras
2012-05-27 20:46 ` Dan Douglas [this message]
2012-05-28 16:25 ` [gentoo-devhelp] " Michael Orlitzky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1618304.LGGTs6sFNt@smorgbox \
    --to=ormaaj@gmail.com \
    --cc=gentoo-devhelp@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox