diff options
author | Kent Fredric <kentnl@gentoo.org> | 2020-06-26 20:00:52 +1200 |
---|---|---|
committer | Kent Fredric <kentnl@gentoo.org> | 2020-08-08 09:04:26 +1200 |
commit | 5986e6616f0f43983f003792cb4a6c043ff6d37d (patch) | |
tree | b16aa602c10ebae85661683fa6217ad6a76850db /dev-lang | |
parent | dev-perl/Email-Address-XS: Bump to version 1.40.0 (diff) | |
download | gentoo-5986e6616f0f43983f003792cb4a6c043ff6d37d.tar.gz gentoo-5986e6616f0f43983f003792cb4a6c043ff6d37d.tar.bz2 gentoo-5986e6616f0f43983f003792cb4a6c043ff6d37d.zip |
dev-lang/perl: 5.30.3-r2 rework patching bundle logic
This change reworks the patching logic entirely to avoid the use of a
sequence file, instead, relying on directory sort order and numerically
prefixed filenames.
In addition to this change, work is done on the patchset authoring side
to pre-extract important fields like "bugs" and "description" for the
patches and puts them in easy to read files, in order to more clearly
generate patchlevel_gentoo.h ( seen in Perl -V )
Perl -V now includes more verbose details, including fully qualified bug
URLs.
Additionally, its more straight forward to add records to the patch
bundle within the ebuild, using the new "add_patch" helper, so that even
files applied from ${FILESDIR} can be shown in `perl -V`
Patches are fully re-rolled as git patches against perl v5.30.3
Sourcing from "mirror://gentoo" is now implicit, as this syntax is
discouraged.
Patch for Net::SNMP removed from bundle as it just now introduces
redundant documentation.
Patch for gentoo-libdirs now bundled, and properly rehashed to avoid
failing in various porting tests.
Package-Manager: Portage-2.3.100, Repoman-2.3.22
Signed-off-by: Kent Fredric <kentnl@gentoo.org>
Diffstat (limited to 'dev-lang')
-rw-r--r-- | dev-lang/perl/Manifest | 1 | ||||
-rw-r--r-- | dev-lang/perl/files/perl-5.30.3-gentoo-libdirs.patch | 135 | ||||
-rw-r--r-- | dev-lang/perl/perl-5.30.3-r2.ebuild | 195 |
3 files changed, 131 insertions, 200 deletions
diff --git a/dev-lang/perl/Manifest b/dev-lang/perl/Manifest index 0168a19f9ce9..863119a0eddb 100644 --- a/dev-lang/perl/Manifest +++ b/dev-lang/perl/Manifest @@ -1,4 +1,5 @@ DIST perl-5.30.0-patches-1.tar.xz 17352 BLAKE2B 67eb1c4ce6ada27e05962d06fa9c5675ca1d22623b5fd172ce8ceaa17f2e51d61f9451955f9f6acf6d97ea7d71c72b583be1378ccbf9174c88580baec2049a48 SHA512 4fe1f2de5e72e56890858148d20b772df63dce34cb3977ec47d8ed5323c4843929130f660f1558c282c97e65efa1c6d2fdacf9e2dcc0ef1d487a0b69dbb5bbb4 +DIST perl-5.30.3-patches-1.tar.xz 20292 BLAKE2B 34ca8dbdf08650deaaa59bba634c3a40c6da7d91b282365eec217cc421b17678837b1ae02de5d6b0b632858a0251b796ce28ddbdd7a86aca6697f18a527fcb62 SHA512 ba9aafcaff405c931b61ffc917be8ef71e538fd5277a3bcfafbaffc965b53f9c1811670558a0bc75c538586a30f11aba3ce59bd2214982eaad3b5afa64e67999 DIST perl-5.30.3.tar.xz 12375128 BLAKE2B ff0668c896e46ea35a1b8bd4a7d800c8668d6995185cd8c43fca332da2fa63965bb5276b2d5cf9738c0b7fb735140f6e33f1b4582899017903f86753065f417b SHA512 0ea62cf17532ee99217a218c39aa530472857c7a1982494f3a01693683062b4cdebe383a79f7b64452c713337b554ed5e0fd6eda018ea29e83c3538a13c24f3c DIST perl-5.32.0.tar.xz 12717336 BLAKE2B 4abad9f1ddabaad5f2bbfe8ab6d061aeb8c558e458d4bf1bcf737a8ecc1cf20f7dffaddd0bc867578b457787ec284fa81be3fae1edd7f72d58aeec7b5cd744e5 SHA512 1540247415893bbd94dfeede7b4fba6052688dc0bf27ced817f448246fcdc6e9a6486abc34577dec5b00bf02ed607b2d24ccd4977c3b3c51e8e6edfc0b81c760 DIST perl-cross-1.3.2.tar.gz 108350 BLAKE2B ddb352fdbec66a04de62425f5cae1aaa3bc7251b9d6f4837b66a0bd79c53c60212fad3997dad4c38055774a2769d45b5b83927bf48b0fb00a130fee429eba702 SHA512 d61d25066a8d87c34aeacc5b9bd86fab964b33c4c65e84a89e4077fe1d8011c0bdf810a304631af44fae32edcffd6c99fc17b0c584ea83d1ce5ce492aaedfea5 diff --git a/dev-lang/perl/files/perl-5.30.3-gentoo-libdirs.patch b/dev-lang/perl/files/perl-5.30.3-gentoo-libdirs.patch deleted file mode 100644 index b9e36223a941..000000000000 --- a/dev-lang/perl/files/perl-5.30.3-gentoo-libdirs.patch +++ /dev/null @@ -1,135 +0,0 @@ -From 7572be1afb16621a537e9da02f96cf04cb10b655 Mon Sep 17 00:00:00 2001 -From: Kent Fredric <kentnl@gentoo.org> -Date: Sat, 20 Jun 2020 22:14:22 +1200 -Subject: Add support for -Dgentoolibdirs - -Which just adds the libdirs verbatim in the right place without -having perl molest it in the process. ---- - Configure | 26 ++++++++++++++++++++++++++ - config_h.SH | 5 +++++ - perl.c | 1 + - perl_inc_macro.h | 8 ++++++++ - uconfig.sh | 1 + - 5 files changed, 41 insertions(+) - -diff --git a/Configure b/Configure -index cef8c3c078..77258e8f43 100755 ---- a/Configure -+++ b/Configure -@@ -1181,6 +1181,8 @@ orderlib='' - ranlib='' - d_perl_otherlibdirs='' - otherlibdirs='' -+gentoolibdirs='' -+d_gentoolibdirs='' - package='' - spackage='' - pager='' -@@ -8101,6 +8103,28 @@ esac - set d_perl_otherlibdirs - eval $setvar - -+case "$gentoolibdirs" in -+''|' ') dflt='none' ;; -+*) dflt="$gentoolibdirs" ;; -+esac -+$cat <<EOM -+Enter a colon-seperated list of explicit gentoo paths to stuff in @INC -+unmolested, or enter 'none' for no extra paths -+ -+EOM -+rp='Colon-seperated list of gentoo-specific perl library search dirs?' -+. ./myread -+case "$ans" in -+' '|''|none) gentoolibdirs=' ';; -+*) gentoolibdirs="$ans" ;; -+esac -+case "$gentoolibdirs" in -+' ') val=$undef ;; -+*) val=$define ;; -+esac -+set d_gentoolibdirs -+eval $setvar -+ - : DTrace support - dflt_dtrace='/usr/sbin/dtrace' - $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace' -@@ -24402,6 +24426,7 @@ d_openat='$d_openat' - d_pathconf='$d_pathconf' - d_pause='$d_pause' - d_perl_otherlibdirs='$d_perl_otherlibdirs' -+d_gentoolibdirs='$d_gentoolibdirs' - d_phostname='$d_phostname' - d_pipe2='$d_pipe2' - d_pipe='$d_pipe' -@@ -24937,6 +24962,7 @@ orderlib='$orderlib' - osname='$osname' - osvers='$osvers' - otherlibdirs='$otherlibdirs' -+gentoolibdirs='$gentoolibdirs' - package='$package' - pager='$pager' - passcat='$passcat' -diff --git a/config_h.SH b/config_h.SH -index 08c5923ef8..5563082969 100755 ---- a/config_h.SH -+++ b/config_h.SH -@@ -1308,6 +1308,11 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un - */ - #$d_perl_otherlibdirs PERL_OTHERLIBDIRS "$otherlibdirs" /**/ - -+/* GENTOO_LIBDIRS: -+ * Like PERL_OTHERLIBDIRS, but doesn't stuff ARCH dirs in when not wanted -+ */ -+#$d_gentoolibdirs GENTOO_LIBDIRS "$gentoolibdirs" /**/ -+ - /* PRIVLIB: - * This symbol contains the name of the private library for this package. - * The library is private in the sense that it needn't be in anyone's -diff --git a/perl.c b/perl.c -index 2013a76026..62e67cfaa2 100644 ---- a/perl.c -+++ b/perl.c -@@ -4750,6 +4750,7 @@ S_init_perllib(pTHX) - INCPUSH_ARCHLIB_EXP - INCPUSH_PRIVLIB_EXP - INCPUSH_PERL_OTHERLIBDIRS -+ INCPUSH_GENTOO_LIBDIRS - INCPUSH_PERL5LIB - INCPUSH_APPLLIB_OLD_EXP - INCPUSH_SITELIB_STEM -diff --git a/perl_inc_macro.h b/perl_inc_macro.h -index 5a2f20dfae..4b69b39199 100644 ---- a/perl_inc_macro.h -+++ b/perl_inc_macro.h -@@ -143,6 +143,14 @@ - INCPUSH_ADD_OLD_VERS|INCPUSH_CAN_RELOCATE); - #endif - -+#ifdef GENTOO_LIBDIRS -+# define INCPUSH_GENTOO_LIBDIRS S_incpush_use_sep(aTHX_ STR_WITH_LEN(GENTOO_LIBDIRS), \ -+ INCPUSH_ADD_OLD_VERS|INCPUSH_CAN_RELOCATE); -+#endif -+#ifndef INCPUSH_GENTOO_LIBDIRS -+# define INCPUSH_GENTOO_LIBDIRS -+#endif -+ - #ifdef PERL_OTHERLIBDIRS - # define INCPUSH_PERL_OTHERLIBDIRS_ARCHONLY S_incpush_use_sep(aTHX_ STR_WITH_LEN(PERL_OTHERLIBDIRS), \ - INCPUSH_ADD_OLD_VERS|INCPUSH_ADD_ARCHONLY_SUB_DIRS|INCPUSH_CAN_RELOCATE); -diff --git a/uconfig.sh b/uconfig.sh -index 1d4a0f4a57..fba825acad 100644 ---- a/uconfig.sh -+++ b/uconfig.sh -@@ -185,6 +185,7 @@ d_futimes='undef' - d_gai_strerror='undef' - d_gdbm_ndbm_h_uses_prototypes='undef' - d_gdbmndbm_h_uses_prototypes='undef' -+d_gentoolibdirs='undef' - d_getaddrinfo='undef' - d_getcwd='undef' - d_getespwnam='undef' --- -2.27.0 - diff --git a/dev-lang/perl/perl-5.30.3-r2.ebuild b/dev-lang/perl/perl-5.30.3-r2.ebuild index 18013a31588f..1e58cc17ee54 100644 --- a/dev-lang/perl/perl-5.30.3-r2.ebuild +++ b/dev-lang/perl/perl-5.30.3-r2.ebuild @@ -7,8 +7,8 @@ inherit alternatives flag-o-matic toolchain-funcs multilib multiprocessing PATCH_VER=1 CROSS_VER=1.3.4 -PATCH_BASE="perl-5.30.0-patches-${PATCH_VER}" -PATCH_DEV=dilfridge +PATCH_BASE="perl-5.30.3-patches-${PATCH_VER}" +PATCH_DEV=kentnl DIST_AUTHOR=XSAWYERX @@ -41,7 +41,6 @@ SRC_URI=" mirror://cpan/src/5.0/${MY_P}.tar.xz mirror://cpan/authors/id/${DIST_AUTHOR:0:1}/${DIST_AUTHOR:0:2}/${DIST_AUTHOR}/${MY_P}.tar.xz https://github.com/gentoo-perl/perl-patchset/releases/download/${PATCH_BASE}/${PATCH_BASE}.tar.xz - mirror://gentoo/${PATCH_BASE}.tar.xz https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${PATCH_BASE}.tar.xz https://github.com/arsv/perl-cross/releases/download/${CROSS_VER}/perl-cross-${CROSS_VER}.tar.gz " @@ -252,55 +251,6 @@ src_remove_dual() { done } -src_prepare_update_patchlevel_h() { - # Copied and modified from debian: - # Copyright 2011 Niko Tyni - # This program is free software; you can redistribute it and/or modify - # it under the same terms as Perl itself. - local patchdir="${WORKDIR}/patches" - local prefix - local patchoutput="patchlevel-gentoo.h" - - [[ -f ${patchdir}/series ]] || return 0 - -while read patch -do - patchname=$(echo $patch | sed 's/\.diff$//') - < $patchdir/$patch sed -e '/^Subject:/ { N; s/\n / / }' | sed -n -e ' - - # massage the patch headers - s|^Bug: .*https\?://rt\.perl\.org/.*id=\(.*\).*|[perl #\1]|; tprepend; - s|^Bug: .*https\?://rt\.cpan\.org/.*id=\(.*\).*|[rt.cpan.org #\1]|; tprepend; - s|^Bug-Gentoo: ||; tprepend; - s/^\(Subject\|Description\): //; tappend; - s|^Origin: .*http://perl5\.git\.perl\.org/perl\.git/commit\(diff\)\?/\(.......\).*|[\2]|; tprepend; - - # post-process at the end of input - $ { x; - # include the version number in the patchlevel.h description (if available) - s/List packaged patches/&'" for ${PF}(#${PATCH_VER})"'/; - - # escape any backslashes and double quotes - s|\\|\\\\|g; s|"|\\"|g; - - # add a prefix - s|^|\t,"'"$prefix$patchname"' - |; - # newlines away - s/\n/ /g; s/ */ /g; - # add a suffix - s/ *$/"/; p - }; - # stop all processing - d; - # label: append to the hold space - :append H; d; - # label: prepend to the hold space - :prepend x; H; d; - ' -done < "${WORKDIR}"/patches/series > "${S}/${patchoutput}" -echo "${patchoutput}" >> "${S}/MANIFEST" -} - src_prepare_perlcross() { cp -a ../perl-cross-${CROSS_VER}/* . || die @@ -313,28 +263,143 @@ src_prepare_dynamic() { ln -s ${LIBPERL} libperl$(get_libname ) || die } +# Copy a patch into the patch series +# add_patch SRC_PATH DEST_NAME ['description'] ['bug'] ['bug'] +# - description is optional, but recommended +# - all arguments after descriptions are bug URLs +add_patch() { + local patchdir="${WORKDIR}/patches" + local infodir="${WORKDIR}/patch-info" + local src_name dest_name desc + src_name="$1" + dest_name="$2" + desc="$3" + shift; shift; shift; + einfo "Adding ${dest_name} to patch bundle" + cp "${src_name}" "${patchdir}/${dest_name}" || die "Couldn't copy ${src_name} to ${dest_name}" + if [[ -n "${desc}" ]]; then + printf "%s" "${desc}" > "${infodir}/${dest_name}.desc" || die "Couldn't write ${dest_name}.desc" + fi + if [[ $# -gt 0 ]]; then + # Note: when $@ is more than one element, this emits a + # line for each element + printf "%s\n" "$@" > "${infodir}/${dest_name}.bugs" || die "Couldn't write ${dest_name}.bugs" + fi +} +# Remove a patch using a glob expr +# eg: +# rm_patch *-darin-Use-CC* +# +rm_patch() { + local patchdir="${WORKDIR}/patches" + local expr="$1" + local patch="$( cd "${patchdir}"; echo $expr )" + einfo "Removing $patch ($expr) from patch bundle" + if [[ -e "${patchdir}/${patch}" ]]; then + rm -f "${patchdir}/${patch}" || die "Can't remove ${patch} ( $expr )" + else + ewarn "No ${expr} found in ${patchdir} to remove" + fi +} +# Yes, this is a reasonable amount of code for something seemingly simple +# but this is far easier to debug when things go wrong, and things went wrong +# multiple times while I was getting the exact number of slashes right, which +# requires circumnavigating both bash and sed escape mechanisms. +c_escape_string() { + local slash dquote + slash='\' + dquote='"' + re_slash="${slash}${slash}" + re_dquote="${slash}${dquote}" + + # Convert \ to \\, + # " to \" + echo "$1" |\ + sed "s|${re_slash}|${re_slash}${re_slash}|g" |\ + sed "s|${re_dquote}|${re_slash}${re_dquote}|g" +} +c_escape_file() { + c_escape_string "$(cat "$1")" +} + +apply_patchdir() { + local patchdir="${WORKDIR}/patches" + local infodir="${WORKDIR}/patch-info" + local patchoutput="patchlevel-gentoo.h" + + # Inject Patch-Level info into description for patchlevel.h patch + # to show in -V + local patch_expr="*List-packaged-patches*" + local patch="$( cd "${patchdir}"; echo $patch_expr )"; + einfo "Injecting patch-level info into ${patch}.desc ( $patch_expr )" + + if [[ -e "${patchdir}/${patch}" ]]; then + printf "List packaged patches for %s(%s) in patchlevel.h" "${PF}" "${PATCH_BASE}"\ + >"${infodir}/${patch}.desc" || die "Can't rewrite ${patch}.desc" + else + eerror "No $patch_expr found in ${patchdir}" + fi + + # Compute patch list to apply + # different name other than PATCHES to stop default + # reapplying it + # Single depth is currently only supported, as artifacts can reside + # from the old layout being multiple-directories, as well as it grossly + # simplifying the patchlevel_gentoo.h generation. + local PERL_PATCHES=($( + find "${patchdir}" -maxdepth 1 -mindepth 1 -type f -printf "%f\n" |\ + grep -E '[.](diff|patch)$' |\ + sort -n + )) + + for patch in "${PERL_PATCHES[@]}"; do + eapply "${WORKDIR}"/patches/${patch} + done + + einfo "Generating $patchoutput" + + # This code creates a header file, each iteration + # creates one-or-more-lines for each entry found in PERL_PATCHES + # and STDOUT is redirected to the .h file + for patch in "${PERL_PATCHES[@]}"; do + local desc_f="${infodir}/${patch}.desc" + local bugs_f="${infodir}/${patch}.bugs" + + printf ',"%s"\n' "${patch}" + if [[ ! -e "${desc_f}" ]]; then + ewarn "No description provided for ${patch} (expected: ${desc_f} )" + else + local desc="$(c_escape_file "${desc_f}")" + printf ',"- %s"\n' "${desc}" + fi + if [[ -e "${bugs_f}" ]]; then + while read -d $'\n' -r line; do + local esc_line="$(c_escape_string "${line}")" + printf ',"- Bug: %s"\n' "${esc_line}" + done <"${bugs_f}" + fi + done > "${S}/${patchoutput}" + printf "%s\n" "${patchoutput}" >> "${S}/MANIFEST" + +} src_prepare() { - local patch + local patchdir="${WORKDIR}/patches" + # Prepare Patch dir with additional patches / remove unwanted patches + # Inject bug/desc entries for perl -V if use hppa ; then - eapply "${FILESDIR}/${PN}-5.26.2-hppa.patch" # bug 634162 + # bug 634162 + add_patch "${FILESDIR}/${PN}-5.26.2-hppa.patch" "100-5.26.2-hppa.patch"\ + "Fix broken miniperl on hppa"\ + "https://bugs.debian.org/869122" "https://bugs.gentoo.org/634162" fi - if [[ ${CHOST} == *-solaris* ]] ; then # do NOT mess with nsl, on Solaris this is always necessary, # when -lsocket is used e.g. to get h_errno - sed -i '/gentoo\/no-nsl-cl\.patch/d' "${WORKDIR}/patches/series" || die + rm_patch "*-nsl-and-cl*" fi - einfo "[ Applying patches from ${PATCH_BASE} ]" - while read patch ; do - eapply "${WORKDIR}"/patches/${patch} - done < "${WORKDIR}"/patches/series - einfo "[ Done with ${PATCH_BASE} ]" - - eapply "${FILESDIR}/${PN}-5.30.3-gentoo-libdirs.patch" - - src_prepare_update_patchlevel_h + apply_patchdir tc-is-cross-compiler && src_prepare_perlcross |