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 1OHD40-0001tq-Rc for garchives@archives.gentoo.org; Wed, 26 May 2010 09:38:13 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A5BA6E0C76; Wed, 26 May 2010 09:38:06 +0000 (UTC) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.152]) by pigeon.gentoo.org (Postfix) with ESMTP id 068F0E0C2E for ; Wed, 26 May 2010 09:37:54 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 16so528563fgg.10 for ; Wed, 26 May 2010 02:37:54 -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:message-id; bh=y+hBphOButUPDaHwMWx9FHrZfdZgQsKHuQfC1m7Zp2I=; b=G4a/fFco97MdLRfliFULljyET99OnesoThbye3IVAnec8B04/3S7fgbrw0s5UhR3Yu SpeKtuRpZMO/zC4qLwXCtzaszikZ8m+mHiZubF3jQXQxC9VwCpWPMkavkWbHDdhXzW2N osGUl1e9BBdZY1j5/THiQrP5txIcvX9gpP2d0= 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:message-id; b=dJgj3XxrwetFKcZEZo9MsNsD8GW2OQHx0jljMo1P/pEVOd3LLhKLeoCx7HQKYe/hll u/RIqoko0dw7jSTzjgeo2By+EhxsZP94msGepuAunkC0ENUPlSZOS8imre8o2OS+TJQZ XXwLeB09LydSCAMcYjkSZlPkJWBuz2ECPEyRA= Received: by 10.87.2.15 with SMTP id e15mr2815516fgi.23.1274866674322; Wed, 26 May 2010 02:37:54 -0700 (PDT) Received: from lebrodyl.localnet (aafn79.neoplus.adsl.tpnet.pl [83.4.143.79]) by mx.google.com with ESMTPS id 12sm6973807fgg.29.2010.05.26.02.37.53 (version=SSLv3 cipher=RC4-MD5); Wed, 26 May 2010 02:37:53 -0700 (PDT) From: Maciej Mrozowski To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] Re: [Survey || RFC] autotools-utils.eclass Date: Wed, 26 May 2010 11:38:00 +0200 User-Agent: KMail/1.13.3 (Linux/2.6.32-gentoo-r7; KDE/4.4.3; x86_64; ; ) References: <201005251302.56615.reavertm@gmail.com> <201005260031.21660.vapier@gentoo.org> In-Reply-To: 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/Mixed; boundary="Boundary-00=_5vO/LM/d7UClv/R" Message-Id: <201005261138.01207.reavertm@gmail.com> X-Archives-Salt: 9ec5e626-ef55-4de9-8215-272dda933199 X-Archives-Hash: 29ca4e9fe40238c84a4dee3239be2601 --Boundary-00=_5vO/LM/d7UClv/R Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Wednesday 26 of May 2010 11:12:10 Duncan wrote: > Mike Frysinger posted on Wed, 26 May 2010 00:31:21 -0400 as excerpted: > > On Tuesday 25 May 2010 23:59:22 Maciej Mrozowski wrote: > >> On Tuesday 25 of May 2010 20:31:33 Mike Frysinger wrote: > >>> the src_test func looks like its copying & pasting stuff from the PM. > >>> this really should be kept in the PM without duplicating it > >>> everywhere. > >> > >> Unfortunately src_test needs to be called in build dir (which is > >> unknown to PM). > >> Calling default_src_test is the best I could come up with. > > > > should be fine > > What about a one-liner explaining why it's here, so the next guy to > look at it won't be having MF's reaction all over again? Again? 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). -- regards MM --Boundary-00=_5vO/LM/d7UClv/R 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 archives removal, enable/disable debug handling. # # @EXAMPLE: # Typical ebuild using autotools-utils.eclass: # # @CODE # EAPI="2" # # inherit autotools-utils # # DESCRIPTION="Foo bar application" # HOMEPAGE="http://foo.org/" # SRC_URI="mirror://sourceforge/foo/${P}.tar.bz2" # # LICENSE="LGPL-2.1" # KEYWORDS="" # SLOT="0" # IUSE="debug examples qt4 static-libs tiff" # # DEPEND=" # media-libs/libpng:0 # qt4? ( # x11-libs/qt-core:4 # x11-libs/qt-gui:4 # ) # tiff? ( media-libs/tiff:0 ) # " # RDEPEND="${DEPEND} # !media-gfx/bar # " # # # 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_install() { # 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: AUTOTOOLS_KEEP_LA_FILES # @DESCRIPTION: # Do not remove libtool files. # @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 "$@" # TODO Maybe some smart patching and automatic eautoreconf call? 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. # DOCS and HTML_DOCS variables 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 archives if [[ -z ${AUTOTOOLS_KEEP_LA_FILES} ]] && has static-libs ${IUSE//+} && ! use static-libs; then find "${D}" -type f -name '*.la' -exec rm -f {} + \ || die 'libtool archive removal failed' 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-00=_5vO/LM/d7UClv/R--