Blag

He's not dead, he's resting

EAPI 3: default src_install

This is part of a series on EAPI 3.

EAPI 3 will feature a default src_install that isn’t just a no-op. While it won’t eliminate the need for some packages to write their own implementation, it will help in a good number of cases.

The exact default is still subject to bikeshedding and could be changed at any point right up until PMS is tagged for EAPI 3. Right now we’re going with the following, and it’s very likely the final choice will look more or less like this:

src_install() {
    if [[ -f Makefile ]] || [[ -f GNUmakefile ]] || [[ -f makefile ]]; then
        emake DESTDIR="${D}" install
    fi

    if ! declare -p DOCS >/dev/null 2>&1 ; then
        local d
        for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \
                THANKS BUGS FAQ CREDITS CHANGELOG ; do
            [[ -s "${d}" ]] && dodoc "${d}"
        done
    elif declare -p DOCS | grep -q '^declare -a ' ; then
        dodoc "${DOCS[@]}"
    else
        dodoc ${DOCS}
    fi
}

Note the following:

  • There will be a DOCS variable. This was decided by a Council vote, since not everyone sees the obvious sense of the idea.
  • If something is explicitly listed in DOCS, it will be an error for it not to exist. But if we’re using the default values, things are only installed as documentation if they’re there and not empty.
  • We don’t use -j1 for the install. This will break some packages built using older autotools. This is in line with Gentoo policy.

The first practical non-empty src_install was in exheres-0. The exheres-0 version remains considerably more flexible and parametrisable than the above.

Advertisements

One response to “EAPI 3: default src_install

  1. Pingback: What’s in EAPI 3? « Ciaran McCreesh’s Blag

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s