sci-mathematics/pari: Fix for '.' in @INC on perl 5.26 re bug #615016
authorKent Fredric <kentnl@gentoo.org>
Sat, 10 Jun 2017 23:48:16 +0000 (11:48 +1200)
committerKent Fredric <kentnl@gentoo.org>
Sun, 11 Jun 2017 14:29:18 +0000 (02:29 +1200)
Perl 5.26 removes implied cwd from library loading paths, and
subsequently Pari's compile fails due to reliance on this implication.

These patches rectify that by constructing a library path the same
as the scripts directory, and inserting that into `@INC`

Of course, we still need the oldest pari because dev-perl/Math-Pari
needs the old version.

And of course, the files in question have minor changes over the
handful of versions, necessitating 3 *mostly* identical but slightly
different patches for the relevant versions.

I haven't filed this issue upstream, as their bug reporting stuff
looked dizzyingly confusing.

Bug: https://bugs.gentoo.org/615016
Package-Manager: Portage-2.3.6, Repoman-2.3.2

12 files changed:
sci-mathematics/pari/files/pari-2.3.5-no-dot-inc.patch [new file with mode: 0644]
sci-mathematics/pari/files/pari-2.5.0-no-dot-inc.patch [new file with mode: 0644]
sci-mathematics/pari/files/pari-2.7.0-no-dot-inc.patch [new file with mode: 0644]
sci-mathematics/pari/pari-2.3.5.ebuild
sci-mathematics/pari/pari-2.5.0-r3.ebuild
sci-mathematics/pari/pari-2.5.1-r1.ebuild
sci-mathematics/pari/pari-2.5.1.ebuild
sci-mathematics/pari/pari-2.5.2.ebuild
sci-mathematics/pari/pari-2.5.3.ebuild
sci-mathematics/pari/pari-2.5.4.ebuild
sci-mathematics/pari/pari-2.7.0.ebuild
sci-mathematics/pari/pari-2.7.1.ebuild

diff --git a/sci-mathematics/pari/files/pari-2.3.5-no-dot-inc.patch b/sci-mathematics/pari/files/pari-2.3.5-no-dot-inc.patch
new file mode 100644 (file)
index 0000000..cd34851
--- /dev/null
@@ -0,0 +1,61 @@
+From 4f1e00df5ea1e51042146f6277bb1af02f249cc3 Mon Sep 17 00:00:00 2001
+From: Kent Fredric <kentfredric@gmail.com>
+Date: Sun, 11 Jun 2017 10:31:03 +1200
+Subject: [PATCH] Fix for 5.26 removal of '.' in @INC
+
+Previous scripts assumed CWD was in @INC and that "PARI::822" was in
+wherever CWD was.
+
+This fixes both of those, and the latter, because its not obvious
+from the build system where one should assume CWD to be.
+
+Instead, the absolute path of the directory of these scripts is
+inserted into @INC
+---
+ src/desc/gen_member | 4 ++++
+ src/desc/gen_proto  | 4 ++++
+ src/desc/merge_822  | 4 ++++
+ 3 files changed, 12 insertions(+)
+
+diff --git a/src/desc/gen_member b/src/desc/gen_member
+index 2f3cf52..66dea2b 100755
+--- a/src/desc/gen_member
++++ b/src/desc/gen_member
+@@ -1,4 +1,8 @@
+ #!/usr/bin/perl -w
++use File::Spec;
++use File::Basename qw( dirname );
++use lib dirname(File::Spec->rel2abs(__FILE__));
++
+ use PARI::822;
+ 
+ $class='member_functions';
+diff --git a/src/desc/gen_proto b/src/desc/gen_proto
+index 1b507fa..2fb4d3f 100755
+--- a/src/desc/gen_proto
++++ b/src/desc/gen_proto
+@@ -1,4 +1,8 @@
+ #!/usr/bin/perl -w
++use File::Spec;
++use File::Basename qw( dirname );
++use lib dirname(File::Spec->rel2abs(__FILE__));
++
+ use PARI::822;
+ 
+ $class=$ARGV[0];
+diff --git a/src/desc/merge_822 b/src/desc/merge_822
+index a02d612..9ca8252 100755
+--- a/src/desc/merge_822
++++ b/src/desc/merge_822
+@@ -1,4 +1,8 @@
+ #!/usr/bin/perl -w
++use File::Spec;
++use File::Basename qw( dirname );
++use lib dirname(File::Spec->rel2abs(__FILE__));
++
+ use PARI::822;
+ 
+ PARI::822::read(\%funcs,$_,1)
+-- 
+2.13.1
+
diff --git a/sci-mathematics/pari/files/pari-2.5.0-no-dot-inc.patch b/sci-mathematics/pari/files/pari-2.5.0-no-dot-inc.patch
new file mode 100644 (file)
index 0000000..e34fa6b
--- /dev/null
@@ -0,0 +1,61 @@
+From 03df0cdd7228a412d2adfe9ee9c746b3ec69dd6b Mon Sep 17 00:00:00 2001
+From: Kent Fredric <kentfredric@gmail.com>
+Date: Sun, 11 Jun 2017 10:31:03 +1200
+Subject: [PATCH] Fix for 5.26 removal of '.' in @INC
+
+Previous scripts assumed CWD was in @INC and that "PARI::822" was in
+wherever CWD was.
+
+This fixes both of those, and the latter, because its not obvious
+from the build system where one should assume CWD to be.
+
+Instead, the absolute path of the directory of these scripts is
+inserted into @INC
+---
+ src/desc/doc_make  | 4 ++++
+ src/desc/gen_proto | 4 ++++
+ src/desc/merge_822 | 4 ++++
+ 3 files changed, 12 insertions(+)
+
+diff --git a/src/desc/doc_make b/src/desc/doc_make
+index 02dc90d..55296ed 100755
+--- a/src/desc/doc_make
++++ b/src/desc/doc_make
+@@ -1,4 +1,8 @@
+ #!/usr/bin/perl
++use File::Spec;
++use File::Basename qw( dirname );
++use lib dirname(File::Spec->rel2abs(__FILE__));
++
+ use PARI::822;
+ 
+ PARI::822::read(\%funcs, "pari.desc");
+diff --git a/src/desc/gen_proto b/src/desc/gen_proto
+index 38c2daf..ffb4276 100755
+--- a/src/desc/gen_proto
++++ b/src/desc/gen_proto
+@@ -1,4 +1,8 @@
+ #!/usr/bin/perl -w
++use File::Spec;
++use File::Basename qw( dirname );
++use lib dirname(File::Spec->rel2abs(__FILE__));
++
+ use PARI::822;
+ 
+ $class=$ARGV[0];
+diff --git a/src/desc/merge_822 b/src/desc/merge_822
+index 4c9217b..32b3cc9 100755
+--- a/src/desc/merge_822
++++ b/src/desc/merge_822
+@@ -1,4 +1,8 @@
+ #!/usr/bin/perl -w
++use File::Spec;
++use File::Basename qw( dirname );
++use lib dirname(File::Spec->rel2abs(__FILE__));
++
+ use PARI::822;
+ 
+ open(IN, $ARGV[0]) || die "cannot find $ARGV[0]";
+-- 
+2.13.1
+
diff --git a/sci-mathematics/pari/files/pari-2.7.0-no-dot-inc.patch b/sci-mathematics/pari/files/pari-2.7.0-no-dot-inc.patch
new file mode 100644 (file)
index 0000000..9d868ef
--- /dev/null
@@ -0,0 +1,64 @@
+From 2864fe5b852e443d98af92d8929e359525ccb1a2 Mon Sep 17 00:00:00 2001
+From: Kent Fredric <kentfredric@gmail.com>
+Date: Sun, 11 Jun 2017 10:31:03 +1200
+Subject: [PATCH] Fix for 5.26 removal of '.' in @INC
+
+Previous scripts assumed CWD was in @INC and that "PARI::822" was in
+wherever CWD was.
+
+This fixes both of those, and the latter, because its not obvious
+from the build system where one should assume CWD to be.
+
+Instead, the absolute path of the directory of these scripts is
+inserted into @INC
+---
+ src/desc/doc_make  | 5 +++++
+ src/desc/gen_proto | 4 ++++
+ src/desc/merge_822 | 4 ++++
+ 3 files changed, 13 insertions(+)
+
+diff --git a/src/desc/doc_make b/src/desc/doc_make
+index 91b894e..ffbbb78 100755
+--- a/src/desc/doc_make
++++ b/src/desc/doc_make
+@@ -1,6 +1,11 @@
+ #!/usr/bin/perl
+ use warnings FATAL => 'all';
+ use strict;
++
++use File::Spec;
++use File::Basename qw( dirname );
++use lib dirname(File::Spec->rel2abs(__FILE__));
++
+ use PARI::822;
+ 
+ my (%funcs, %Fun_by_sec);
+diff --git a/src/desc/gen_proto b/src/desc/gen_proto
+index ee55449..5ca0305 100755
+--- a/src/desc/gen_proto
++++ b/src/desc/gen_proto
+@@ -1,4 +1,8 @@
+ #!/usr/bin/perl -w
++use File::Spec;
++use File::Basename qw( dirname );
++use lib dirname(File::Spec->rel2abs(__FILE__));
++
+ use PARI::822;
+ 
+ $class=$ARGV[0];
+diff --git a/src/desc/merge_822 b/src/desc/merge_822
+index 4c9217b..32b3cc9 100755
+--- a/src/desc/merge_822
++++ b/src/desc/merge_822
+@@ -1,4 +1,8 @@
+ #!/usr/bin/perl -w
++use File::Spec;
++use File::Basename qw( dirname );
++use lib dirname(File::Spec->rel2abs(__FILE__));
++
+ use PARI::822;
+ 
+ open(IN, $ARGV[0]) || die "cannot find $ARGV[0]";
+-- 
+2.13.1
+
index 2d3e754e7b108e9e2a48ebe582543dcc7c74edbd..a0f484b46778e38d6369ff9d2d88688a590b3dde 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=3
@@ -43,6 +43,7 @@ src_prepare() {
        epatch "${FILESDIR}/"${PN}-2.3.2-strip.patch
        epatch "${FILESDIR}/"${PN}-2.3.2-ppc-powerpc-arch-fix.patch
        epatch "${FILESDIR}/"${PN}-2.3.5-doc-make.patch
+       epatch "${FILESDIR}/"${PN}-2.3.5-no-dot-inc.patch
 
        # disable default building of docs during install
        sed -i \
index 7fcce2db95fc68028a8e4bedfa82e22bafaeff8e..57421935e631e8f9cad25d529974730b4e268018 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI="4"
@@ -40,6 +40,8 @@ src_prepare() {
        epatch "${FILESDIR}/${PN}"-2.5.0-mp.c.patch
        # OS X: add -install_name to the linker option
        epatch "${FILESDIR}/${PN}"-2.5.0-macos.patch
+       # Fix Perl 5.26
+       epatch "${FILESDIR}/"${PN}-2.5.0-no-dot-inc.patch
 
        # disable default building of docs during install
        sed -i \
index af29f9f8b647f3b89128554c424ed1b22babfea1..7202ed087deaa5b059669c5c7b08e6177f37d56b 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI="4"
@@ -41,6 +41,8 @@ src_prepare() {
        epatch "${FILESDIR}"/${PN}-2.5.0-mp.c.patch
        # OS X: add -install_name to the linker option
        epatch "${FILESDIR}"/${PN}-2.5.0-macos.patch
+       # Fix Perl 5.26
+       epatch "${FILESDIR}/"${PN}-2.5.0-no-dot-inc.patch
        # from debian, fies bug #423617
        epatch "${FILESDIR}"/${PN}-2.5.1-gcc47.patch
        # fix automagic
index edaad215734a7016dfd6f471ac3c764db7b99ab8..fb1efebef0c376e9c77dae3291c47f3fb81047f1 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI="4"
@@ -40,6 +40,8 @@ src_prepare() {
        epatch "${FILESDIR}/${PN}"-2.5.0-mp.c.patch
        # OS X: add -install_name to the linker option
        epatch "${FILESDIR}/${PN}"-2.5.0-macos.patch
+       # Fix Perl 5.26
+       epatch "${FILESDIR}/"${PN}-2.5.0-no-dot-inc.patch
        # from debian, fies bug #423617
        epatch "${FILESDIR}/${PN}"-2.5.1-gcc47.patch
 
index 97003885b770e907c9d8c2b095628f9efee75fb7..3bc68a6ccdc07e95e4224a7fddf57dea2afd7c17 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=4
@@ -41,6 +41,8 @@ src_prepare() {
        epatch "${FILESDIR}"/${PN}-2.5.0-mp.c.patch
        # OS X: add -install_name to the linker option
        epatch "${FILESDIR}"/${PN}-2.5.0-macos.patch
+       # Fix Perl 5.26
+       epatch "${FILESDIR}/"${PN}-2.5.0-no-dot-inc.patch
        # fix automagic
        epatch "${FILESDIR}"/${PN}-2.5.1-no-automagic.patch
 
index c09a829e2119771ed587106fa226ffd46b388747..8f42ea7f9a84dd9705600f8fc34f4d37320ef26b 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=4
@@ -41,6 +41,8 @@ src_prepare() {
        epatch "${FILESDIR}"/${PN}-2.5.0-mp.c.patch
        # OS X: add -install_name to the linker option
        epatch "${FILESDIR}"/${PN}-2.5.0-macos.patch
+       # Fix Perl 5.26
+       epatch "${FILESDIR}/"${PN}-2.5.0-no-dot-inc.patch
        # fix automagic
        epatch "${FILESDIR}"/${PN}-2.5.1-no-automagic.patch
 
index 07cd3c3125130ee687bfff2e093a13b3a6405b37..2c261d95efc220d693f91a25c043dedd3fd78b36 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=5
@@ -42,6 +42,8 @@ src_prepare() {
        epatch "${FILESDIR}"/${PN}-2.5.0-mp.c.patch
        # OS X: add -install_name to the linker option
        epatch "${FILESDIR}"/${PN}-2.5.0-macos.patch
+       # Fix Perl 5.26
+       epatch "${FILESDIR}/"${PN}-2.5.0-no-dot-inc.patch
        # fix automagic
        epatch "${FILESDIR}"/${PN}-2.5.1-no-automagic.patch
        # sage-on-gentoo trac 13902: Slowdown for PARI integer determinant
index 39551d6c2340b6119aad3f83bd25a3ee695bce14..5553fa2865b926a5afc2a305b5b8d0c61f1cbcd2 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=5
@@ -42,6 +42,8 @@ src_prepare() {
        epatch "${FILESDIR}"/${PN}-2.7.0-no-automagic.patch
        # sage-on-gentoo trac 15654: PARI discriminant speed depends on stack size
        epatch "${FILESDIR}"/${PN}-2.7.0-slow-discriminant.patch
+       # Fix Perl 5.26
+       epatch "${FILESDIR}/"${PN}-2.7.0-no-dot-inc.patch
 
        # disable default building of docs during install
        sed -i \
index f34ec5d3143ff9643197d527969c4cadf4e565b1..1bf04634442618205cea85dfbf138dfa5d24c155 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=5
@@ -42,6 +42,8 @@ src_prepare() {
        epatch "${FILESDIR}"/${PN}-2.7.0-no-automagic.patch
        # sage-on-gentoo trac 15654: PARI discriminant speed depends on stack size
        epatch "${FILESDIR}"/${PN}-2.7.0-slow-discriminant.patch
+       # Fix Perl 5.26
+       epatch "${FILESDIR}/"${PN}-2.7.0-no-dot-inc.patch
        # fix building docs with perl-5.22
        epatch "${FILESDIR}"/${PN}-2.7.1-perl-5.22-doc.patch