Commit | Line | Data |
---|---|---|
59f0d218 FF |
1 | # This port uses perl-cross: http://arsv.github.io/perl-cross/index.html |
2 | TERMUX_PKG_HOMEPAGE=http://www.perl.org/ | |
3 | TERMUX_PKG_DESCRIPTION="Capable, feature-rich programming language" | |
aba4a7e0 | 4 | # cpan modules will require make: |
074699d8 | 5 | TERMUX_PKG_VERSION=5.24.0 |
59f0d218 FF |
6 | TERMUX_PKG_SRCURL=http://www.cpan.org/src/5.0/perl-${TERMUX_PKG_VERSION}.tar.gz |
7 | # Does not work with parallell builds: | |
8 | TERMUX_MAKE_PROCESSES=1 | |
9 | TERMUX_PKG_RM_AFTER_INSTALL="bin/perl${TERMUX_PKG_VERSION}" | |
aba4a7e0 | 10 | TERMUX_PKG_BUILD_IN_SRC="yes" |
a3462cd1 | 11 | TERMUX_PKG_NO_DEVELSPLIT=yes |
59f0d218 FF |
12 | |
13 | termux_step_post_extract_package () { | |
074699d8 FF |
14 | PERLCROSS_VERSION=1.0.3 |
15 | PERLCROSS_PERL_VERSION=5.24.0 | |
bb27a0ec | 16 | PERLCROSS_FILE=perl-${PERLCROSS_PERL_VERSION}-cross-${PERLCROSS_VERSION}.tar.gz |
59f0d218 | 17 | PERLCROSS_TAR=$TERMUX_PKG_CACHEDIR/$PERLCROSS_FILE |
704e64f2 | 18 | test ! -f $PERLCROSS_TAR && curl -o $PERLCROSS_TAR -L https://github.com/arsv/perl-cross/releases/download/$PERLCROSS_VERSION/$PERLCROSS_FILE |
59f0d218 FF |
19 | cd $TERMUX_PKG_SRCDIR |
20 | tar xf $PERLCROSS_TAR | |
bb27a0ec | 21 | cd perl-${PERLCROSS_PERL_VERSION} |
59f0d218 FF |
22 | cp -Rf * ../ |
23 | ||
24 | # Remove old installation to force fresh: | |
25 | rm -rf $TERMUX_PREFIX/lib/perl5 | |
a02b0383 FF |
26 | |
27 | # Remove patch from perl-cross for file we patch ourselves: | |
28 | rm $TERMUX_PKG_SRCDIR/cnf/diffs/liblist.patch | |
29 | # Export variable used by Kid.pm.patch: | |
30 | export TERMUX_PKG_SRCDIR | |
59f0d218 FF |
31 | } |
32 | ||
33 | termux_step_configure () { | |
34 | export PATH=$PATH:$TERMUX_STANDALONE_TOOLCHAIN/bin | |
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 \ |
a3462cd1 | 60 | -Duseshrplib \ |
59f0d218 FF |
61 | -A ccflags="-specs=$TERMUX_SCRIPTDIR/termux.spec" \ |
62 | -A ldflags="-specs=$TERMUX_SCRIPTDIR/termux.spec" | |
63 | } | |
9a9aaa90 FF |
64 | |
65 | termux_step_post_make_install () { | |
66 | # Replace hardlinks with symlinks: | |
67 | cd $TERMUX_PREFIX/share/man/man1 | |
37128d28 | 68 | rm {perlbug.1,c2ph.1} |
9a9aaa90 | 69 | ln -s perlthanks.1 perlbug.1 |
9a9aaa90 | 70 | ln -s pstruct.1 c2ph.1 |
aba4a7e0 FF |
71 | |
72 | # Fix reference to termux.spec used only when cross compiling: | |
73 | perl -p -i -e 's@-specs=/home/fornwall/dc/termux.spec@@g' $TERMUX_PREFIX/lib/perl5/*/*-linux/Config_heavy.pl | |
74 | ||
75 | # lib/perl5/5.22.0/arm-linux/Config_heavy.pl | |
76 | # Cleanup: | |
77 | rm $TERMUX_PREFIX/bin/sh | |
a3462cd1 FF |
78 | |
79 | cd $TERMUX_PREFIX/lib | |
80 | ln -f -s perl5/${TERMUX_PKG_VERSION}/${TERMUX_ARCH}-linux/CORE/libperl.so libperl.so | |
81 | ||
82 | cd $TERMUX_PREFIX/include | |
83 | ln -f -s ../lib/perl5/${TERMUX_PKG_VERSION}/${TERMUX_ARCH}-linux/CORE perl | |
9a9aaa90 | 84 | } |