From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id AD38B138A1F for ; Sat, 19 Apr 2014 19:57:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F33B0E0B33; Sat, 19 Apr 2014 19:57:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D3E88E0B23 for ; Sat, 19 Apr 2014 19:57:12 +0000 (UTC) Received: from [192.168.1.5] (c-68-80-35-238.hsd1.pa.comcast.net [68.80.35.238]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jcallen) by smtp.gentoo.org (Postfix) with ESMTPSA id 7524633FD30; Sat, 19 Apr 2014 19:57:11 +0000 (UTC) Message-ID: <5352D512.5050300@gentoo.org> Date: Sat, 19 Apr 2014 15:57:06 -0400 From: Jonathan Callen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 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 To: gentoo-dev@lists.gentoo.org CC: multilib@gentoo.org, =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= Subject: [gentoo-dev] Re: [PATCH multilib-build.eclass] Add multilib_native_use* functions to make ebuild writing easier. References: <1397904806-3079-1-git-send-email-mgorny@gentoo.org> In-Reply-To: <1397904806-3079-1-git-send-email-mgorny@gentoo.org> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="KLvvR7hubhrlD1JdgjGD08hDSPd5XIm1l" X-Archives-Salt: e5a1ae23-628b-478a-a394-9fd65e78608c X-Archives-Hash: 3be8a41db0eb2287e61bc93de2ab8b1f This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KLvvR7hubhrlD1JdgjGD08hDSPd5XIm1l Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 04/19/2014 06:53 AM, Micha=C5=82 G=C3=B3rny wrote: > People are either inlining this or creating local functions for this > purpose, so it'd be better to have them in the eclass. >=20 > RFC: what about '!use'? Should we invert the multilib_build_binaries > test as well? > --- > eclass/multilib-build.eclass | 48 ++++++++++++++++++++++++++++++++++++= ++++++++ > 1 file changed, 48 insertions(+) >=20 > diff --git a/eclass/multilib-build.eclass b/eclass/multilib-build.eclas= s > index 77e7573..6adfc76 100644 > --- a/eclass/multilib-build.eclass > +++ b/eclass/multilib-build.eclass > @@ -462,5 +462,53 @@ multilib_build_binaries() { > [[ ${COMPLETE_MULTILIB} =3D=3D yes ]] || multilib_is_native_abi > } > =20 > +# @FUNCTION: multilib_native_use_with > +# @USAGE: [ []] > +# @DESCRIPTION: > +# Output --with configure option alike use_with if USE is enabl= ed > +# and executables are being built (multilib_build_binaries is true). > +# Otherwise, outputs --without configure option. Arguments are the sam= e > +# as for use_with in the EAPI. > +multilib_native_use_with() { > + if multilib_build_binaries; then > + use_with "${@}" > + else > + echo "--without-${2:-${1}}" > + fi > +} > + > +# @FUNCTION: multilib_native_use_enable > +# @USAGE: [ []] > +# @DESCRIPTION: > +# Output --enable configure option alike use_with if USE > +# is enabled and executables are being built (multilib_build_binaries > +# is true). Otherwise, outputs --disable configure option. Arguments a= re > +# the same as for use_enable in the EAPI. > +multilib_native_use_enable() { > + if multilib_build_binaries; then > + use_enable "${@}" > + else > + echo "--disable-${2:-${1}}" > + fi > +} > + > +# @FUNCTION: multilib_native_usex > +# @USAGE: [ [ [ []]]] > +# @DESCRIPTION: > +# Output the concatenation of (or 'yes' if unspecified) > +# and if USE is enabled and executables are being built= > +# (multilib_build_binaries is true). Otherwise, output the concatenati= on > +# of (or 'no' if unspecified) and . Arguments > +# are the same as for usex in the EAPI. > +# > +# Note: in EAPI 4 you need to inherit eutils to use this function. > +multilib_native_usex() { > + if multilib_build_binaries; then > + usex "${@}" > + else > + echo "${3-no}${5}" > + fi > +} > + > _MULTILIB_BUILD=3D1 > fi >=20 These all look good to me (being one of the offenders mentioned above). --=20 Jonathan Callen --KLvvR7hubhrlD1JdgjGD08hDSPd5XIm1l Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCgAGBQJTUtUVAAoJELHSF2kinlg4hHcP/22KH1vnfZTD/jw9nxxuAi7A NsaMUg2idn0TJCll+Ywrd9MYp+Kp6eguMcTZWd//CxNIV9Ge/U3aIgG9itkRFFgR YbiDhOQRqDBmvE7gR6mUVvEnQMTgPzgQP7Q+bNgUwzwBoIk6fUbSB+GURteoLw+A HxOel2zcxFs5XL1bfRh7jOGuLvwWbwU12uwoIfnSjzNuOerBZ+1Lrvh8mGT/mpOd hy7A6y3nJq7o7B935vEs9y1c16l4tOvMpPQmAOEFBBS38hoaqeWCORIW8VxJxY++ Y35caJuo36VCsNrdJxoPP0J08BIVvvIHswzr41i+xlVjbWI1CeZPnWV0/eaafUfE tPbVXC+BeDOtkh1X3ef6GcdkAbn2Mqsm3ug7g4Rf0F6qd2SwYP2aMlOLVHq0cTNv mt/4/lPdGtR6A8R6mxykWp3lgD1qPU22qdqfgxg9uhPd0Ioaf8hpWGFQZQscP1QB SdQcIUkoLHlPwY4cqp7S5jZlJfgUdh+K7oz80MCYrWIiP2jc9uqNBrz18fYqwB7e EJk0tz4SXH9IbACUTTks6e6cteXHnEpm7IdltUIV7HI4mBpo1umLHUWZTrRAfHsl Wqhli4OZhvEk1K8hwbSXGWnvWGUO12T4yiLHBZokK8Fays5QDKZrkmQIEFnURjbX JCO2HYDXOW5mllFUAoYt =0sny -----END PGP SIGNATURE----- --KLvvR7hubhrlD1JdgjGD08hDSPd5XIm1l--