Browse Source

perl: Cleanup build (fixes #669)

android-5
Fredrik Fornwall 8 years ago
parent
commit
a0e9a6368f
  1. 16
      packages/perl/Kid.pm.patch
  2. 37
      packages/perl/build.sh
  3. 13
      packages/perl/configure_func.sh.patch

16
packages/perl/Kid.pm.patch

@ -1,16 +0,0 @@
diff -u -r ../perl-5.22.1/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm ./cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
--- ../perl-5.22.1/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm 2015-10-17 08:38:37.000000000 -0400
+++ ./cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm 2016-04-22 18:38:59.367520265 -0400
@@ -19,9 +19,9 @@
use File::Spec;
sub ext {
- if ( $^O eq 'VMS' ) { return &_vms_ext; }
- elsif ( $^O eq 'MSWin32' ) { return &_win32_ext; }
- else { return &_unix_os2_ext; }
+ # Termux modification to work with android linker.
+ my $res = $Config{perllibs} . " -L" . $ENV{'TERMUX_PKG_SRCDIR'} . " -lperl";
+ return ( $res, '', $res, '' );
}
sub _unix_os2_ext {

37
packages/perl/build.sh

@ -1,9 +1,9 @@
# This port uses perl-cross: http://arsv.github.io/perl-cross/index.html TERMUX_PKG_HOMEPAGE=https://www.perl.org/
TERMUX_PKG_HOMEPAGE=http://www.perl.org/
TERMUX_PKG_DESCRIPTION="Capable, feature-rich programming language" TERMUX_PKG_DESCRIPTION="Capable, feature-rich programming language"
# cpan modules will require make: # cpan modules will require make:
TERMUX_PKG_VERSION=5.24.0 TERMUX_PKG_VERSION=5.24.0
TERMUX_PKG_SRCURL=http://www.cpan.org/src/5.0/perl-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SRCURL=http://www.cpan.org/src/5.0/perl-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=7e430c6e0e0d9017c3f72898850dea657fa6b51909220a7bcf305a87f2475202
# Does not work with parallell builds: # Does not work with parallell builds:
TERMUX_MAKE_PROCESSES=1 TERMUX_MAKE_PROCESSES=1
TERMUX_PKG_RM_AFTER_INSTALL="bin/perl${TERMUX_PKG_VERSION}" TERMUX_PKG_RM_AFTER_INSTALL="bin/perl${TERMUX_PKG_VERSION}"
@ -11,26 +11,28 @@ TERMUX_PKG_BUILD_IN_SRC="yes"
TERMUX_PKG_NO_DEVELSPLIT=yes TERMUX_PKG_NO_DEVELSPLIT=yes
termux_step_post_extract_package () { termux_step_post_extract_package () {
PERLCROSS_VERSION=1.0.3 # This port uses perl-cross: http://arsv.github.io/perl-cross/
PERLCROSS_PERL_VERSION=5.24.0 local PERLCROSS_VERSION=1.1.2
PERLCROSS_FILE=perl-${PERLCROSS_PERL_VERSION}-cross-${PERLCROSS_VERSION}.tar.gz local PERLCROSS_FILE=perl-cross-${PERLCROSS_VERSION}.tar.gz
PERLCROSS_TAR=$TERMUX_PKG_CACHEDIR/$PERLCROSS_FILE local PERLCROSS_TAR=$TERMUX_PKG_CACHEDIR/$PERLCROSS_FILE
test ! -f $PERLCROSS_TAR && curl -o $PERLCROSS_TAR -L https://github.com/arsv/perl-cross/releases/download/$PERLCROSS_VERSION/$PERLCROSS_FILE if [ ! -f $PERLCROSS_TAR ]; then
termux_download https://github.com/arsv/perl-cross/releases/download/$PERLCROSS_VERSION/$PERLCROSS_FILE \
$PERLCROSS_TAR \
2a1b0a3ffe866bc3fd32c947c0a866360d2f26576c8f1c5c0b521d3a6e9d643d
fi
tar xf $PERLCROSS_TAR tar xf $PERLCROSS_TAR
cd perl-${PERLCROSS_PERL_VERSION} cd perl-cross-${PERLCROSS_VERSION}
cp -Rf * ../ cp -Rf * ../
# Remove old installation to force fresh: # Remove old installation to force fresh:
rm -rf $TERMUX_PREFIX/lib/perl5 rm -rf $TERMUX_PREFIX/lib/perl5
# Remove patch from perl-cross for file we patch ourselves:
rm $TERMUX_PKG_SRCDIR/cnf/diffs/liblist.patch
# Export variable used by Kid.pm.patch: # Export variable used by Kid.pm.patch:
export TERMUX_PKG_SRCDIR export TERMUX_PKG_SRCDIR
} }
termux_step_configure () { termux_step_configure () {
export PATH=$PATH:$TERMUX_STANDALONE_TOOLCHAIN/bin export PATH=$PATH:$TERMUX_STANDALONE_TOOLCHAIN/bin
ORIG_AR=$AR; unset AR ORIG_AR=$AR; unset AR
ORIG_AS=$AS; unset AS ORIG_AS=$AS; unset AS
@ -56,9 +58,8 @@ termux_step_configure () {
-Dsysroot=$TERMUX_STANDALONE_TOOLCHAIN/sysroot \ -Dsysroot=$TERMUX_STANDALONE_TOOLCHAIN/sysroot \
-Dprefix=$TERMUX_PREFIX \ -Dprefix=$TERMUX_PREFIX \
-Dsh=$TERMUX_PREFIX/bin/sh \ -Dsh=$TERMUX_PREFIX/bin/sh \
-Duseshrplib \ -Dcc=$ORIG_CC \
-A ccflags="-specs=$TERMUX_SCRIPTDIR/termux.spec" \ -Duseshrplib
-A ldflags="-specs=$TERMUX_SCRIPTDIR/termux.spec"
} }
termux_step_post_make_install () { termux_step_post_make_install () {
@ -68,16 +69,12 @@ termux_step_post_make_install () {
ln -s perlthanks.1 perlbug.1 ln -s perlthanks.1 perlbug.1
ln -s pstruct.1 c2ph.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: # Cleanup:
rm $TERMUX_PREFIX/bin/sh rm $TERMUX_PREFIX/bin/sh
cd $TERMUX_PREFIX/lib cd $TERMUX_PREFIX/lib
ln -f -s perl5/${TERMUX_PKG_VERSION}/${TERMUX_ARCH}-linux/CORE/libperl.so libperl.so ln -f -s perl5/${TERMUX_PKG_VERSION}/${TERMUX_ARCH}-android/CORE/libperl.so libperl.so
cd $TERMUX_PREFIX/include cd $TERMUX_PREFIX/include
ln -f -s ../lib/perl5/${TERMUX_PKG_VERSION}/${TERMUX_ARCH}-linux/CORE perl ln -f -s ../lib/perl5/${TERMUX_PKG_VERSION}/${TERMUX_ARCH}-android/CORE perl
} }

13
packages/perl/configure_func.sh.patch

@ -1,13 +0,0 @@
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
Loading…
Cancel
Save