perl: Update to 5.22
authorFredrik Fornwall <fredrik@fornwall.net>
Mon, 31 Aug 2015 00:35:01 +0000 (20:35 -0400)
committerFredrik Fornwall <fredrik@fornwall.net>
Mon, 31 Aug 2015 00:35:01 +0000 (20:35 -0400)
packages/perl/Cwd.pm.patch
packages/perl/build.sh
packages/perl/configure_func.sh.patch [new file with mode: 0644]

index 3d3ff7f..7373efc 100644 (file)
@@ -1,15 +1,15 @@
-diff -u -r ../perl-5.20.2/dist/PathTools/Cwd.pm ./dist/PathTools/Cwd.pm
---- ../perl-5.20.2/dist/PathTools/Cwd.pm       2015-01-10 07:06:37.000000000 -0500
-+++ ./dist/PathTools/Cwd.pm    2015-05-17 19:40:53.224454256 -0400
-@@ -333,9 +333,8 @@
- # are safe.  This prevents _backtick_pwd() consulting $ENV{PATH}
+diff -u -r ../perl-5.22.0/dist/PathTools/Cwd.pm ./dist/PathTools/Cwd.pm
+--- ../perl-5.22.0/dist/PathTools/Cwd.pm       2015-05-13 16:19:29.000000000 -0400
++++ ./dist/PathTools/Cwd.pm    2015-08-30 13:34:33.445269291 -0400
+@@ -168,9 +168,8 @@
  # so everything works under taint mode.
  my $pwd_cmd;
--foreach my $try ('/bin/pwd',
--               '/usr/bin/pwd',
--               '/QOpenSys/bin/pwd', # OS/400 PASE.
-+foreach my $try ('@TERMUX_PREFIX@/bin/pwd',
-+               '@TERMUX_PREFIX@/bin/applets/pwd'
-               ) {
-     if( -x $try ) {
+ if($^O ne 'MSWin32') {
+-    foreach my $try ('/bin/pwd',
+-                   '/usr/bin/pwd',
+-                   '/QOpenSys/bin/pwd', # OS/400 PASE.
++    foreach my $try ('@TERMUX_PREFIX@/bin/applets/pwd',
++                   '@TERMUX_PREFIX@/bin/pwd'
+                   ) {
+       if( -x $try ) {
+           $pwd_cmd = $try;
index 3de2802..987b5f0 100644 (file)
@@ -1,14 +1,17 @@
 # This port uses perl-cross: http://arsv.github.io/perl-cross/index.html
 TERMUX_PKG_HOMEPAGE=http://www.perl.org/
 TERMUX_PKG_DESCRIPTION="Capable, feature-rich programming language"
-TERMUX_PKG_VERSION=5.20.2
+# cpan modules will require make:
+TERMUX_PKG_DEPENDS="make"
+TERMUX_PKG_VERSION=5.22.0
 TERMUX_PKG_SRCURL=http://www.cpan.org/src/5.0/perl-${TERMUX_PKG_VERSION}.tar.gz
 # Does not work with parallell builds:
 TERMUX_MAKE_PROCESSES=1
 TERMUX_PKG_RM_AFTER_INSTALL="bin/perl${TERMUX_PKG_VERSION}"
+TERMUX_PKG_BUILD_IN_SRC="yes"
 
 termux_step_post_extract_package () {
-       PERLCROSS_VERSION=0.9.6
+       PERLCROSS_VERSION=1.0.0
        PERLCROSS_FILE=perl-${TERMUX_PKG_VERSION}-cross-${PERLCROSS_VERSION}.tar.gz
        PERLCROSS_TAR=$TERMUX_PKG_CACHEDIR/$PERLCROSS_FILE
        test ! -f $PERLCROSS_TAR && curl -L https://raw.github.com/arsv/perl-cross/releases/$PERLCROSS_FILE > $PERLCROSS_TAR
@@ -36,12 +39,18 @@ termux_step_configure () {
        ORIG_RANLIB=$RANLIB; unset RANLIB
        ORIG_LD=$LD; unset LD
 
+       # Since we specify $TERMUX_PREFIX/bin/sh below for the shell
+       # it will be run during the build, so temporarily (removed in
+       # termux_step_post_make_install below) setup symlink:
+       rm -f $TERMUX_PREFIX/bin/sh
+       ln -s /bin/sh $TERMUX_PREFIX/bin/sh
+
        cd $TERMUX_PKG_BUILDDIR
        $TERMUX_PKG_SRCDIR/configure \
                --target=$TERMUX_HOST_PLATFORM \
                -Dsysroot=$TERMUX_STANDALONE_TOOLCHAIN/sysroot \
                -Dprefix=$TERMUX_PREFIX \
-               -Dsh=/system/bin/sh \
+               -Dsh=$TERMUX_PREFIX/bin/sh \
                -A ccflags="-specs=$TERMUX_SCRIPTDIR/termux.spec" \
                -A ldflags="-specs=$TERMUX_SCRIPTDIR/termux.spec"
 }
@@ -53,4 +62,11 @@ termux_step_post_make_install () {
        ln -s perlthanks.1 perlbug.1
        ln -s psed.1 s2p.1
        ln -s pstruct.1 c2ph.1
+
+       # Fix reference to termux.spec used only when cross compiling:
+       perl -p -i -e 's@-specs=/home/fornwall/dc/termux.spec@@g' $TERMUX_PREFIX/lib/perl5/*/*-linux/Config_heavy.pl
+
+       # lib/perl5/5.22.0/arm-linux/Config_heavy.pl
+       # Cleanup:
+       rm $TERMUX_PREFIX/bin/sh
 }
diff --git a/packages/perl/configure_func.sh.patch b/packages/perl/configure_func.sh.patch
new file mode 100644 (file)
index 0000000..7697d47
--- /dev/null
@@ -0,0 +1,13 @@
+diff -u -r ../perl-5.22.0/cnf/configure_func.sh ./cnf/configure_func.sh
+--- ../perl-5.22.0/cnf/configure_func.sh       2015-08-26 08:27:51.000000000 -0400
++++ ./cnf/configure_func.sh    2015-08-30 18:07:01.233675759 -0400
+@@ -260,7 +260,8 @@
+ check hasfunc shmdt
+ check hasfunc shmget
+ check hasfunc sigaction
+-check hasfunc signbit '.0' 'math.h'
++# Avoid using signbit only available on build machine:
++# check hasfunc signbit '.0' 'math.h'
+ check hasfunc sigprocmask
+ check hasfunc sigsetjmp "NULL,0" 'stdlib.h setjmp.h'
+ check hasfunc snprintf