perl: fix not a Mach-O file on macOS
[feed/packages.git] / lang / perl / patches / 920-Revert-perl-127606-adjust-dependency-paths-on-instal.patch
1 From 002d6666a3ed5bc9c360c1f91116ebbf0c5ef57c Mon Sep 17 00:00:00 2001
2 From: Georgi Valkov <gvalkov@gmail.com>
3 Date: Sat, 20 Apr 2024 16:18:37 +0300
4 Subject: [PATCH] revert 88efce38149481334db7ddb932f9b74eaaa9765b
5
6 Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
7 ---
8 Makefile.SH | 35 ++---------------------------------
9 installperl | 25 -------------------------
10 2 files changed, 2 insertions(+), 58 deletions(-)
11
12 --- a/Makefile.SH
13 +++ b/Makefile.SH
14 @@ -61,16 +61,8 @@ true)
15 -compatibility_version \
16 ${api_revision}.${api_version}.${api_subversion} \
17 -current_version \
18 - ${revision}.${patchlevel}.${subversion}"
19 - case "$osvers" in
20 - 1[5-9]*|[2-9]*)
21 - shrpldflags="$shrpldflags -install_name `pwd`/\$@ -Xlinker -headerpad_max_install_names"
22 - exeldflags="-Xlinker -headerpad_max_install_names"
23 - ;;
24 - *)
25 - shrpldflags="$shrpldflags -install_name \$(shrpdir)/\$@"
26 - ;;
27 - esac
28 + ${revision}.${patchlevel}.${subversion} \
29 + -install_name \$(shrpdir)/\$@"
30 ;;
31 cygwin*)
32 shrpldflags="$shrpldflags -Wl,--out-implib=libperl.dll.a"
33 @@ -353,14 +345,6 @@ MANIFEST_SRT = MANIFEST.srt
34
35 !GROK!THIS!
36
37 -case "$useshrplib$osname" in
38 -truedarwin)
39 - $spitshell >>$Makefile <<!GROK!THIS!
40 -PERL_EXE_LDFLAGS=$exeldflags
41 -!GROK!THIS!
42 - ;;
43 -esac
44 -
45 $spitshell >>$Makefile <<!GROK!THIS!
46 # Macros to invoke a copy of our fully operational perl during the build.
47 PERL_EXE = perl\$(EXE_EXT)
48 @@ -1040,20 +1024,6 @@ $(PERL_EXE): $& $(perlmain_dep) $(LIBPER
49 $(SHRPENV) $(CC) -o perl $(CLDFLAGS) $(CCDLFLAGS) $(perlmain_objs) $(LLIBPERL) $(static_ext) `cat ext.libs` $(libs)
50 !NO!SUBS!
51 ;;
52 -
53 - darwin)
54 - case "$useshrplib$osvers" in
55 - true1[5-9]*|true[2-9]*) $spitshell >>$Makefile <<'!NO!SUBS!'
56 - $(SHRPENV) $(CC) -o perl $(PERL_EXE_LDFLAGS) $(CLDFLAGS) $(CCDLFLAGS) $(perlmain_objs) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
57 -!NO!SUBS!
58 - ;;
59 - *) $spitshell >>$Makefile <<'!NO!SUBS!'
60 - $(SHRPENV) $(CC) -o perl $(CLDFLAGS) $(CCDLFLAGS) $(perlmain_objs) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
61 -!NO!SUBS!
62 - ;;
63 - esac
64 - ;;
65 -
66 *) $spitshell >>$Makefile <<'!NO!SUBS!'
67 $(SHRPENV) $(CC) -o perl $(CLDFLAGS) $(CCDLFLAGS) $(perlmain_objs) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
68 !NO!SUBS!
69 --- a/installperl
70 +++ b/installperl
71 @@ -282,7 +282,6 @@ else {
72 safe_unlink("$installbin/$perl_verbase$ver$exe_ext");
73 copy("perl$exe_ext", "$installbin/$perl_verbase$ver$exe_ext");
74 strip("$installbin/$perl_verbase$ver$exe_ext");
75 - fix_dep_names("$installbin/$perl_verbase$ver$exe_ext");
76 chmod(0755, "$installbin/$perl_verbase$ver$exe_ext");
77 `chtag -r "$installbin/$perl_verbase$ver$exe_ext"` if ($^O eq 'os390');
78 }
79 @@ -350,7 +349,6 @@ foreach my $file (@corefiles) {
80 if (copy_if_diff($file,"$installarchlib/CORE/$file")) {
81 if ($file =~ /\.(\Q$so\E|\Q$dlext\E)$/) {
82 strip("-S", "$installarchlib/CORE/$file") if $^O eq 'darwin';
83 - fix_dep_names("$installarchlib/CORE/$file");
84 chmod($SO_MODE, "$installarchlib/CORE/$file");
85 } else {
86 chmod($NON_SO_MODE, "$installarchlib/CORE/$file");
87 @@ -749,27 +747,4 @@ sub strip
88 }
89 }
90
91 -sub fix_dep_names {
92 - my $file = shift;
93 -
94 - $^O eq "darwin" && $Config{osvers} =~ /^(1[5-9]|[2-9])/
95 - && $Config{useshrplib}
96 - or return;
97 -
98 - my @opts;
99 - my $so = $Config{so};
100 - my $libperl = "$Config{archlibexp}/CORE/libperl.$Config{so}";
101 - if ($file =~ /\blibperl.\Q$Config{so}\E$/a) {
102 - push @opts, -id => $libperl;
103 - }
104 - else {
105 - push @opts, -change => getcwd . "/libperl.$so", $libperl;
106 - }
107 - push @opts, $file;
108 -
109 - $opts{verbose} and print " install_name_tool @opts\n";
110 - system "install_name_tool", @opts
111 - and die "Cannot update $file dependency paths\n";
112 -}
113 -
114 # ex: set ts=8 sts=4 sw=4 et: