summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/perl/perl/debian/prefix_changes.diff
blob: 01fda61beebdc7f9d3d646ea12b732e8ace9063f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
From 9dd4fc60a520a47410f3c3e3ff22142cf3376ea3 Mon Sep 17 00:00:00 2001
From: Brendan O'Dea <bod@debian.org>
Date: Tue, 8 Mar 2005 19:30:38 +1100
Subject: Fiddle with *PREFIX and variables written to the
 makefile

Fiddle with *PREFIX and variables written to the makefile so that
install directories may be changed when make is run by passing
PREFIX= to the "make install" command (used when packaging
modules).

Patch-Name: debian/prefix_changes.diff
Upstream-Status: Pending

---
 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm  | 12 ++++++------
 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm |  3 +--
 cpan/ExtUtils-MakeMaker/t/INST.t                |  4 +---
 cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t         | 10 +++++-----
 4 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm
index 433a8dd..7fb501e 100644
--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm
+++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm
@@ -1063,8 +1063,6 @@ all POD files in MAN1PODS and MAN3PODS.
 sub manifypods_target {
     my($self) = shift;
 
-    my $man1pods      = '';
-    my $man3pods      = '';
     my $dependencies  = '';
 
     # populate manXpods & dependencies:
@@ -1080,7 +1078,7 @@ END
     foreach my $section (qw(1 3)) {
         my $pods = $self->{"MAN${section}PODS"};
         my $p2m = sprintf <<'CMD', $section, $] > 5.008 ? " -u" : "";
-	$(NOECHO) $(POD2MAN) --section=%s --perm_rw=$(PERM_RW)%s
+	\$(NOECHO) \$(POD2MAN) --section=\$(MAN${section}EXT) --perm_rw=\$(PERM_RW)%s
 CMD
         push @man_cmds, $self->split_command($p2m, map {($_,$pods->{$_})} sort keys %$pods);
     }
@@ -2022,9 +2020,11 @@ sub init_INSTALL_from_PREFIX {
         $self->{SITEPREFIX}   ||= $sprefix;
         $self->{VENDORPREFIX} ||= $vprefix;
 
-        # Lots of MM extension authors like to use $(PREFIX) so we
-        # put something sensible in there no matter what.
-        $self->{PREFIX} = '$('.uc $self->{INSTALLDIRS}.'PREFIX)';
+	my $p = $self->{PREFIX} = $self->{PERLPREFIX};
+	for my $t (qw/PERL SITE VENDOR/)
+	{
+	    $self->{"${t}PREFIX"} =~ s!^\Q$p\E(?=/|$)!\$(PREFIX)!;
+	}
     }
 
     my $arch    = $Config{archname};
diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
index 5f9673e..89213ed 100644
--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
@@ -3173,8 +3173,7 @@ sub prefixify {
     warn "  prefixify $var => $path\n" if $Verbose >= 2;
     warn "    from $sprefix to $rprefix\n" if $Verbose >= 2;
 
-    if( $self->{ARGS}{PREFIX} &&
-        $path !~ s{^\Q$sprefix\E\b}{$rprefix}s )
+    if( $path !~ s{^\Q$sprefix\E\b}{$rprefix}s && $self->{ARGS}{PREFIX} )
     {
 
         warn "    cannot prefix, using default.\n" if $Verbose >= 2;
diff --git a/cpan/ExtUtils-MakeMaker/t/INST.t b/cpan/ExtUtils-MakeMaker/t/INST.t
index 3562162..e8d8025 100644
--- a/cpan/ExtUtils-MakeMaker/t/INST.t
+++ b/cpan/ExtUtils-MakeMaker/t/INST.t
@@ -67,9 +67,7 @@ isa_ok( $mm, 'ExtUtils::MakeMaker' );
 is( $mm->{NAME}, 'Big::Dummy',  'NAME' );
 is( $mm->{VERSION}, 0.01,            'VERSION' );
 
-my $config_prefix = $Config{installprefixexp} || $Config{installprefix} ||
-                    $Config{prefixexp}        || $Config{prefix};
-is( $mm->{PERLPREFIX}, $config_prefix,   'PERLPREFIX' );
+is( $mm->{PERLPREFIX}, '$(PREFIX)',   'PERLPREFIX' );
 
 is( !!$mm->{PERL_CORE}, !!$ENV{PERL_CORE}, 'PERL_CORE' );
 
diff --git a/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t b/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t
index 5f7d395..fde96cb 100644
--- a/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t
+++ b/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t
@@ -10,7 +10,7 @@ BEGIN {
 }
 
 use strict;
-use Test::More tests => 52;
+use Test::More tests => 47;
 use MakeMaker::Test::Utils;
 use MakeMaker::Test::Setup::BFD;
 use ExtUtils::MakeMaker;
@@ -64,16 +64,16 @@ like( $stdout->read, qr{
                         (?:Writing\ MYMETA.yml\ and\ MYMETA.json\n)?
 }x );
 
-is( $mm->{PREFIX}, '$(SITEPREFIX)', 'PREFIX set based on INSTALLDIRS' );
+#is( $mm->{PREFIX}, '$(SITEPREFIX)', 'PREFIX set based on INSTALLDIRS' );
 
 isa_ok( $mm, 'ExtUtils::MakeMaker' );
 
 is( $mm->{NAME}, 'Big::Dummy',  'NAME' );
 is( $mm->{VERSION}, 0.01,            'VERSION' );
 
-foreach my $prefix (qw(PREFIX PERLPREFIX SITEPREFIX VENDORPREFIX)) {
-    unlike( $mm->{$prefix}, qr/\$\(PREFIX\)/ );
-}
+#foreach my $prefix (qw(PREFIX PERLPREFIX SITEPREFIX VENDORPREFIX)) {
+#    unlike( $mm->{$prefix}, qr/\$\(PREFIX\)/ );
+#}
 
 
 my $PREFIX = File::Spec->catdir('foo', 'bar');
-- 
2.12.3