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 1OGruY-0002qt-Qj for garchives@archives.gentoo.org; Tue, 25 May 2010 11:03:06 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6697AE0A5E; Tue, 25 May 2010 11:02:56 +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 17B36E09FD for ; Tue, 25 May 2010 11:02:49 +0000 (UTC) Received: by fxm4 with SMTP id 4so5657fxm.40 for ; Tue, 25 May 2010 04:02:49 -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:disposition-notification-to:mime-version:content-type :message-id; bh=eqPMLr0zabz9wzcPvP7ZDqGpbPjQdMeJMTkqhE98xog=; b=Y2z/daZm2uKKxBu+SP2eL7Gb77dK/MMV5pcie5vJlzCn0cw0uhR2pzk8LzB/JoPCSL ytuELaj3z/i0YMyWmrLoec1PS+2XzNuqjccarPc1lS20md3gbJrUk1EEjtU9NbrhNSWQ a1hlQnCZ7W5nEzA6ygPhhAVzQBwL4CUC7KTU4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:disposition-notification-to :mime-version:content-type:message-id; b=CNFFK7xnRtplwl9Jf52Og0se+dinUqE6E53T+MREYLI+EpsW6zBDcpZBZ7htLa1A9G 7EuBjAyHgtYCj1tOCtsOYoquaSa68CKgvUu6rubz7fUAt5WOe/fVQkrzZCcYJs0ysL4s dV3gQVGVQeDWVBu4+hp/3kZns2SVIK0FRd0IQ= Received: by 10.223.33.218 with SMTP id i26mr5961176fad.58.1274785369361; Tue, 25 May 2010 04:02:49 -0700 (PDT) Received: from lebrodyl.localnet (bdm121.neoplus.adsl.tpnet.pl [83.27.254.121]) by mx.google.com with ESMTPS id r25sm24281227fai.11.2010.05.25.04.02.48 (version=SSLv3 cipher=RC4-MD5); Tue, 25 May 2010 04:02:48 -0700 (PDT) From: Maciej Mrozowski To: gentoo-dev@lists.gentoo.org Subject: [gentoo-dev] [Survey || RFC] autotools-utils.eclass Date: Tue, 25 May 2010 13:02:55 +0200 User-Agent: KMail/1.13.3 (Linux/2.6.32-gentoo-r7; KDE/4.4.3; x86_64; ; ) 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=_g56+LCUiHxzgZ+h" Message-Id: <201005251302.56615.reavertm@gmail.com> X-Archives-Salt: dee8a49b-d800-445b-b7e8-c2a9b7e50534 X-Archives-Hash: ad3a32daee7fcd854b305c213a95bf22 --Boundary-00=_g56+LCUiHxzgZ+h Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Is anyone interested in cmake-utils like autotools/base wrapper? Features: - base.eclass autopatcher (including user patches) - myeconfargs - econf arguments as Bash array (usage like mycmakeargs in cmake-utils) - out of source build (enabled by default) with overridable build dir location - static archives handling (enable/disable static based on static-libs in IUSE) - libtool archives removal (depending on static-libs USE flag) - enable/disable debug handling (debug in IUSE) - cmake-utils resemblance (DOCS, HTML_DOCS variables) - ??? - Profit! ;) Example usage in attached clucene-0.9.21b-r1. Also a patch for base.eclass to make it's econf accept arguments + some random function documentation fix. -- regards MM --Boundary-00=_g56+LCUiHxzgZ+h Content-Type: text/x-patch; charset="UTF-8"; name="base.eclass.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="base.eclass.diff" Index: base.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/base.eclass,v retrieving revision 1.50 diff -u -B -r1.50 base.eclass --- base.eclass 12 Apr 2010 15:33:03 -0000 1.50 +++ base.eclass 25 May 2010 10:46:31 -0000 @@ -65,7 +65,7 @@ # @FUNCTION: base_src_prepare # @DESCRIPTION: # The base src_prepare function, which is exported -# EAPI is greater or equal to 2. +# EAPI is greater or equal to 2. Here the PATCHES array is evaluated. base_src_prepare() { debug-print-function $FUNCNAME "$@" debug-print "$FUNCNAME: PATCHES=$PATCHES" @@ -116,13 +116,12 @@ # @FUNCTION: base_src_configure # @DESCRIPTION: # The base src_configure function, which is exported when -# EAPI is greater or equal to 2. Runs basic econf. Here the PATCHES array is -# evaluated. +# EAPI is greater or equal to 2. Runs basic econf. base_src_configure() { debug-print-function $FUNCNAME "$@" # there is no pushd ${S} so we can override its place where to run - [[ -x ${ECONF_SOURCE:-.}/configure ]] && econf + [[ -x ${ECONF_SOURCE:-.}/configure ]] && econf $@ } # @FUNCTION: base_src_compile --Boundary-00=_g56+LCUiHxzgZ+h 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: # reavertm@gentoo.org # @DESCRIPTION: # autotools.eclass and base.eclass wrapper providing following features: # - autopatcher (including user patches) # - myeconfargs - econf arguments as Bash array # - out of source build (enabled by default) with overridable build dir location # - static archives handling (static-libs in IUSE) # - libtool archives removal (depending on static-libs USE flag) # - enable/disable debug handling (debug in IUSE) # - cmake-utils resemblance (DOCS, HTML_DOCS variables) # Keep variable names synced with cmake-utils! 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_IN_SOURCE_BUILD # @DESCRIPTION: # Set to enable in-source build. # @FUNCTION: _check_build_dir # @DESCRIPTION: # Determine using IN or OUT source build _check_build_dir() { # @ECLASS-VARIABLE: ECONF_SOURCE # @DESCRIPTION: # Sets the directory where we are working with autotools. # By default it uses ${S}. : ${ECONF_SOURCE:=${S}} # @ECLASS-VARIABLE: AUTOTOOLS_BUILD_DIR # @DESCRIPTION: # Specify the build directory where all autotools generated # files should be located. # For installing binary doins "${AUTOTOOLS_BUILD_DIR}/somefile" if [[ -n ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then # we build in source dir 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, which is exported EAPI is greater or equal to 2. 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, which is exported when EAPI is greater or equal # to 2. Runs basic econf. Here the PATCHES array is evaluated. autotools-utils_src_configure() { debug-print-function $FUNCNAME "$@" # @ECLASS-VARIABLE: myeconfargs # @DESCRIPTION: # econf arguments as Bash array, enable shared libs by default local econfargs=( --enable-shared ${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+=($(use_enable static-libs static)) else econfargs+=(--disable-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, calls src_configure with EAPI older # than 2. 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 make install, installs # documents and html documents from DOCS and HTML_DOCS arrays # and removes libtool files. 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 ! use static-libs && has static-libs ${IUSE//+}; then find "${D}" -type f -name '*.la' -exec rm -f {} + \ || die 'libtool archive removal failed' fi # Manual document installation # @ECLASS-VARIABLE: DOCS # @DESCRIPTION: # Documents passed to dodoc command. [[ -n "${DOCS}" ]] && { dodoc ${DOCS} || die 'dodoc failed' ; } # @ECLASS-VARIABLE: HTML_DOCS # @DESCRIPTION: # Documents passed to dohtml command. [[ -n "${HTML_DOCS}" ]] && { dohtml -r ${HTML_DOCS} || die 'dohtml failed' ; } } # @FUNCTION: autotools-utils_src_test # @DESCRIPTION: # The autotools src_test function. Runs emake check in source directory. autotools-utils_src_test() { debug-print-function ${FUNCNAME} "$@" _check_build_dir pushd "${AUTOTOOLS_BUILD_DIR}" &> /dev/null # Standard implementation of src_test if emake -j1 check -n &> /dev/null; then einfo ">>> Test phase [check]: ${CATEGORY}/${PF}" if ! emake -j1 check; then die 'Make check failed. See above for details.' fi elif emake -j1 test -n &> /dev/null; then einfo ">>> Test phase [test]: ${CATEGORY}/${PF}" if ! emake -j1 test; then die 'Make test failed. See above for details.' fi else einfo ">>> Test phase [none]: ${CATEGORY}/${PF}" fi popd &> /dev/null } --Boundary-00=_g56+LCUiHxzgZ+h Content-Type: text/plain; charset="UTF-8"; name="clucene-0.9.21b-r1.ebuild" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="clucene-0.9.21b-r1.ebuild" # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/dev-cpp/clucene/clucene-0.9.21b-r1.ebuild,v 1.1 2010/05/25 06:41:03 reavertm Exp $ EAPI="2" inherit autotools-utils MY_P=${PN}-core-${PV} DESCRIPTION="High-performance, full-featured text search engine based off of lucene in C++" HOMEPAGE="http://clucene.sourceforge.net/" SRC_URI="mirror://sourceforge/clucene/${MY_P}.tar.bz2" LICENSE="|| ( Apache-2.0 LGPL-2.1 )" SLOT="1" KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos" IUSE="debug doc static-libs threads" DEPEND="doc? ( >=app-doc/doxygen-1.4.2 )" RDEPEND="" PATCHES=( "${FILESDIR}"/${P}-gcc44.patch #254254 ) S="${WORKDIR}/${MY_P}" src_configure() { myeconfargs=( $(use_enable debug cnddebug) $(use_enable threads multithreading) ) autotools-utils_src_configure } src_compile() { autotools-utils_src_compile use doc && autotools-utils_src_compile doxygen } src_install() { autotools-utils_src_install use doc && dohtml "${S}"/doc/html/* } --Boundary-00=_g56+LCUiHxzgZ+h--