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 FF |
4 | # cpan modules will require make: |
5 | TERMUX_PKG_DEPENDS="make" | |
704e64f2 | 6 | TERMUX_PKG_VERSION=5.22.1 |
59f0d218 FF |
7 | TERMUX_PKG_SRCURL=http://www.cpan.org/src/5.0/perl-${TERMUX_PKG_VERSION}.tar.gz |
8 | # Does not work with parallell builds: | |
9 | TERMUX_MAKE_PROCESSES=1 | |
10 | TERMUX_PKG_RM_AFTER_INSTALL="bin/perl${TERMUX_PKG_VERSION}" | |
aba4a7e0 | 11 | TERMUX_PKG_BUILD_IN_SRC="yes" |
59f0d218 FF |
12 | |
13 | termux_step_post_extract_package () { | |
704e64f2 | 14 | PERLCROSS_VERSION=1.0.2 |
59f0d218 FF |
15 | PERLCROSS_FILE=perl-${TERMUX_PKG_VERSION}-cross-${PERLCROSS_VERSION}.tar.gz |
16 | PERLCROSS_TAR=$TERMUX_PKG_CACHEDIR/$PERLCROSS_FILE | |
704e64f2 | 17 | test ! -f $PERLCROSS_TAR && curl -o $PERLCROSS_TAR -L https://github.com/arsv/perl-cross/releases/download/$PERLCROSS_VERSION/$PERLCROSS_FILE |
59f0d218 FF |
18 | cd $TERMUX_PKG_SRCDIR |
19 | tar xf $PERLCROSS_TAR | |
20 | cd perl-${TERMUX_PKG_VERSION} | |
21 | cp -Rf * ../ | |
22 | ||
23 | # Remove old installation to force fresh: | |
24 | rm -rf $TERMUX_PREFIX/lib/perl5 | |
25 | } | |
26 | ||
27 | termux_step_configure () { | |
28 | export PATH=$PATH:$TERMUX_STANDALONE_TOOLCHAIN/bin | |
29 | ||
30 | ORIG_AR=$AR; unset AR | |
31 | ORIG_AS=$AS; unset AS | |
32 | ORIG_CC=$CC; unset CC | |
33 | ORIG_CXX=$CXX; unset CXX | |
34 | ORIG_CPP=$CPP; unset CPP | |
35 | ORIG_CFLAGS=$CFLAGS; unset CFLAGS | |
36 | ORIG_CPPFLAGS=$CPPFLAGS; unset CPPFLAGS | |
37 | ORIG_CXXFLAGS=$CXXFLAGS; unset CXXFLAGS | |
38 | ORIG_LDFLAGS=$LDFLAGS; unset LDFLAGS | |
39 | ORIG_RANLIB=$RANLIB; unset RANLIB | |
40 | ORIG_LD=$LD; unset LD | |
41 | ||
aba4a7e0 FF |
42 | # Since we specify $TERMUX_PREFIX/bin/sh below for the shell |
43 | # it will be run during the build, so temporarily (removed in | |
44 | # termux_step_post_make_install below) setup symlink: | |
45 | rm -f $TERMUX_PREFIX/bin/sh | |
46 | ln -s /bin/sh $TERMUX_PREFIX/bin/sh | |
47 | ||
59f0d218 FF |
48 | cd $TERMUX_PKG_BUILDDIR |
49 | $TERMUX_PKG_SRCDIR/configure \ | |
50 | --target=$TERMUX_HOST_PLATFORM \ | |
51 | -Dsysroot=$TERMUX_STANDALONE_TOOLCHAIN/sysroot \ | |
52 | -Dprefix=$TERMUX_PREFIX \ | |
aba4a7e0 | 53 | -Dsh=$TERMUX_PREFIX/bin/sh \ |
59f0d218 FF |
54 | -A ccflags="-specs=$TERMUX_SCRIPTDIR/termux.spec" \ |
55 | -A ldflags="-specs=$TERMUX_SCRIPTDIR/termux.spec" | |
56 | } | |
9a9aaa90 FF |
57 | |
58 | termux_step_post_make_install () { | |
59 | # Replace hardlinks with symlinks: | |
60 | cd $TERMUX_PREFIX/share/man/man1 | |
37128d28 | 61 | rm {perlbug.1,c2ph.1} |
9a9aaa90 | 62 | ln -s perlthanks.1 perlbug.1 |
9a9aaa90 | 63 | ln -s pstruct.1 c2ph.1 |
aba4a7e0 FF |
64 | |
65 | # Fix reference to termux.spec used only when cross compiling: | |
66 | perl -p -i -e 's@-specs=/home/fornwall/dc/termux.spec@@g' $TERMUX_PREFIX/lib/perl5/*/*-linux/Config_heavy.pl | |
67 | ||
68 | # lib/perl5/5.22.0/arm-linux/Config_heavy.pl | |
69 | # Cleanup: | |
70 | rm $TERMUX_PREFIX/bin/sh | |
9a9aaa90 | 71 | } |