Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: reavertm@g.o, multilib@g.o
Subject: Re: [gentoo-dev] [PATCHES] Sub-phase functions in autotools-utils & autotools-multilib
Date: Sat, 04 May 2013 07:28:35
Message-Id: 20130504092820.586f889b@gentoo.org
In Reply to: [gentoo-dev] [PATCHES] Sub-phase functions in autotools-utils & autotools-multilib by "Michał Górny"
1 On Thu, 2 May 2013 14:26:11 +0200
2 Michał Górny <mgorny@g.o> wrote:
3
4 > I've thought for a bit and got the conclusion that the best solution
5 > for quite an irritating syntax of autotools-multilib is to use
6 > sub-phase functions. To increase consistency between ebuilds, the same
7 > phases can be used in autotools-utils directly.
8
9 For example, the alsa-lib ebuild could be changed like the following:
10
11 Index: alsa-lib-1.0.27-r3.ebuild
12 ===================================================================
13 RCS file: /var/cvsroot/gentoo-x86/media-libs/alsa-lib/alsa-lib-1.0.27-r3.ebuild,v
14 retrieving revision 1.1
15 diff -u -B -r1.1 alsa-lib-1.0.27-r3.ebuild
16 --- alsa-lib-1.0.27-r3.ebuild 3 May 2013 14:38:28 -0000 1.1
17 +++ alsa-lib-1.0.27-r3.ebuild 4 May 2013 07:26:08 -0000
18 @@ -4,9 +4,11 @@
19
20 EAPI=5
21
22 +AUTOTOOLS_AUTORECONF=1
23 +AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
24 PYTHON_COMPAT=( python2_7 )
25
26 -inherit autotools eutils multilib multilib-minimal python-single-r1
27 +inherit autotools-multilib multilib python-single-r1
28
29 DESCRIPTION="Advanced Linux Sound Architecture Library"
30 HOMEPAGE="http://www.alsa-project.org/"
31 @@ -27,47 +29,47 @@
32 use python && python-single-r1_pkg_setup
33 }
34
35 -src_prepare() {
36 +autotools_prepare_all() {
37 # dlclose, pcm, kernel, inline, inline-2 are all from upstream
38 - epatch \
39 + local PATCHES=(
40 "${FILESDIR}"/1.0.25-extraneous-cflags.diff \
41 "${FILESDIR}"/${P}-{dlclose,pcm,kernel}.patch \
42 "${FILESDIR}"/${P}-inline{,-2}.patch
43 + )
44
45 sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.in || die #466980
46
47 - epatch_user
48 -
49 - eautoreconf
50 # if eautoreconf'd with recent autoconf, then epunt_cxx is
51 # unncessary wrt #460974
52 # epunt_cxx
53 +
54 + edefault
55 }
56
57 -multilib_src_configure() {
58 - local myconf
59 +autotools_configure() {
60 + local myeconfargs=(
61 + --enable-shared
62 + --disable-resmgr
63 + --enable-rawmidi
64 + --enable-seq
65 + --enable-aload
66 + $(use_with debug)
67 + $(use_enable alisp)
68 + )
69 +
70 # enable Python only on final ABI
71 if [[ ${ABI} == ${DEFAULT_ABI} ]]; then
72 - myconf="$(use_enable python)"
73 + myeconfargs+=( $(use_enable python) )
74 else
75 - myconf="--disable-python"
76 + myeconfargs+=( --disable-python )
77 fi
78 - use elibc_uclibc && myconf+=" --without-versioned"
79 + use elibc_uclibc && myeconfargs+=( --without-versioned )
80
81 - ECONF_SOURCE=${S} \
82 - econf \
83 - --enable-shared \
84 - --disable-resmgr \
85 - --enable-rawmidi \
86 - --enable-seq \
87 - --enable-aload \
88 - $(use_with debug) \
89 - $(use_enable alisp) \
90 - ${myconf}
91 + edefault
92 }
93
94 -multilib_src_compile() {
95 - emake
96 +autotools_compile() {
97 + edefault
98
99 if [[ ${ABI} == ${DEFAULT_ABI} ]] && use doc; then
100 emake doc
101 @@ -76,15 +78,9 @@
102 fi
103 }
104
105 -multilib_src_install() {
106 - emake DESTDIR="${D}" install
107 +autotools_install() {
108 + edefault
109 if [[ ${ABI} == ${DEFAULT_ABI} ]] && use doc; then
110 dohtml -r doc/doxygen/html/.
111 fi
112 }
113 -
114 -multilib_src_install_all() {
115 - prune_libtool_files --all
116 - find "${ED}"/usr/$(get_libdir)/alsa-lib -name '*.a' -exec rm -f {} +
117 - dodoc ChangeLog TODO
118 -}
119
120
121 --
122 Best regards,
123 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature