From 52fcf6d53079890f1427fa96224fae480b3edc55 Mon Sep 17 00:00:00 2001 From: Lucy Phipps Date: Sat, 21 Aug 2021 16:12:02 +0100 Subject: [PATCH] new package: subversion-perl --- packages/perl/build.sh | 1 + packages/subversion/build.sh | 31 ++++++++++++++++++- .../subversion-perl-static.subpackage.sh | 3 ++ .../subversion/subversion-perl.subpackage.sh | 7 +++++ 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 packages/subversion/subversion-perl-static.subpackage.sh create mode 100644 packages/subversion/subversion-perl.subpackage.sh diff --git a/packages/perl/build.sh b/packages/perl/build.sh index f13b15a6a..0cd92c3fd 100644 --- a/packages/perl/build.sh +++ b/packages/perl/build.sh @@ -8,6 +8,7 @@ TERMUX_PKG_MAINTAINER="@termux" # - libapt-pkg-perl # - libregexp-assemble-perl # - psutils +# - subversion TERMUX_PKG_VERSION=(5.34.0 1.3.6) TERMUX_PKG_SHA256=(551efc818b968b05216024fb0b727ef2ad4c100f8cb6b43fab615fa78ae5be9a diff --git a/packages/subversion/build.sh b/packages/subversion/build.sh index 26f71990c..e0180e8db 100644 --- a/packages/subversion/build.sh +++ b/packages/subversion/build.sh @@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Centralized version control system characterized by its TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION=1.14.1 +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://www.apache.org/dist/subversion/subversion-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_SHA256=2c5da93c255d2e5569fa91d92457fdb65396b0666fad4fd59b22e154d986e1a9 TERMUX_PKG_DEPENDS="apr, apr-util, serf, libexpat, libsqlite, liblz4, utf8proc, zlib" @@ -15,5 +16,33 @@ svn_cv_pycfmt_apr_int64_t=UNUSED_REMOVE_AFTER_NEXT_UPDATE " termux_step_pre_configure() { - CFLAGS+=" -std=c11" + CFLAGS+=" -std=c11 -I$TERMUX_PREFIX/include/perl" + LDFLAGS+=" -lm -Wl,--as-needed" +} + +termux_step_post_make_install() { + make -j $TERMUX_MAKE_PROCESSES install-swig-pl-lib + + pushd subversion/bindings/swig/perl/native + # it's probably not needed to pass all flags to both perl and make + # but it works + PERL_MM_USE_DEFAULT=1 INSTALLDIRS=perl CC="$CC" LD="$CC" \ + OPTIMIZE="$CFLAGS" CFLAGS="$CFLAGS" CCFLAGS="$CFLAGS" \ + LDFLAGS="$LDFLAGS -lperl" LDDLFLAGS="-shared $CFLAGS $LDFLAGS" \ + perl Makefile.PL PREFIX="$TERMUX_PREFIX" + popd + + make PREFIX="$TERMUX_PREFIX" PERL_MM_USE_DEFAULT=1 INSTALLDIRS=perl \ + CC="$CC" LD="$CC" OPTIMIZE="$CFLAGS" CFLAGS="$CFLAGS" \ + CCFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS -lperl" \ + LDDLFLAGS="-shared $CFLAGS $LDFLAGS" install-swig-pl + + local perl_version=$(. $TERMUX_SCRIPTDIR/packages/perl/build.sh; echo $TERMUX_PKG_VERSION) + local host_perl_version=$(perl -e 'printf "%vd\n", $^V;') + + mkdir -p "$TERMUX_PREFIX/lib/perl5/site_perl/$perl_version" + mv "$TERMUX_PREFIX/lib/x86_64-linux-gnu/perl/${host_perl_version%.*}" \ + "$TERMUX_PREFIX/lib/perl5/site_perl/$perl_version/${TERMUX_ARCH}-android" + rmdir "$TERMUX_PREFIX/lib/x86_64-linux-gnu/perl/" + rmdir "$TERMUX_PREFIX/lib/x86_64-linux-gnu/" } diff --git a/packages/subversion/subversion-perl-static.subpackage.sh b/packages/subversion/subversion-perl-static.subpackage.sh new file mode 100644 index 000000000..541766ef8 --- /dev/null +++ b/packages/subversion/subversion-perl-static.subpackage.sh @@ -0,0 +1,3 @@ +TERMUX_SUBPKG_DESCRIPTION="Static libraries for subversion-perl" +TERMUX_SUBPKG_DEPENDS="subversion-perl" +TERMUX_SUBPKG_INCLUDE="lib/lib/libsvn_swig_perl*.a lib/lib/libsvn_swig_perl*.la" diff --git a/packages/subversion/subversion-perl.subpackage.sh b/packages/subversion/subversion-perl.subpackage.sh new file mode 100644 index 000000000..c58e422f9 --- /dev/null +++ b/packages/subversion/subversion-perl.subpackage.sh @@ -0,0 +1,7 @@ +TERMUX_SUBPKG_DESCRIPTION="Perl interface to Subversion" +TERMUX_SUBPKG_DEPENDS="perl" +TERMUX_SUBPKG_INCLUDE=" +lib/libsvn_swig_perl* +lib/perl5/ +share/man/man3/ +"