Merge branch 'core-updates'
[jackhill/guix/guix.git] / gnu / packages / patches / perl-no-sys-dirs.patch
1 Don't look for headers and libraries in "traditional" locations.
2
3 Patch adapted from Nixpkgs, originally by Eelco Dolstra
4 <eelco.dolstra@logicblox.com>.
5
6 diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
7 --- perl-5.20.0-orig/Configure 2014-05-26 15:34:18.000000000 +0200
8 +++ perl-5.20.0/Configure 2014-06-25 10:43:35.368285986 +0200
9 @@ -106,15 +106,7 @@
10 fi
11
12 : Proper PATH setting
13 -paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
14 -paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
15 -paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
16 -paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
17 -paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
18 -paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
19 -paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
20 -paths="$paths /sbin /usr/sbin /usr/libexec"
21 -paths="$paths /system/gnu_library/bin"
22 +paths=''
23
24 for p in $paths
25 do
26 @@ -1337,8 +1329,7 @@
27 archname=''
28 : Possible local include directories to search.
29 : Set locincpth to "" in a hint file to defeat local include searches.
30 -locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
31 -locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
32 +locincpth=""
33 :
34 : no include file wanted by default
35 inclwanted=''
36 @@ -1349,17 +1340,12 @@
37
38 libnames=''
39 : change the next line if compiling for Xenix/286 on Xenix/386
40 -xlibpth='/usr/lib/386 /lib/386'
41 +xlibpth=''
42 : Possible local library directories to search.
43 -loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
44 -loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
45 +loclibpth=""
46
47 : general looking path for locating libraries
48 -glibpth="/lib /usr/lib $xlibpth"
49 -glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
50 -test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
51 -test -f /shlib/libc.so && glibpth="/shlib $glibpth"
52 -test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
53 +glibpth=""
54
55 : Private path used by Configure to find libraries. Its value
56 : is prepended to libpth. This variable takes care of special
57 @@ -1391,8 +1377,6 @@
58 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
59 : We probably want to search /usr/shlib before most other libraries.
60 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
61 -glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
62 -glibpth="/usr/shlib $glibpth"
63 : Do not use vfork unless overridden by a hint file.
64 usevfork=false
65
66 @@ -2446,7 +2430,6 @@
67 zip
68 "
69 pth=`echo $PATH | sed -e "s/$p_/ /g"`
70 -pth="$pth $sysroot/lib $sysroot/usr/lib"
71 for file in $loclist; do
72 eval xxx=\$$file
73 case "$xxx" in
74 @@ -4936,7 +4919,7 @@
75 : Set private lib path
76 case "$plibpth" in
77 '') if ./mips; then
78 - plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
79 + plibpth="$incpath/usr/lib"
80 fi;;
81 esac
82 case "$libpth" in
83 @@ -8600,13 +8583,8 @@
84 echo " "
85 case "$sysman" in
86 '')
87 - syspath='/usr/share/man/man1 /usr/man/man1'
88 - syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
89 - syspath="$syspath /usr/man/u_man/man1"
90 - syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
91 - syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
92 - syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
93 - sysman=`./loc . /usr/man/man1 $syspath`
94 + syspath=''
95 + sysman=''
96 ;;
97 esac
98 if $test -d "$sysman"; then
99 @@ -19900,9 +19878,10 @@
100 case "$full_ar" in
101 '') full_ar=$ar ;;
102 esac
103 +full_ar=ar
104
105 : Store the full pathname to the sed program for use in the C program
106 -full_sed=$sed
107 +full_sed=sed
108
109 : see what type gids are declared as in the kernel
110 echo " "
111 Only in perl-5.20.0/: Configure.orig
112 diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/ext/Errno/Errno_pm.PL perl-5.20.0/ext/Errno/Errno_pm.PL
113 --- perl-5.20.0-orig/ext/Errno/Errno_pm.PL 2014-05-26 15:34:20.000000000 +0200
114 +++ perl-5.20.0/ext/Errno/Errno_pm.PL 2014-06-25 10:31:24.317970047 +0200
115 @@ -126,11 +126,7 @@
116 if ($dep =~ /(\S+errno\.h)/) {
117 $file{$1} = 1;
118 }
119 - } elsif ($^O eq 'linux' &&
120 - $Config{gccversion} ne '' &&
121 - $Config{gccversion} !~ /intel/i
122 - # might be using, say, Intel's icc
123 - ) {
124 + } elsif (0) {
125 # When cross-compiling we may store a path for gcc's "sysroot" option:
126 my $sysroot = $Config{sysroot} || '';
127 # Some Linuxes have weird errno.hs which generate
128 Only in perl-5.20.0/ext/Errno: Errno_pm.PL.orig
129 diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/hints/freebsd.sh perl-5.20.0/hints/freebsd.sh
130 --- perl-5.20.0-orig/hints/freebsd.sh 2014-01-31 22:55:51.000000000 +0100
131 +++ perl-5.20.0/hints/freebsd.sh 2014-06-25 10:25:53.263964680 +0200
132 @@ -119,21 +119,21 @@
133 objformat=`/usr/bin/objformat`
134 if [ x$objformat = xaout ]; then
135 if [ -e /usr/lib/aout ]; then
136 - libpth="/usr/lib/aout /usr/local/lib /usr/lib"
137 - glibpth="/usr/lib/aout /usr/local/lib /usr/lib"
138 + libpth=""
139 + glibpth=""
140 fi
141 lddlflags='-Bshareable'
142 else
143 - libpth="/usr/lib /usr/local/lib"
144 - glibpth="/usr/lib /usr/local/lib"
145 + libpth=""
146 + glibpth=""
147 ldflags="-Wl,-E "
148 lddlflags="-shared "
149 fi
150 cccdlflags='-DPIC -fPIC'
151 ;;
152 *)
153 - libpth="/usr/lib /usr/local/lib"
154 - glibpth="/usr/lib /usr/local/lib"
155 + libpth=""
156 + glibpth=""
157 ldflags="-Wl,-E "
158 lddlflags="-shared "
159 cccdlflags='-DPIC -fPIC'
160 diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/hints/linux.sh perl-5.20.0/hints/linux.sh
161 --- perl-5.20.0-orig/hints/linux.sh 2014-05-26 15:34:20.000000000 +0200
162 +++ perl-5.20.0/hints/linux.sh 2014-06-25 10:33:47.354883843 +0200
163 @@ -150,25 +150,6 @@
164 ;;
165 esac
166
167 -# Ubuntu 11.04 (and later, presumably) doesn't keep most libraries
168 -# (such as -lm) in /lib or /usr/lib. So we have to ask gcc to tell us
169 -# where to look. We don't want gcc's own libraries, however, so we
170 -# filter those out.
171 -# This could be conditional on Unbuntu, but other distributions may
172 -# follow suit, and this scheme seems to work even on rather old gcc's.
173 -# This unconditionally uses gcc because even if the user is using another
174 -# compiler, we still need to find the math library and friends, and I don't
175 -# know how other compilers will cope with that situation.
176 -# Morever, if the user has their own gcc earlier in $PATH than the system gcc,
177 -# we don't want its libraries. So we try to prefer the system gcc
178 -# Still, as an escape hatch, allow Configure command line overrides to
179 -# plibpth to bypass this check.
180 -if [ -x /usr/bin/gcc ] ; then
181 - gcc=/usr/bin/gcc
182 -else
183 - gcc=gcc
184 -fi
185 -
186 case "$plibpth" in
187 '') plibpth=`LANG=C LC_ALL=C $gcc $ccflags $ldflags -print-search-dirs | grep libraries |
188 cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'`
189 @@ -367,33 +322,6 @@
190 ;;
191 esac
192
193 -# SuSE8.2 has /usr/lib/libndbm* which are ld scripts rather than
194 -# true libraries. The scripts cause binding against static
195 -# version of -lgdbm which is a bad idea. So if we have 'nm'
196 -# make sure it can read the file
197 -# NI-S 2003/08/07
198 -case "$nm" in
199 - '') ;;
200 - *)
201 - for p in $plibpth
202 - do
203 - if $test -r $p/libndbm.so; then
204 - if $nm $p/libndbm.so >/dev/null 2>&1 ; then
205 - echo 'Your shared -lndbm seems to be a real library.'
206 - _libndbm_real=1
207 - break
208 - fi
209 - fi
210 - done
211 - if $test "X$_libndbm_real" = X; then
212 - echo 'Your shared -lndbm is not a real library.'
213 - set `echo X "$libswanted "| sed -e 's/ ndbm / /'`
214 - shift
215 - libswanted="$*"
216 - fi
217 - ;;
218 -esac
219 -
220 # Linux on Synology.
221 if [ -f /etc/synoinfo.conf -a -d /usr/syno ]; then
222 # Tested on Synology DS213 and DS413
223 diff --git a/hints/linux.sh b/hints/linux.sh
224 index 3f38ea0..97aed11 100644
225 --- a/hints/linux.sh
226 +++ b/hints/linux.sh
227 @@ -195,32 +195,6 @@ case "$usequadmath" in
228 ;;
229 esac
230
231 -case "$libc" in
232 -'')
233 -# If you have glibc, then report the version for ./myconfig bug reporting.
234 -# (Configure doesn't need to know the specific version since it just uses
235 -# gcc to load the library for all tests.)
236 -# We don't use __GLIBC__ and __GLIBC_MINOR__ because they
237 -# are insufficiently precise to distinguish things like
238 -# libc-2.0.6 and libc-2.0.7.
239 - for p in $plibpth
240 - do
241 - for trylib in libc.so.6 libc.so
242 - do
243 - if $test -e $p/$trylib; then
244 - libc=`ls -l $p/$trylib | awk '{print $NF}'`
245 - if $test "X$libc" != X; then
246 - break
247 - fi
248 - fi
249 - done
250 - if $test "X$libc" != X; then
251 - break
252 - fi
253 - done
254 - ;;
255 -esac
256 -
257 if ${sh:-/bin/sh} -c exit; then
258 echo ''
259 echo 'You appear to have a working bash. Good.'