2017-01-19 10:16:52 +01:00
|
|
|
TERMUX_PKG_HOMEPAGE=https://www.perl.org/
|
2015-06-13 01:03:31 +02:00
|
|
|
TERMUX_PKG_DESCRIPTION="Capable, feature-rich programming language"
|
2019-01-21 13:53:58 +01:00
|
|
|
TERMUX_PKG_LICENSE="Artistic-License-2.0"
|
2020-06-13 11:05:07 +02:00
|
|
|
# Packages which should be rebuilt after version change:
|
|
|
|
# - exiftool
|
|
|
|
# - irssi
|
2020-06-06 20:10:10 +02:00
|
|
|
TERMUX_PKG_VERSION=(5.30.3
|
|
|
|
1.3.4)
|
2020-06-07 02:41:32 +02:00
|
|
|
TERMUX_PKG_REVISION=1
|
2020-06-06 20:10:10 +02:00
|
|
|
TERMUX_PKG_SHA256=(32e04c8bb7b1aecb2742a7f7ac0eabac100f38247352a73ad7fa104e39e7406f
|
|
|
|
755aa0ca8141a942188a269564f86c3c82349f82c346ed5c992495d7f35138ba)
|
2018-06-13 02:15:26 +02:00
|
|
|
TERMUX_PKG_SRCURL=(http://www.cpan.org/src/5.0/perl-${TERMUX_PKG_VERSION}.tar.gz
|
2019-02-12 09:23:21 +01:00
|
|
|
https://github.com/arsv/perl-cross/releases/download/${TERMUX_PKG_VERSION[1]}/perl-cross-${TERMUX_PKG_VERSION[1]}.tar.gz)
|
2019-08-12 17:28:41 +02:00
|
|
|
TERMUX_PKG_BUILD_IN_SRC=true
|
2015-06-13 01:03:31 +02:00
|
|
|
TERMUX_MAKE_PROCESSES=1
|
|
|
|
TERMUX_PKG_RM_AFTER_INSTALL="bin/perl${TERMUX_PKG_VERSION}"
|
2017-03-08 18:32:40 +01:00
|
|
|
|
2019-02-08 10:37:29 +01:00
|
|
|
termux_step_post_extract_package() {
|
2019-08-08 14:25:54 +02:00
|
|
|
# Certain packages are not safe to build on device because their
|
|
|
|
# build.sh script deletes specific files in $TERMUX_PREFIX.
|
2019-08-12 17:28:41 +02:00
|
|
|
if $TERMUX_ON_DEVICE_BUILD; then
|
2019-08-08 14:25:54 +02:00
|
|
|
termux_error_exit "Package '$TERMUX_PKG_NAME' is not safe for on-device builds."
|
|
|
|
fi
|
|
|
|
|
2017-01-19 10:16:52 +01:00
|
|
|
# This port uses perl-cross: http://arsv.github.io/perl-cross/
|
2018-06-13 02:15:26 +02:00
|
|
|
cp -rf perl-cross-${TERMUX_PKG_VERSION[1]}/* .
|
2015-06-13 01:03:31 +02:00
|
|
|
|
|
|
|
# Remove old installation to force fresh:
|
|
|
|
rm -rf $TERMUX_PREFIX/lib/perl5
|
2018-06-13 02:15:26 +02:00
|
|
|
rm -f $TERMUX_PREFIX/lib/libperl.so
|
|
|
|
rm -f $TERMUX_PREFIX/include/perl
|
2015-06-13 01:03:31 +02:00
|
|
|
}
|
|
|
|
|
2019-02-08 10:37:29 +01:00
|
|
|
termux_step_configure() {
|
2017-01-19 10:16:52 +01:00
|
|
|
export PATH=$PATH:$TERMUX_STANDALONE_TOOLCHAIN/bin
|
2015-06-13 01:03:31 +02:00
|
|
|
|
|
|
|
ORIG_AR=$AR; unset AR
|
|
|
|
ORIG_AS=$AS; unset AS
|
|
|
|
ORIG_CC=$CC; unset CC
|
|
|
|
ORIG_CXX=$CXX; unset CXX
|
|
|
|
ORIG_CPP=$CPP; unset CPP
|
|
|
|
ORIG_CFLAGS=$CFLAGS; unset CFLAGS
|
|
|
|
ORIG_CPPFLAGS=$CPPFLAGS; unset CPPFLAGS
|
|
|
|
ORIG_CXXFLAGS=$CXXFLAGS; unset CXXFLAGS
|
|
|
|
ORIG_LDFLAGS=$LDFLAGS; unset LDFLAGS
|
|
|
|
ORIG_RANLIB=$RANLIB; unset RANLIB
|
|
|
|
ORIG_LD=$LD; unset LD
|
|
|
|
|
2015-08-31 02:35:01 +02:00
|
|
|
# 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
|
|
|
|
|
2015-06-13 01:03:31 +02:00
|
|
|
cd $TERMUX_PKG_BUILDDIR
|
|
|
|
$TERMUX_PKG_SRCDIR/configure \
|
|
|
|
--target=$TERMUX_HOST_PLATFORM \
|
2018-09-22 03:11:38 +02:00
|
|
|
-Dosname=android \
|
2015-06-13 01:03:31 +02:00
|
|
|
-Dsysroot=$TERMUX_STANDALONE_TOOLCHAIN/sysroot \
|
|
|
|
-Dprefix=$TERMUX_PREFIX \
|
2015-08-31 02:35:01 +02:00
|
|
|
-Dsh=$TERMUX_PREFIX/bin/sh \
|
2019-03-24 20:27:53 +01:00
|
|
|
-Dcc="$ORIG_CC -Wl,-rpath=$TERMUX_PREFIX/lib -Wl,--enable-new-dtags" \
|
2017-01-19 10:16:52 +01:00
|
|
|
-Duseshrplib
|
2015-06-13 01:03:31 +02:00
|
|
|
}
|
2015-07-09 03:21:45 +02:00
|
|
|
|
2019-02-08 10:37:29 +01:00
|
|
|
termux_step_post_make_install() {
|
2015-07-09 03:21:45 +02:00
|
|
|
# Replace hardlinks with symlinks:
|
|
|
|
cd $TERMUX_PREFIX/share/man/man1
|
2017-06-12 02:55:48 +02:00
|
|
|
rm perlbug.1
|
2015-07-09 03:21:45 +02:00
|
|
|
ln -s perlthanks.1 perlbug.1
|
2015-08-31 02:35:01 +02:00
|
|
|
|
|
|
|
# Cleanup:
|
|
|
|
rm $TERMUX_PREFIX/bin/sh
|
2016-04-22 09:25:16 +02:00
|
|
|
|
|
|
|
cd $TERMUX_PREFIX/lib
|
2018-09-22 03:11:38 +02:00
|
|
|
ln -f -s perl5/${TERMUX_PKG_VERSION}/${TERMUX_ARCH}-android/CORE/libperl.so libperl.so
|
2016-04-22 09:25:16 +02:00
|
|
|
|
|
|
|
cd $TERMUX_PREFIX/include
|
2018-09-22 03:11:38 +02:00
|
|
|
ln -f -s ../lib/perl5/${TERMUX_PKG_VERSION}/${TERMUX_ARCH}-android/CORE perl
|
|
|
|
cd ../lib/perl5/${TERMUX_PKG_VERSION}/${TERMUX_ARCH}-android/
|
2017-02-24 20:46:47 +01:00
|
|
|
chmod +w Config_heavy.pl
|
2019-09-19 23:44:47 +02:00
|
|
|
sed 's',"--sysroot=$TERMUX_STANDALONE_TOOLCHAIN"/sysroot,"-I${TERMUX_PREFIX}/include",'g' Config_heavy.pl > Config_heavy.pl.new
|
|
|
|
sed 's',"$TERMUX_STANDALONE_TOOLCHAIN"/sysroot,"-I${TERMUX_PREFIX%%/usr}",'g' Config_heavy.pl.new > Config_heavy.pl
|
2017-02-24 20:46:47 +01:00
|
|
|
rm Config_heavy.pl.new
|
2015-07-09 03:21:45 +02:00
|
|
|
}
|