Commit | Line | Data |
---|---|---|
a0e9a636 | 1 | TERMUX_PKG_HOMEPAGE=https://www.perl.org/ |
59f0d218 | 2 | TERMUX_PKG_DESCRIPTION="Capable, feature-rich programming language" |
84a0ee4c | 3 | TERMUX_PKG_VERSION=5.24.1 |
0e2bd86d | 4 | TERMUX_PKG_REVISION=2 |
59f0d218 | 5 | TERMUX_PKG_SRCURL=http://www.cpan.org/src/5.0/perl-${TERMUX_PKG_VERSION}.tar.gz |
84a0ee4c | 6 | TERMUX_PKG_SHA256=e6c185c9b09bdb3f1b13f678999050c639859a7ef39c8cad418448075f5918af |
0e2bd86d | 7 | TERMUX_PKG_BUILD_IN_SRC="yes" |
59f0d218 FF |
8 | TERMUX_MAKE_PROCESSES=1 |
9 | TERMUX_PKG_RM_AFTER_INSTALL="bin/perl${TERMUX_PKG_VERSION}" | |
a3462cd1 | 10 | TERMUX_PKG_NO_DEVELSPLIT=yes |
0e2bd86d | 11 | |
59f0d218 | 12 | termux_step_post_extract_package () { |
a0e9a636 | 13 | # This port uses perl-cross: http://arsv.github.io/perl-cross/ |
cba558f6 | 14 | local PERLCROSS_VERSION=1.1.4 |
a0e9a636 FF |
15 | local PERLCROSS_FILE=perl-cross-${PERLCROSS_VERSION}.tar.gz |
16 | local PERLCROSS_TAR=$TERMUX_PKG_CACHEDIR/$PERLCROSS_FILE | |
17 | if [ ! -f $PERLCROSS_TAR ]; then | |
18 | termux_download https://github.com/arsv/perl-cross/releases/download/$PERLCROSS_VERSION/$PERLCROSS_FILE \ | |
19 | $PERLCROSS_TAR \ | |
cba558f6 | 20 | c840a327d5464ca271cac40d52e2d199330875527bf1003c28a6e550fb7bcc57 |
a0e9a636 | 21 | fi |
59f0d218 | 22 | tar xf $PERLCROSS_TAR |
a0e9a636 | 23 | cd perl-cross-${PERLCROSS_VERSION} |
59f0d218 FF |
24 | cp -Rf * ../ |
25 | ||
26 | # Remove old installation to force fresh: | |
27 | rm -rf $TERMUX_PREFIX/lib/perl5 | |
a02b0383 | 28 | |
a02b0383 FF |
29 | # Export variable used by Kid.pm.patch: |
30 | export TERMUX_PKG_SRCDIR | |
59f0d218 FF |
31 | } |
32 | ||
33 | termux_step_configure () { | |
a0e9a636 | 34 | export PATH=$PATH:$TERMUX_STANDALONE_TOOLCHAIN/bin |
59f0d218 FF |
35 | |
36 | ORIG_AR=$AR; unset AR | |
37 | ORIG_AS=$AS; unset AS | |
38 | ORIG_CC=$CC; unset CC | |
39 | ORIG_CXX=$CXX; unset CXX | |
40 | ORIG_CPP=$CPP; unset CPP | |
41 | ORIG_CFLAGS=$CFLAGS; unset CFLAGS | |
42 | ORIG_CPPFLAGS=$CPPFLAGS; unset CPPFLAGS | |
43 | ORIG_CXXFLAGS=$CXXFLAGS; unset CXXFLAGS | |
44 | ORIG_LDFLAGS=$LDFLAGS; unset LDFLAGS | |
45 | ORIG_RANLIB=$RANLIB; unset RANLIB | |
46 | ORIG_LD=$LD; unset LD | |
47 | ||
aba4a7e0 FF |
48 | # Since we specify $TERMUX_PREFIX/bin/sh below for the shell |
49 | # it will be run during the build, so temporarily (removed in | |
50 | # termux_step_post_make_install below) setup symlink: | |
51 | rm -f $TERMUX_PREFIX/bin/sh | |
52 | ln -s /bin/sh $TERMUX_PREFIX/bin/sh | |
53 | ||
59f0d218 FF |
54 | cd $TERMUX_PKG_BUILDDIR |
55 | $TERMUX_PKG_SRCDIR/configure \ | |
56 | --target=$TERMUX_HOST_PLATFORM \ | |
57 | -Dsysroot=$TERMUX_STANDALONE_TOOLCHAIN/sysroot \ | |
58 | -Dprefix=$TERMUX_PREFIX \ | |
aba4a7e0 | 59 | -Dsh=$TERMUX_PREFIX/bin/sh \ |
a0e9a636 FF |
60 | -Dcc=$ORIG_CC \ |
61 | -Duseshrplib | |
59f0d218 | 62 | } |
9a9aaa90 FF |
63 | |
64 | termux_step_post_make_install () { | |
65 | # Replace hardlinks with symlinks: | |
66 | cd $TERMUX_PREFIX/share/man/man1 | |
37128d28 | 67 | rm {perlbug.1,c2ph.1} |
9a9aaa90 | 68 | ln -s perlthanks.1 perlbug.1 |
9a9aaa90 | 69 | ln -s pstruct.1 c2ph.1 |
aba4a7e0 | 70 | |
aba4a7e0 FF |
71 | # Cleanup: |
72 | rm $TERMUX_PREFIX/bin/sh | |
a3462cd1 FF |
73 | |
74 | cd $TERMUX_PREFIX/lib | |
a0e9a636 | 75 | ln -f -s perl5/${TERMUX_PKG_VERSION}/${TERMUX_ARCH}-android/CORE/libperl.so libperl.so |
a3462cd1 FF |
76 | |
77 | cd $TERMUX_PREFIX/include | |
a0e9a636 | 78 | ln -f -s ../lib/perl5/${TERMUX_PKG_VERSION}/${TERMUX_ARCH}-android/CORE perl |
a7d4cb03 | 79 | cd ../lib/perl5/${TERMUX_PKG_VERSION}/${TERMUX_ARCH}-android/ |
80 | chmod +w Config_heavy.pl | |
81 | sed 's',"--sysroot=$TERMUX_STANDALONE_TOOLCHAIN"/sysroot,"-I/data/data/com.termux/files/usr/include",'g' Config_heavy.pl > Config_heavy.pl.new | |
82 | sed 's',"$TERMUX_STANDALONE_TOOLCHAIN"/sysroot,"-I/data/data/com.termux/files",'g' Config_heavy.pl.new > Config_heavy.pl | |
83 | rm Config_heavy.pl.new | |
9a9aaa90 | 84 | } |