From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1OWIJl-0004vD-7M for garchives@archives.gentoo.org; Wed, 07 Jul 2010 00:16:59 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A515AE0965; Wed, 7 Jul 2010 00:16:40 +0000 (UTC) Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com [209.85.161.53]) by pigeon.gentoo.org (Postfix) with ESMTP id DD998E08AC for ; Wed, 7 Jul 2010 00:16:21 +0000 (UTC) Received: by fxm19 with SMTP id 19so5762325fxm.40 for ; Tue, 06 Jul 2010 17:16:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:references:in-reply-to:disposition-notification-to :mime-version:content-type:content-transfer-encoding:message-id; bh=YxS2MwCTrTU/epdADs9mIaOaBC0DNyzJxXhg09nLZAM=; b=eChJE+W/KQdGsWVDrNEIUBGbso/TsqeEzHyBkzXhixk2aRYFIQsxWUgqFt3OQ8b1/o n1ocii3E4IuIQ4Y+ka0SudeNQWRCYbul1mtDVFNCW/Al+popj+LznC67e6F3Qwv3ZXbD I0kt09qQ1N5DbqFCoOofXlGgiNBcIa2psorNs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:references:in-reply-to :disposition-notification-to:mime-version:content-type :content-transfer-encoding:message-id; b=ad0Jsm1vOeCuTaaKzV1IN0OS2BSWS0KNXbsGQbVxWwJ+gVau82wYxDwYiAEC9aHxbA ix0tqwHJc02RUCwu7oANZZecCJhZCavr+3aVaCKZSEpB3UYU5tvPpgCeafWTFhAS9R/A XNmUFbPBSMoUAST5at8BxsRr+fTgOyy1EcMnU= Received: by 10.86.27.5 with SMTP id a5mr4400123fga.32.1278461780336; Tue, 06 Jul 2010 17:16:20 -0700 (PDT) Received: from lebrodyl.localnet (abtq232.neoplus.adsl.tpnet.pl [83.8.162.232]) by mx.google.com with ESMTPS id h4sm13129543fai.6.2010.07.06.17.16.18 (version=SSLv3 cipher=RC4-MD5); Tue, 06 Jul 2010 17:16:19 -0700 (PDT) From: Maciej Mrozowski To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] Re: [Survey || RFC] autotools-utils.eclass Date: Wed, 7 Jul 2010 02:16:13 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.33-gentoo-r2; KDE/4.4.5; x86_64; ; ) References: <201005251302.56615.reavertm@gmail.com> <201005311529.02461.reavertm@gmail.com> <20100602233209.GZ27745@ohnopublishing.net> In-Reply-To: <20100602233209.GZ27745@ohnopublishing.net> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1682061.tIEWp0tOp4"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201007070216.13662.reavertm@gmail.com> X-Archives-Salt: 053d60f8-88be-492a-97d7-f39427128065 X-Archives-Hash: bd2297407970519da4ef87d62200a7c8 --nextPart1682061.tIEWp0tOp4 Content-Type: multipart/mixed; boundary="Boundary-01=_Nd8MMsDdNNmz74T" Content-Transfer-Encoding: 7bit --Boundary-01=_Nd8MMsDdNNmz74T Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 03 of June 2010 01:32:09 Nathan Phillip Brink wrote: > On Mon, May 31, 2010 at 03:29:01PM +0200, Maciej Mrozowski wrote: > > On Wednesday 26 of May 2010 19:27:43 Mike Frysinger wrote: > > > On Wednesday 26 May 2010 05:38:00 Maciej Mrozowski wrote: > > > > I've updated documentation, added example usage and option to keep > > > > libtool files (ltdl.so supposedly needs those as I was told, no idea > > > > what for). >=20 > IMO, ltdl.so is probably just being silly. Perhaps these files contain > information that is useful on non-Linux systems for dlopen()ing > plugins. >=20 > > > more applicable to us w/Linux is that static linking with libtool nee= ds > > > them. the AUTOTOOLS_KEEP_LA_FILES seems kind of spurious considering > > > current tree behavior and assumption of gnu-capable linking systems. > >=20 > > It is spurious when we forget about run-time dynamic linking (plugins) = in > > some apps. > > libtool loader (ltdl.so) needs .la files unfortunately. One example - > > imagemagick - removing .la files for coders makes 'convert' unable to > > locate them (silly, but hey...). >=20 > This case can be caught by checking if the .la file has the following in > it: `` > # Should we warn about portability when linking against -modules? > shouldnotlink=3Dyes > '' Excellent. Eclass updated, see attachment. AUTOTOOLS_KEEP_LA_FILES option=20 removed. Now removing .la files relies only on shouldnotlink value (and=20 static-libs presence in IUSE that is). > Removing .la files which are useless on a given system would be very > nice. It would be even more useful if unused .a files could be swept > away at the same time :-). They are - just add static-libs to IUSE and disable said USE flag when=20 emerging. I've also had an idea to be smarter and to look for patches (PATCHES array)= =20 updating any .m4, Makefile.{ac,in}, configure.{ac.in} files and to run=20 eautoreconf automatically in ${eclass}_src_prepare but I've decided it's a = bit=20 too much. I may rethink the idea later though. If there are no objections nor further comments, I'd like to unleash new=20 eclass for public consumption within a few days. Real-world example ebuild attached, also there's more extensive (but purely= =20 academic) example in eclass itself. =2D-=20 regards MM --Boundary-01=_Nd8MMsDdNNmz74T Content-Type: text/plain; charset="UTF-8"; name="autotools-utils.eclass" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="autotools-utils.eclass" # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # @ECLASS: autotools-utils.eclass # @MAINTAINER: # Maciej Mrozowski # @BLURB: common ebuild functions for autotools-based packages # @DESCRIPTION: # autotools-utils.eclass is autotools.eclass(5) and base.eclass(5) wrapper # providing all inherited features along with econf arguments as Bash array, # out of source build with overridable build dir location, static archives # handling, libtool files removal, enable/disable debug handling. # # @EXAMPLE: # Typical ebuild using autotools-utils.eclass: # # @CODE # EAPI="2" # # inherit autotools-utils # # DESCRIPTION="Foo bar application" # HOMEPAGE="http://example.org/foo/" # SRC_URI="mirror://sourceforge/foo/${P}.tar.bz2" # # LICENSE="LGPL-2.1" # KEYWORDS="" # SLOT="0" # IUSE="debug doc examples qt4 static-libs tiff" # # CDEPEND=" # media-libs/libpng:0 # qt4? ( # x11-libs/qt-core:4 # x11-libs/qt-gui:4 # ) # tiff? ( media-libs/tiff:0 ) # " # RDEPEND="${CDEPEND} # !media-gfx/bar # " # DEPEND="${CDEPEND} # doc? ( app-doc/doxygen ) # " # # # bug 123456 # AUTOTOOLS_IN_SOURCE_BUILD=1 # # DOCS=(AUTHORS ChangeLog README "Read me.txt" TODO) # # PATCHES=( # "${FILESDIR}/${P}-gcc44.patch" # bug 123458 # "${FILESDIR}/${P}-as-needed.patch" # "${FILESDIR}/${P}-unbundle_libpng.patch" # ) # # src_configure() { # myeconfargs=( # $(use_with qt4) # $(use_enable threads multithreading) # $(use_with tiff) # ) # autotools-utils_src_configure # } # # src_compile() { # autotools-utils_src_compile # use doc && autotools-utils_src_compile docs # } # # src_install() { # use doc && HTML_DOCS=("${AUTOTOOLS_BUILD_DIR}/apidocs/html/") # autotools-utils_src_install # if use examples; then # dobin "${AUTOTOOLS_BUILD_DIR}"/foo_example{1,2,3} \\ # || die 'dobin examples failed' # fi # } # # @CODE # Keep variable names synced with cmake-utils and the other way around! case ${EAPI:-0} in 2|3|4) ;; *) DEPEND="EAPI-TOO-OLD" ;; esac inherit autotools base EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test # @ECLASS-VARIABLE: AUTOTOOLS_BUILD_DIR # @DESCRIPTION: # Build directory, location where all autotools generated files should be # placed. For out of source builds it defaults to ${WORKDIR}/${P}_build. # @ECLASS-VARIABLE: AUTOTOOLS_IN_SOURCE_BUILD # @DESCRIPTION: # Set to enable in-source build. # @ECLASS-VARIABLE: ECONF_SOURCE # @DESCRIPTION: # Specify location of autotools' configure script. By default it uses ${S}. # @ECLASS-VARIABLE: myeconfargs # @DESCRIPTION: # Optional econf arguments as Bash array. Should be defined before calling src_configure. # @CODE # src_configure() { # myeconfargs=( # --disable-readline # --with-confdir="/etc/nasty foo confdir/" # $(use_enable debug cnddebug) # $(use_enable threads multithreading) # ) # autotools-utils_src_configure # } # @CODE # Determine using IN or OUT source build _check_build_dir() { : ${ECONF_SOURCE:=${S}} if [[ -n ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then AUTOTOOLS_BUILD_DIR="${ECONF_SOURCE}" else : ${AUTOTOOLS_BUILD_DIR:=${WORKDIR}/${P}_build} fi echo ">>> Working in BUILD_DIR: \"$AUTOTOOLS_BUILD_DIR\"" } # @FUNCTION: autotools-utils_src_prepare # @DESCRIPTION: # The src_prepare function, supporting PATCHES array and user patches. # See base.eclass(5) for reference. autotools-utils_src_prepare() { debug-print-function $FUNCNAME "$@" base_src_prepare } # @FUNCTION: autotools-utils_src_configure # @DESCRIPTION: # The src_configure function. For out of source build it creates build # directory and runs econf there. Configuration parameters defined # in myeconfargs are passed here to econf. Additionally following USE # flags are known: # # IUSE="debug" passes --disable-debug/--enable-debug to econf respectively. # # IUSE="static-libs" passes --enable-shared and either --disable-static/--enable-static # to econf respectively. autotools-utils_src_configure() { debug-print-function $FUNCNAME "$@" local econfargs=(${myeconfargs[@]}) # Handle debug found in IUSE if has debug ${IUSE//+}; then econfargs+=($(use_enable debug)) fi # Handle static-libs found in IUSE, disable them by default if has static-libs ${IUSE//+}; then econfargs+=( --enable-shared $(use_enable static-libs static) ) fi _check_build_dir mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed" pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null base_src_configure "${econfargs[@]}" popd > /dev/null } # @FUNCTION: autotools-utils_src_compile # @DESCRIPTION: # The autotools src_compile function, invokes emake in specified AUTOTOOLS_BUILD_DIR. autotools-utils_src_compile() { debug-print-function $FUNCNAME "$@" _check_build_dir pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null base_src_compile "$@" popd > /dev/null } # @FUNCTION: autotools-utils_src_install # @DESCRIPTION: # The autotools src_install function. Runs emake install and removes libtool files # when static-libs USE flag is defined and unset. # DOCS and HTML_DOCS arrays are supported. See base.eclass(5) for reference. autotools-utils_src_install() { debug-print-function $FUNCNAME "$@" _check_build_dir pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null base_src_install popd > /dev/null # Remove libtool files if has static-libs ${IUSE//+} && ! use static-libs; then local f for f in $(find "${D}" -type f -name '*.la'); do # Keep only .la files with shouldnotlink=yes - likely plugins [[ -n `sed -ne '/^shouldnotlink=yes$/p' "${f}"` ]] || rm -f "${f}" done fi } # @FUNCTION: autotools-utils_src_test # @DESCRIPTION: # The autotools src_test function. Runs emake check in build directory. autotools-utils_src_test() { debug-print-function ${FUNCNAME} "$@" _check_build_dir pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null # Run default src_test as defined in ebuild.sh default_src_test popd > /dev/null } --Boundary-01=_Nd8MMsDdNNmz74T Content-Type: text/plain; charset="UTF-8"; name="plib-1.8.5-r1.ebuild" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="plib-1.8.5-r1.ebuild" # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/media-libs/plib/plib-1.8.5.ebuild,v 1.6 2009/12/26 16:59:50 armin76 Exp $ EAPI=2 WANT_AUTOCONF=2.5 WANT_AUTOMAKE=1.9 inherit autotools-utils DESCRIPTION="multimedia library used by many games" HOMEPAGE="http://plib.sourceforge.net/" SRC_URI="http://plib.sourceforge.net/dist/${P}.tar.gz" LICENSE="LGPL-2" SLOT="0" KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~sparc ~x86" IUSE="static-libs" RDEPEND=" media-libs/libsdl virtual/glut virtual/opengl " DEPEND="${RDEPEND}" PATCHES=( "${FILESDIR}/${P}-shared-libs.patch" ) DOCS=(AUTHORS ChangeLog KNOWN_BUGS NOTICE README TODO-1.6 TODO-2.0 TODO_AFTER135) src_prepare() { autotools-utils_src_prepare eautoreconf } --Boundary-01=_Nd8MMsDdNNmz74T-- --nextPart1682061.tIEWp0tOp4 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) iEYEABECAAYFAkwzx00ACgkQFuHa/bHpVdtzJgCdFO7ENDV9H2QXWvHFSNzbT+2W fZoAoJhykwtI0p4e1Kbmh6rNCivasePc =ASMH -----END PGP SIGNATURE----- --nextPart1682061.tIEWp0tOp4--