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 1O0ipB-0005AT-Gj for garchives@archives.gentoo.org; Sat, 10 Apr 2010 22:06:45 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 26E0BE097A; Sat, 10 Apr 2010 22:06:41 +0000 (UTC) Received: from earth.farbfinsternis.net (earth.farbfinsternis.net [87.118.98.117]) by pigeon.gentoo.org (Postfix) with ESMTP id 218C7E094B for ; Sat, 10 Apr 2010 22:06:27 +0000 (UTC) Received: from [192.168.178.23] (p4FD507AD.dip0.t-ipconnect.de [79.213.7.173]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by earth.farbfinsternis.net (Postfix) with ESMTPSA id 4A12E7C003D for ; Sun, 11 Apr 2010 00:05:37 +0200 (CEST) Message-ID: <4BC0F659.7000506@gentoo.org> Date: Sun, 11 Apr 2010 00:06:17 +0200 From: Matti Bickel User-Agent: Thunderbird 2.0.0.24 (X11/20100317) 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 Subject: [gentoo-dev] RFC: eblits.eclass X-Enigmail-Version: 0.95.7 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigC9B57B734F742B3B7DF4ECC6" X-Archives-Salt: e6f84025-8323-482c-92c1-b014dce26811 X-Archives-Hash: 4abf3391d60df1ac64fdc5af69ccc947 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC9B57B734F742B3B7DF4ECC6 Content-Type: multipart/mixed; boundary="------------080103030306000207060406" This is a multi-part message in MIME format. --------------080103030306000207060406 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi folks, this is my first eclass proposal, so rip it apart gently ;) Disclaimer: the work proposed is NOT my own, but rather contributed by vapier (see [1] or sys-libs/glibc) and kumba (see [2] or sys-kernel/mips-sources). I propose to add eblits.eclass[2] (attached to this message) with the purpose and author comments from [1]. A quick grep showed that glibc and mips-sources currently use functions defined in global scope in each ebuild to do the job. The referenced overlays also use eblits to install php-5.3 and this is currently blocking php-5.3 from entering the tree. sys-kernel/mips-sources also has comment: # They'll likely be superseded someday by better ideas, possibly elibs. That's why I titled this email "RFC" - I realize this eclass might be obsolete in a not to distant future and possibly cause funny behaviour in ebuilds that I'm not aware of. So please enlighten me of any problems you can think of that adding eblits.eclass as proposed above would cause. I'd be more than happy if we can get an update on elibs progress, too. As the need for such an eclass is very real (we really, really want php-5.3 in the tree!), I want to limit discussion to one week, ending April 18th. If there are no objections, I'll add the eclass after that da= te. TIA, Matti [1] http://hg.hoffie.info/gentoo-php-rewrite/file/66effb7b56a0/eclass/eblits.= eclass [2] http://github.com/GiDiS/gentoo-php-rewrite/blob/master/eclass/eblits.ecla= ss --------------080103030306000207060406 Content-Type: text/plain; name="eblits.eclass" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="eblits.eclass" # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # eblit-core # Usage: [version] [eval] # Main eblit engine eblit-core() { [[ -z $FILESDIR ]] && FILESDIR=3D"$(dirname $EBUILD)/files" local e v func=3D$1 ver=3D$2 eval_=3D$3 for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do e=3D"${FILESDIR}/eblits/${func}${v}.eblit" if [[ -e ${e} ]] ; then . "${e}" [[ ${eval_} =3D=3D 1 ]] && eval "${func}() { eblit-run ${func} ${ver} = ; }" return 0 fi done return 1 } # eblit-include # Usage: [--skip] [version] # Includes an "eblit" -- a chunk of common code among ebuilds in a given # package so that its functions can be sourced and utilized within the # ebuild. eblit-include() { local skipable=3Dfalse r=3D0 [[ $1 =3D=3D "--skip" ]] && skipable=3Dtrue && shift [[ $1 =3D=3D pkg_* ]] && skipable=3Dtrue [[ -z $1 ]] && die "Usage: eblit-include [version]" eblit-core $1 $2 r=3D"$?" ${skipable} && return 0 [[ "$r" -gt "0" ]] && die "Could not locate requested eblit '$1' in ${FI= LESDIR}/eblits/" } # eblit-run-maybe # Usage: # Runs a function if it is defined in an eblit eblit-run-maybe() { [[ $(type -t "$@") =3D=3D "function" ]] && "$@" } # eblit-run # Usage: [version] # Runs a function defined in an eblit eblit-run() { eblit-include --skip common "${*:2}" eblit-include "$@" eblit-run-maybe eblit-$1-pre eblit-${PN}-$1 eblit-run-maybe eblit-$1-post } # eblit-pkg # Usage: [version] # Includes the given functions AND evals them so they're included in the = binpkgs eblit-pkg() { [[ -z $1 ]] && die "Usage: eblit-pkg [version]" eblit-core $1 $2 1 } --------------080103030306000207060406-- --------------enigC9B57B734F742B3B7DF4ECC6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkvA9l0ACgkQfNMcoUhJ7GydggCfZxofDUXm5UkID1IcC4CbkJ8e WB8An3PV1xfa3hnwiTA+jg4l78hiCfQ/ =5dH3 -----END PGP SIGNATURE----- --------------enigC9B57B734F742B3B7DF4ECC6--