public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: hasufell <hasufell@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: Thomas Sachau <tommy@gentoo.org>,
	 Samuli Suominen <ssuominen@gentoo.org>,
	mgorny@gentoo.org
Subject: Re: [gentoo-dev] New eclass: autotools-multilib-minimal
Date: Thu, 28 Feb 2013 02:06:25 +0100	[thread overview]
Message-ID: <512EAD91.7030405@gentoo.org> (raw)
In-Reply-To: <512A9691.5090503@gentoo.org>

[-- Attachment #1: Type: text/plain, Size: 1418 bytes --]

On 02/24/2013 11:39 PM, Samuli Suominen wrote:
> On 24/02/13 02:34, hasufell wrote:
>> Some people seem to feel uncomfortable with autotools-multilib, because
>> it depends on autotools-utils.
>>
>> Instead of arguing whether it makes sense or not I'd propose a similar
>> autotools related eclass.
>>
>> I also attach an example conversion of media-libs/libexif (the
>> maintainer wants to keep the changes minimal).
>> Effectively I am only (almost) changing the function names and not the
>> ebuild code.
> 
> looks good, seems exactly what I wanted
> 
>> Feel free to propose a different eclass name.
> 
> whatever it will be, please make it shorter, like 'multiabi' maybe
> 

I cleaned up some things.

1) eclass renamed to multilib-minimal.eclass
prepabisources() renamed to multilib_copy_sources()

2) if someone wants out-of-source builds he gotta handle that manually,
as in: not calling multilib_copy_sources and making sure that stuff like
ECONF_SOURCE is set correctly
(${BUILD_DIR} will be created unconditionally in src_configure anyway)

3) all autotools related code removed

4) Introduced a DISABLE_MULTILIB variable for use of portage-multilib,
which will disable all multilib related stuff. I am not sure if that's
what they want, but I heard something like that.
Tommy should comment on this.

In case this eclass will be deprecated at some point, conversion back to
normal will be trivial anyway.

[-- Attachment #2: multilib-minimal.eclass --]
[-- Type: text/plain, Size: 3408 bytes --]

# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

# @ECLASS: multilib-minimal.eclass
# @MAINTAINER:
# Julian Ospald <hasufell@gentoo.org>
# @BLURB: wrapper for multilib builds providing convenient multilib_src_* functions
# @DESCRIPTION:
#
# src_configure, src_compile, src_test and src_install are exported
# use multilib_src_* instead of src_* which runs this phase for
# all enabled ABIs
# multilib-minimal should _always_ go last in inherit order!!
#
# If you are using in-source builds, then you must run multilib_copy_sources
# at the end of src_prepare!!
#
# If you need generic install rules, use multilib_src_install_all function.

# @ECLASS-VARIABLE: DISABLE_MULTILIB
# @DESCRIPTION:
# set to ON to disable multilib entirely
# this is not meant to be set in the ebuild
: ${DISABLE_MULTILIB:=OFF}


# EAPI=5 is required for meaningful MULTILIB_USEDEP.
case ${EAPI:-0} in
	5) ;;
	*) die "EAPI=${EAPI} is not supported" ;;
esac

_multilib_inherit=
if [[ ${DISABLE_MULTILIB} == "OFF" ]] ; then
	_multilib_inherit="multilib-build"
fi

inherit ${_multilib_inherit}

EXPORT_FUNCTIONS src_configure src_compile src_test src_install

multilib_copy_sources() {
	_abi_copy_sources() {
		einfo "${ABI}: copying to ${BUILD_DIR}"
		cp -pR "${S}" "${BUILD_DIR}" || die "failed to copy sources"
	}

	if [[ ${DISABLE_MULTILIB} == "OFF" ]] ; then
		einfo "Will copy sources to abi-specific dirs"
		multilib_foreach_abi _abi_copy_sources
	fi
}

multilib-minimal_src_configure() {
	_common_src_configure() {
		if declare -f multilib_src_configure >/dev/null ; then
			multilib_src_configure
		else
			default_src_configure
		fi
	}

	_abi_src_configure() {
		einfo "${ABI}: Configuring"

		mkdir -p "${BUILD_DIR}" || die
		pushd "${BUILD_DIR}" >/dev/null || die
		_common_src_configure
		popd >/dev/null || die
	}

	if [[ ${DISABLE_MULTILIB} == "OFF" ]] ; then
		multilib_foreach_abi _abi_src_configure
	else
		_common_src_configure
	fi	
}

multilib-minimal_src_compile() {
	_common_src_compile() {
		if declare -f multilib_src_compile >/dev/null ; then
			multilib_src_compile
		else
			default_src_compile
		fi
	}

	_abi_src_compile() {
		einfo "${ABI}: Compiling"

		pushd "${BUILD_DIR}" >/dev/null || die
		_common_src_compile
		popd >/dev/null || die
	}

	if [[ ${DISABLE_MULTILIB} == "OFF" ]] ; then
		multilib_foreach_abi _abi_src_compile
	else
		_common_src_compile
	fi
}

multilib-minimal_src_test() {
	_common_src_test() {
		if declare -f multilib_src_test >/dev/null ; then
			multilib_src_test
		else
			default_src_test
		fi
	}

	_abi_src_test() {
		einfo "${ABI}: Testing"

		pushd "${BUILD_DIR}" >/dev/null || die
		_common_src_test
		popd >/dev/null || die
	}

	if [[ ${DISABLE_MULTILIB} == "OFF" ]] ; then
		multilib_foreach_abi _abi_src_test
	else
		_common_src_test
	fi
}

multilib-minimal_src_install() {
	_common_src_install() {
		if declare -f multilib_src_install >/dev/null ; then
			multilib_src_install
		else
			default_src_install	
		fi
	}

	_abi_src_install() {
		einfo "${ABI}: Installing"

		pushd "${BUILD_DIR}" >/dev/null || die
		_common_src_install
		multilib_check_headers
		popd >/dev/null || die
	}

	if [[ ${DISABLE_MULTILIB} == "OFF" ]] ; then
		multilib_foreach_abi _abi_src_install
	else
		_common_src_install
	fi

	if declare -f multilib_src_install_all >/dev/null ; then
		multilib_src_install_all
	fi
}

[-- Attachment #3: libexif-0.6.21.ebuild.diff --]
[-- Type: text/plain, Size: 1559 bytes --]

--- media-libs/libexif/libexif-0.6.21.ebuild
+++ media-libs/libexif/libexif-0.6.21-r1.ebuild
@@ -2,8 +2,8 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Header: /var/cvsroot/gentoo-x86/media-libs/libexif/libexif-0.6.21.ebuild,v 1.8 2012/11/07 19:03:58 grobian Exp $
 
-EAPI=4
-inherit eutils libtool
+EAPI=5
+inherit eutils libtool multilib-minimal
 
 DESCRIPTION="Library for parsing, editing, and saving EXIF data"
 HOMEPAGE="http://libexif.sourceforge.net/"
@@ -11,7 +11,7 @@
 
 LICENSE="LGPL-2.1"
 SLOT="0"
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
 IUSE="doc nls static-libs"
 
 RDEPEND="nls? ( virtual/libintl )"
@@ -24,9 +24,10 @@
 	epatch "${FILESDIR}"/${PN}-0.6.13-pkgconfig.patch
 	sed -i -e '/FLAGS=/s:-g::' configure || die #390249
 	elibtoolize # For *-bsd
+	multilib_copy_sources
 }
 
-src_configure() {
+multilib_src_configure() {
 	econf \
 		$(use_enable static-libs static) \
 		$(use_enable nls) \
@@ -34,8 +35,11 @@
 		--with-doc-dir="${EPREFIX}"/usr/share/doc/${PF}
 }
 
-src_install() {
+multilib_src_install() {
 	emake DESTDIR="${D}" install
+}
+
+multilib_src_install_all() {
 	prune_libtool_files
 	rm -f "${ED}"/usr/share/doc/${PF}/{ABOUT-NLS,COPYING}
 }

  reply	other threads:[~2013-02-28  1:06 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-24  0:34 [gentoo-dev] New eclass: autotools-multilib-minimal hasufell
2013-02-24  4:22 ` hasufell
2013-02-24 10:06   ` Michał Górny
2013-02-24 10:11     ` Diego Elio Pettenò
2013-02-24 14:17       ` hasufell
2013-02-24 14:33         ` Pacho Ramos
2013-02-27 13:01         ` Samuli Suominen
2013-02-27 20:13           ` Michał Górny
2013-02-27 20:15           ` Pacho Ramos
2013-02-24 14:57   ` Michał Górny
2013-02-24 15:12     ` hasufell
2013-02-24 15:12     ` Pacho Ramos
2013-02-24 15:53       ` Michał Górny
2013-02-24 16:21         ` Pacho Ramos
2013-02-24 16:28         ` Alexis Ballier
2013-02-24 16:58         ` Samuli Suominen
2013-02-24 18:56           ` Michał Górny
2013-02-24 19:40             ` hasufell
2013-02-24 18:05         ` [gentoo-dev] " Jonathan Callen
2013-02-24 18:18           ` Michał Górny
2013-02-24 16:22 ` [gentoo-dev] " Alexis Ballier
2013-02-24 16:42   ` hasufell
2013-02-24 18:46     ` Alexis Ballier
2013-02-24 22:39 ` Samuli Suominen
2013-02-28  1:06   ` hasufell [this message]
2013-02-28  8:30     ` Michał Górny
2013-02-28 15:16       ` hasufell
2013-03-02  2:50       ` hasufell
2013-03-02 15:07         ` Michał Górny
2013-03-02 15:13           ` hasufell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=512EAD91.7030405@gentoo.org \
    --to=hasufell@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=mgorny@gentoo.org \
    --cc=ssuominen@gentoo.org \
    --cc=tommy@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox