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: signature.asc
Description: PGP signature

Reply via email to