public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: Gentoo Developer Mailing List <gentoo-dev@lists.gentoo.org>
Cc: reavertm@gentoo.org, multilib@gentoo.org
Subject: [gentoo-dev] [PATCHES] Sub-phase functions in autotools-utils & autotools-multilib
Date: Thu, 2 May 2013 14:26:11 +0200	[thread overview]
Message-ID: <20130502142611.18a76960@gentoo.org> (raw)

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

Hi,

I've thought for a bit and got the conclusion that the best solution
for quite an irritating syntax of autotools-multilib is to use
sub-phase functions. To increase consistency between ebuilds, the same
phases can be used in autotools-utils directly.

The idea is that current ebuild looking like:

  src_prepare() {
    sed ...
    autotools-utils_src_prepare
  }

  src_configure() {
    local myeconfargs=(
      --with-foo
      --with-bar
    )
    autotools-utils_src_configure
  }

  src_install() {
    use doc && local HTML_DOCS=...

    autotools-utils_src_install

    doinitd ...
    dobin "${BUILD_DIR}"/something/something
  }

could be written as:

  autotools_configure() {
    local myeconfargs=(
      --with-foo
      --with-bar
    )
    edefault
  }

  autotools_install() {
    edefault
    dobin something/something
  }

  autotools_install_all() {
    use doc && local HTML_DOCS=...

    edefault

    doinitd ...
  }

While this seems rather cosmetic, it becomes incredibly helpful when it
comes to multilib or working inside BUILD_DIR.

The sub-phases without '_all' suffix are run inside BUILD_DIR, and
repeated for each multilib ABI. The sub-phases with '_all' are always
run only once, and inside S.

This provides a meaningful split between the two parts
of autotools-utils_src_install (and default_src_install too), and makes
it possible to hack stuff in multilib without having to rewrite
the 'multilib_foreach_impl' lines all the time.

For example:

  src_configure() {
    my_configure() {
      local myeconfargs=(
        ... # something ABI-conditional here
      )
      autotools-utils_src_configure
    }
    multilib_parallel_foreach_abi my_configure
  }

can be replaced with much simpler:

  autotools_configure() {
    local myeconfargs=(
      ... # something ABI-conditional here
    )
    edefault
  }

What are your thoughts? The patch is sent in reply to this mail.

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]

             reply	other threads:[~2013-05-02 12:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-02 12:26 Michał Górny [this message]
2013-05-02 12:26 ` [gentoo-dev] [PATCH] Introduce autotools_* sub-phase functions to make overriding easier Michał Górny
2013-05-04  7:28 ` [gentoo-dev] [PATCHES] Sub-phase functions in autotools-utils & autotools-multilib Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2013-09-23 20:59 Greg Turner
2013-09-23 21:16 ` Michał Górny
2013-09-23 21:27   ` Greg Turner
2013-09-23 21:28   ` Greg Turner
2013-09-24  8:40   ` Greg Turner
2013-09-24 11:29     ` Michał Górny

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=20130502142611.18a76960@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=multilib@gentoo.org \
    --cc=reavertm@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