On Thu, 2 May 2013 14:26:11 +0200
Michał Górny <mgo...@gentoo.org> wrote:

> 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.

For example, the alsa-lib ebuild could be changed like the following:

Index: alsa-lib-1.0.27-r3.ebuild
===================================================================
RCS file: 
/var/cvsroot/gentoo-x86/media-libs/alsa-lib/alsa-lib-1.0.27-r3.ebuild,v
retrieving revision 1.1
diff -u -B -r1.1 alsa-lib-1.0.27-r3.ebuild
--- alsa-lib-1.0.27-r3.ebuild   3 May 2013 14:38:28 -0000       1.1
+++ alsa-lib-1.0.27-r3.ebuild   4 May 2013 07:26:08 -0000
@@ -4,9 +4,11 @@
 
 EAPI=5
 
+AUTOTOOLS_AUTORECONF=1
+AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
 PYTHON_COMPAT=( python2_7 )
 
-inherit autotools eutils multilib multilib-minimal python-single-r1
+inherit autotools-multilib multilib python-single-r1
 
 DESCRIPTION="Advanced Linux Sound Architecture Library"
 HOMEPAGE="http://www.alsa-project.org/";
@@ -27,47 +29,47 @@
        use python && python-single-r1_pkg_setup
 }
 
-src_prepare() {
+autotools_prepare_all() {
        # dlclose, pcm, kernel, inline, inline-2 are all from upstream
-       epatch \
+       local PATCHES=(
                "${FILESDIR}"/1.0.25-extraneous-cflags.diff \
                "${FILESDIR}"/${P}-{dlclose,pcm,kernel}.patch \
                "${FILESDIR}"/${P}-inline{,-2}.patch
+       )
 
        sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.in || die 
#466980
 
-       epatch_user
-
-       eautoreconf
        # if eautoreconf'd with recent autoconf, then epunt_cxx is
        # unncessary wrt #460974
 #      epunt_cxx
+
+       edefault
 }
 
-multilib_src_configure() {
-       local myconf
+autotools_configure() {
+       local myeconfargs=(
+               --enable-shared
+               --disable-resmgr
+               --enable-rawmidi
+               --enable-seq
+               --enable-aload
+               $(use_with debug)
+               $(use_enable alisp)
+       )
+
        # enable Python only on final ABI
        if [[ ${ABI} == ${DEFAULT_ABI} ]]; then
-               myconf="$(use_enable python)"
+               myeconfargs+=( $(use_enable python) )
        else
-               myconf="--disable-python"
+               myeconfargs+=( --disable-python )
        fi
-       use elibc_uclibc && myconf+=" --without-versioned"
+       use elibc_uclibc && myeconfargs+=( --without-versioned )
 
-       ECONF_SOURCE=${S} \
-       econf \
-               --enable-shared \
-               --disable-resmgr \
-               --enable-rawmidi \
-               --enable-seq \
-               --enable-aload \
-               $(use_with debug) \
-               $(use_enable alisp) \
-               ${myconf}
+       edefault
 }
 
-multilib_src_compile() {
-       emake
+autotools_compile() {
+       edefault
 
        if [[ ${ABI} == ${DEFAULT_ABI} ]] && use doc; then
                emake doc
@@ -76,15 +78,9 @@
        fi
 }
 
-multilib_src_install() {
-       emake DESTDIR="${D}" install
+autotools_install() {
+       edefault
        if [[ ${ABI} == ${DEFAULT_ABI} ]] && use doc; then
                dohtml -r doc/doxygen/html/.
        fi
 }
-
-multilib_src_install_all() {
-       prune_libtool_files --all
-       find "${ED}"/usr/$(get_libdir)/alsa-lib -name '*.a' -exec rm -f {} +
-       dodoc ChangeLog TODO
-}


-- 
Best regards,
Michał Górny

Attachment: signature.asc
Description: PGP signature

Reply via email to