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 1Pclax-0000j3-7B for garchives@archives.gentoo.org; Tue, 11 Jan 2011 21:17:36 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B34FAE068E for ; Tue, 11 Jan 2011 21:17:34 +0000 (UTC) Received: from smtprelay04.ispgateway.de (smtprelay04.ispgateway.de [80.67.18.16]) by pigeon.gentoo.org (Postfix) with ESMTP id 1DB69E07E3; Tue, 11 Jan 2011 20:10:49 +0000 (UTC) Received: from [93.210.54.79] (helo=bullet.local) by smtprelay04.ispgateway.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1PckYJ-00037G-Vy; Tue, 11 Jan 2011 21:10:48 +0100 Received: from localhost (unknown [127.0.0.1]) by bullet.local (Postfix) with ESMTP id C9097185A; Tue, 11 Jan 2011 20:10:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at bullet.veller.net Received: from bullet.local ([127.0.0.1]) by localhost (bullet.veller.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id wAXMC1ElQYBx; Tue, 11 Jan 2011 21:10:13 +0100 (CET) Received: by bullet.local (Postfix, from userid 1000) id B6CE78D2E; Tue, 11 Jan 2011 21:10:13 +0100 (CET) Date: Tue, 11 Jan 2011 21:10:13 +0100 From: Torsten Veller To: gentoo-dev@lists.gentoo.org, gentoo-perl@lists.gentoo.org Subject: [gentoo-dev] Re: Ebuild- and CPAN-versions compatibility Message-ID: <20110111201013.GA23791@veller.net> Mail-Followup-To: gentoo-dev@lists.gentoo.org, gentoo-perl@lists.gentoo.org References: <20101229085631.GA6757@veller.net> 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="45Z9DzgjV8m4Oswq" Content-Disposition: inline In-Reply-To: <20101229085631.GA6757@veller.net> X-Face: ===_______=8)_=8)_______A_very_very_nice_face_______=8)_=8)_______=== Jabber-ID: tove@jabber.ccc.de X-PGP-Fingerprint: 0416 3C11 8D79 65B9 AAD0 2065 BBC7 14D1 9C67 CD96 User-Agent: Mutt/1.5.21 (2010-09-15) X-Df-Sender: 1067115 X-Archives-Salt: 8abf9ae6-c5a5-4460-bebb-8a9796f3cd42 X-Archives-Hash: 3e9ef21a44cfbae536abc9277ce56495 --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline * Torsten Veller : > CPAN and ebuild versions are ordered in different ways. The idea here is > to change the ebuild versions to be predictable and CPAN compatible. I've committed dev-perl/Gentoo-PerlMod-Version which contains a perl module and a scipt to convert the versions. gentoo-perlmod-version.pl maps given perlish versions to ebuild versions (perl => ebuild): $ gentoo-perlmod-version.pl 0.9 0.98 0.987 v0.{900,980,987} 0.{900,980,987}.0 0.9 => 0.900 0.98 => 0.980 0.987 => 0.987 v0.900 => 0.900 v0.980 => 0.980 v0.987 => 0.987 0.900.0 => 0.900 0.980.0 => 0.980 0.987.0 => 0.987 gentoo-perlmod-version.pl 0.9 0.08 0.007 0.0006 0.00005 0.000004 0.0000003 0.9 => 0.900 0.08 => 0.80 0.007 => 0.7 0.0006 => 0.0.600 0.00005 => 0.0.50 0.000004 => 0.0.4 0.0000003 => 0.0.0.300 Using version.pm the ebuild and perl versions can be compared: The ebuild version just needs to be prefixed with a 'v'. $ perl -wE 'while(@ARGV){say version->parse(shift) <=> version->parse(shift)}' v1.1 1.001 v1.190 1.19 The given perl distribution version will be recorded as MODULE_VERSION in the ebuild. (For ease of use s/^MODULE_VERSION=(['"]?)(.+)\1/$2/ should return the version if not PV.) Diff of the perl-module.eclass is attached. The change of versioning will result in ~22 downgrades: $ find dev-perl -name "*.ebuild" | egrep '\.[1-9][0-9]{3}' dev-perl/POE-Component-IKC/POE-Component-IKC-0.2200.ebuild dev-perl/Class-Accessor-Grouped/Class-Accessor-Grouped-0.10000.ebuild dev-perl/IO-Moose/IO-Moose-0.1004.ebuild dev-perl/DBD-mysql/DBD-mysql-2.9007.ebuild dev-perl/text-autoformat/text-autoformat-1.669002.ebuild dev-perl/text-autoformat/text-autoformat-1.669001.ebuild dev-perl/CPAN-Mini/CPAN-Mini-1.100630.ebuild dev-perl/Tie-Cache-LRU/Tie-Cache-LRU-20081023.2116.ebuild dev-perl/DateTime-Format-Strptime/DateTime-Format-Strptime-1.5000.ebuild dev-perl/DateTime-Format-Strptime/DateTime-Format-Strptime-1.4000.ebuild dev-perl/Net-Twitter/Net-Twitter-3.14001.ebuild dev-perl/Net-Twitter/Net-Twitter-3.13009.ebuild dev-perl/XML-RAI/XML-RAI-1.3031.ebuild dev-perl/XML-RAI/XML-RAI-1.3022.ebuild dev-perl/Algorithm-Diff/Algorithm-Diff-1.1902.ebuild dev-perl/Throwable/Throwable-0.102080.ebuild dev-perl/Email-Sender/Email-Sender-0.102370.ebuild dev-perl/Email-Sender/Email-Sender-0.101760.ebuild dev-perl/Convert-BER/Convert-BER-1.3200.ebuild dev-perl/Convert-BER/Convert-BER-1.3101.ebuild dev-perl/Scalar-Properties/Scalar-Properties-1.100860.ebuild dev-perl/DateTime-Format-Mail/DateTime-Format-Mail-0.3001.ebuild dev-perl/File-chdir/File-chdir-0.1002.ebuild dev-perl/File-chdir/File-chdir-0.1003.ebuild dev-perl/Net-Netmask/Net-Netmask-1.9015.ebuild dev-perl/PlRPC/PlRPC-0.2020-r1.ebuild dev-perl/SQL-Translator/SQL-Translator-0.11006.ebuild dev-perl/SQL-Translator/SQL-Translator-0.11007.ebuild dev-perl/Perl6-Junction/Perl6-Junction-1.40000.ebuild dev-perl/MP3-Tag/MP3-Tag-0.9709.ebuild --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="perl-module.patch" - Die on unsupported EAPI - Die if PERL_EXPORT_PHASE_FUNCTIONS not yes or no - Add support for MY_PN, MY_PV, MODULE_VERSION - Allow use of myconf, mymake, myinst as arrays - Use Module::Build even if Module::Build is not prefered but no Makefile.PL is found --- a/eclass/perl-module.eclass +++ b/eclass/perl-module.eclass @@ -34,7 +34,7 @@ esac ;; *) - DEPEND="EAPI-UNSUPPORTED" + die "EAPI=${EAPI} is not supported by perl-module.eclass" ;; esac @@ -46,7 +46,7 @@ debug-print "PERL_EXPORT_PHASE_FUNCTIONS=no" ;; *) - DEPEND+=" PERL_EXPORT_PHASE_FUNCTIONS-UNSUPPORTED" + die "PERL_EXPORT_PHASE_FUNCTIONS=${PERL_EXPORT_PHASE_FUNCTIONS} is not supported by perl-module.eclass" ;; esac @@ -54,6 +54,10 @@ LICENSE="${LICENSE:-|| ( Artistic GPL-1 GPL-2 GPL-3 )}" +if [[ -n ${MY_PN} || -n ${MY_PV} || -n ${MODULE_VERSION} ]] ; then + : ${MY_P:=${MY_PN:-${PN}}-${MY_PV:-${MODULE_VERSION:-${PV}}}} + S=${MY_S:-${WORKDIR}/${MY_P}} +fi [[ -z "${SRC_URI}" && -z "${MODULE_A}" ]] && MODULE_A="${MY_P:-${P}}.tar.gz" [[ -z "${SRC_URI}" && -n "${MODULE_AUTHOR}" ]] && \ SRC_URI="mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MODULE_SECTION:+${MODULE_SECTION}/}${MODULE_A}" @@ -97,21 +101,31 @@ # Disable ExtUtils::AutoInstall from prompting export PERL_EXTUTILS_AUTOINSTALL="--skipdeps" - if [[ ${PREFER_BUILDPL} == yes && -f Build.PL ]] ; then + if [[ $(declare -p myconf 2>&-) != "declare -a myconf="* ]]; then + local myconf_local=(${myconf}) + else + local myconf_local=("${myconf[@]}") + fi + + if [[ ( ${PREFER_BUILDPL} == yes || ! -f Makefile.PL ) && -f Build.PL ]] ; then einfo "Using Module::Build" if [[ ${DEPEND} != *virtual/perl-Module-Build* && ${PN} != Module-Build ]] ; then eqawarn "QA Notice: The ebuild uses Module::Build but doesn't depend on it." eqawarn " Add virtual/perl-Module-Build to DEPEND!" + if [[ -n ${PERLQAFATAL} ]]; then + eerror "Bailing out due to PERLQAFATAL=1"; + die; + fi fi set -- \ --installdirs=vendor \ --libdoc= \ --destdir="${D}" \ --create_packlist=0 \ - ${myconf} + "${myconf_local[@]}" einfo "perl Build.PL" "$@" perl Build.PL "$@" <<< "${pm_echovar}" \ - || die "Unable to build! (are you using USE=\"build\"?)" + || die "Unable to build!" elif [[ -f Makefile.PL ]] ; then einfo "Using ExtUtils::MakeMaker" set -- \ @@ -119,10 +133,10 @@ INSTALLDIRS=vendor \ INSTALLMAN3DIR='none' \ DESTDIR="${D}" \ - ${myconf} + "${myconf_local[@]}" einfo "perl Makefile.PL" "$@" perl Makefile.PL "$@" <<< "${pm_echovar}" \ - || die "Unable to build! (are you using USE=\"build\"?)" + || die "Unable to build!" fi if [[ ! -f Build.PL && ! -f Makefile.PL ]] ; then einfo "No Make or Build file detected..." @@ -136,14 +150,22 @@ has src_configure ${PERL_EXPF} || perl-module_src_prep + if [[ $(declare -p mymake 2>&-) != "declare -a mymake="* ]]; then + local mymake_local=(${mymake}) + else + local mymake_local=("${mymake[@]}") + fi + if [[ -f Build ]] ; then ./Build build \ - || die "compilation failed" + || die "Compilation failed" elif [[ -f Makefile ]] ; then - emake \ + set -- \ OTHERLDFLAGS="${LDFLAGS}" \ - ${mymake} \ - || die "compilation failed" + "${mymake_local[@]}" + einfo "emake" "$@" + emake "$@" \ + || die "Compilation failed" # OPTIMIZE="${CFLAGS}" \ fi } @@ -200,12 +222,18 @@ esac fi + if [[ $(declare -p myinst 2>&-) != "declare -a myinst="* ]]; then + local myinst_local=(${myinst}) + else + local myinst_local=("${myinst[@]}") + fi + if [[ -f Build ]] ; then ./Build ${mytargets} \ || die "./Build ${mytargets} failed" elif [[ -f Makefile ]] ; then - emake ${myinst} ${mytargets} \ - || die "emake ${myinst} ${mytargets} failed" + emake "${myinst_local[@]}" ${mytargets} \ + || die "emake ${myinst_local[@]} ${mytargets} failed" fi perl_delete_module_manpages --45Z9DzgjV8m4Oswq--