1 |
commit: 5607df38997c6992798a115b4aefbcd96cb17b5f |
2 |
Author: Kent Fredric <kentnl <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Oct 25 19:48:35 2017 +0000 |
4 |
Commit: Kent Fredric <kentnl <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Oct 25 19:48:55 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5607df38 |
7 |
|
8 |
dev-perl/HTML-Template-JIT: Fix for '.' in @INC bug #635464 |
9 |
|
10 |
- EAPI6 |
11 |
- Enable tests |
12 |
- Add USE=examples |
13 |
- Fix runtime broken due to '.' in @INC exposed by enabling tests |
14 |
|
15 |
Bug: https://bugs.gentoo.org/635464 |
16 |
Package-Manager: Portage-2.3.8, Repoman-2.3.3 |
17 |
|
18 |
.../HTML-Template-JIT-0.50.0-r2.ebuild | 20 +++++++ |
19 |
.../HTML-Template-JIT-0.50.0-no-dot-inc.patch | 61 ++++++++++++++++++++++ |
20 |
2 files changed, 81 insertions(+) |
21 |
|
22 |
diff --git a/dev-perl/HTML-Template-JIT/HTML-Template-JIT-0.50.0-r2.ebuild b/dev-perl/HTML-Template-JIT/HTML-Template-JIT-0.50.0-r2.ebuild |
23 |
new file mode 100644 |
24 |
index 00000000000..48f3e10a3e4 |
25 |
--- /dev/null |
26 |
+++ b/dev-perl/HTML-Template-JIT/HTML-Template-JIT-0.50.0-r2.ebuild |
27 |
@@ -0,0 +1,20 @@ |
28 |
+# Copyright 1999-2017 Gentoo Foundation |
29 |
+# Distributed under the terms of the GNU General Public License v2 |
30 |
+ |
31 |
+EAPI=6 |
32 |
+ |
33 |
+DIST_AUTHOR=SAMTREGAR |
34 |
+DIST_VERSION=0.05 |
35 |
+DIST_EXAMPLES=("script/benchmark.pl") |
36 |
+inherit perl-module |
37 |
+ |
38 |
+DESCRIPTION="a just-in-time compiler for HTML::Template" |
39 |
+ |
40 |
+SLOT="0" |
41 |
+KEYWORDS="~amd64 ~x86" |
42 |
+IUSE="" |
43 |
+ |
44 |
+RDEPEND=">=dev-perl/HTML-Template-2.8 |
45 |
+ dev-perl/Inline" |
46 |
+DEPEND="${RDEPEND}" |
47 |
+PATCHES=("${FILESDIR}/${P}-no-dot-inc.patch") |
48 |
|
49 |
diff --git a/dev-perl/HTML-Template-JIT/files/HTML-Template-JIT-0.50.0-no-dot-inc.patch b/dev-perl/HTML-Template-JIT/files/HTML-Template-JIT-0.50.0-no-dot-inc.patch |
50 |
new file mode 100644 |
51 |
index 00000000000..624e579a618 |
52 |
--- /dev/null |
53 |
+++ b/dev-perl/HTML-Template-JIT/files/HTML-Template-JIT-0.50.0-no-dot-inc.patch |
54 |
@@ -0,0 +1,61 @@ |
55 |
+From efbee2adfeb592240e1c84326ece8c90c239bbee Mon Sep 17 00:00:00 2001 |
56 |
+From: Kent Fredric <kentnl@g.o> |
57 |
+Date: Thu, 26 Oct 2017 08:26:53 +1300 |
58 |
+Subject: Fix compiling templates under Perl 5.26 without '.' in @INC |
59 |
+ |
60 |
+Perl 5.26 changes the default contents of @INC to no longer include |
61 |
+".", which is required for "require q[foo.tpl]" semantics. |
62 |
+ |
63 |
+This breakage is invisible in tests due to a workaround P5P put in |
64 |
+place to avoid breaking tests, by setting PERL_USE_UNSAFE_INC=1 in |
65 |
+Test::Harness and CPAN installers, which makes '.' re-appear in @INC |
66 |
+during installation, while still being silently broken in production. |
67 |
+ |
68 |
+This fix works by relying on the mechanic of require() to *NOT* consult |
69 |
+@INC if $path is either an absolute, or a "./" prefixed relative path, |
70 |
+by converting it to an absolute path just before requiring it. |
71 |
+ |
72 |
+Bug: https://rt.cpan.org/Ticket/Display.html?id=123380 |
73 |
+Bug: https://bugs.gentoo.org/635464 |
74 |
+--- |
75 |
+ JIT.pm | 2 +- |
76 |
+ JIT/Compiler.pm | 3 ++- |
77 |
+ 2 files changed, 3 insertions(+), 2 deletions(-) |
78 |
+ |
79 |
+diff --git a/JIT.pm b/JIT.pm |
80 |
+index 9e5a6be..1e2afc8 100644 |
81 |
+--- a/JIT.pm |
82 |
++++ b/JIT.pm |
83 |
+@@ -63,7 +63,7 @@ sub new { |
84 |
+ |
85 |
+ # try to load the module and return package handle if successful |
86 |
+ my $result; |
87 |
+- eval { $result = require $package_path; }; |
88 |
++ eval { $result = require File::Spec->rel2abs($package_path); }; |
89 |
+ if ($result) { |
90 |
+ $package->clear_params(); # need to clear out params from prior run |
91 |
+ return $package; |
92 |
+diff --git a/JIT/Compiler.pm b/JIT/Compiler.pm |
93 |
+index 6ef3e02..bc1e05f 100644 |
94 |
+--- a/JIT/Compiler.pm |
95 |
++++ b/JIT/Compiler.pm |
96 |
+@@ -9,6 +9,7 @@ our $VERSION = '0.01'; |
97 |
+ use HTML::Template; |
98 |
+ use Carp qw(croak confess); |
99 |
+ use File::Path qw(mkpath rmtree); |
100 |
++use File::Spec; |
101 |
+ |
102 |
+ sub compile { |
103 |
+ my %args = @_; |
104 |
+@@ -53,7 +54,7 @@ sub compile { |
105 |
+ |
106 |
+ # try to load the module and return package handle if successful |
107 |
+ my $result; |
108 |
+- eval { $result = require $self->{package_path}; }; |
109 |
++ eval { $result = require File::Spec->rel2abs($self->{package_path}); }; |
110 |
+ return 1 if $result; |
111 |
+ |
112 |
+ # don't leave failed compiles lying around unless we're debuging |
113 |
+-- |
114 |
+2.14.3 |
115 |
+ |