From 50b9308a9b75a5bc5d93d9e0011394ccda74e08d Mon Sep 17 00:00:00 2001 From: Tee KOBAYASHI Date: Tue, 14 Dec 2021 00:14:58 +0900 Subject: [PATCH] new package: pari --- packages/pari/build.sh | 28 ++++++++++++++++++++ packages/pari/config-Makefile.SH.patch | 12 +++++++++ packages/pari/config-get_cc.patch | 20 ++++++++++++++ packages/pari/config-get_double_format.patch | 11 ++++++++ packages/pari/config-get_gmp.patch | 11 ++++++++ packages/pari/config-get_readline.patch | 11 ++++++++ packages/pari/config-paricfg.h.SH.patch | 26 ++++++++++++++++++ packages/pari/src-language-es.c.patch | 13 +++++++++ packages/pari/src-language-gplib.c.patch | 11 ++++++++ 9 files changed, 143 insertions(+) create mode 100644 packages/pari/build.sh create mode 100644 packages/pari/config-Makefile.SH.patch create mode 100644 packages/pari/config-get_cc.patch create mode 100644 packages/pari/config-get_double_format.patch create mode 100644 packages/pari/config-get_gmp.patch create mode 100644 packages/pari/config-get_readline.patch create mode 100644 packages/pari/config-paricfg.h.SH.patch create mode 100644 packages/pari/src-language-es.c.patch create mode 100644 packages/pari/src-language-gplib.c.patch diff --git a/packages/pari/build.sh b/packages/pari/build.sh new file mode 100644 index 000000000..c35ebfc59 --- /dev/null +++ b/packages/pari/build.sh @@ -0,0 +1,28 @@ +TERMUX_PKG_HOMEPAGE=https://pari.math.u-bordeaux.fr/ +TERMUX_PKG_DESCRIPTION="A computer algebra system designed for fast computations in number theory" +TERMUX_PKG_LICENSE="GPL-2.0" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION=2.13.3 +TERMUX_PKG_SRCURL=https://pari.math.u-bordeaux.fr/pub/pari/unix/pari-${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_SHA256=ccba7f1606c6854f1443637bb57ad0958d41c7f4753f8ae8459f1d64c267a1ca +TERMUX_PKG_DEPENDS="gzip, libgmp, readline" +TERMUX_PKG_BUILD_IN_SRC=true +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +--with-gmp=$TERMUX_PREFIX +--with-readline=$TERMUX_PREFIX +" + +termux_step_pre_configure() { + LD="$CC" + case $TERMUX_ARCH_BITS in + 32) PARI_DOUBLE_FORMAT=1 ;; + 64) PARI_DOUBLE_FORMAT=- ;; + esac + export PARI_DOUBLE_FORMAT +} + +termux_step_configure() { + ./Configure --prefix=$TERMUX_PREFIX --host=$TERMUX_HOST_PLATFORM \ + $TERMUX_PKG_EXTRA_CONFIGURE_ARGS + TERMUX_PKG_EXTRA_MAKE_ARGS="-C $(echo O*)" +} diff --git a/packages/pari/config-Makefile.SH.patch b/packages/pari/config-Makefile.SH.patch new file mode 100644 index 000000000..6b645fd3d --- /dev/null +++ b/packages/pari/config-Makefile.SH.patch @@ -0,0 +1,12 @@ +--- a/config/Makefile.SH ++++ b/config/Makefile.SH +@@ -130,8 +130,7 @@ + RUNPTH_FINAL= + RUNPTH= + if test -n "$runpathprefix"; then +- RUNPTH_FINAL=`$config_dir/ldflags "$LDneedsWl" $runpathprefix"$tmp"` +- RUNPTH=`$config_dir/ldflags "$LDneedsWl" $runpathprefix\\\$\(TOPDIR\)/$objdir$dir_sep"$tmp"` ++ : + fi + + if test -z "$DLLD"; then diff --git a/packages/pari/config-get_cc.patch b/packages/pari/config-get_cc.patch new file mode 100644 index 000000000..c15c1c731 --- /dev/null +++ b/packages/pari/config-get_cc.patch @@ -0,0 +1,20 @@ +--- a/config/get_cc ++++ b/config/get_cc +@@ -54,7 +54,7 @@ + cmd="$CC $CFLAGS $extraflag -o $exe ansi.c"; + . log_cmd + if test -s $exe; then +- $RUNTEST $exe ++ : + fi + if test $? != 0 -o ! -s $exe; then cat << EOT + ### +@@ -71,7 +71,7 @@ + exe=$osname-$arch-gnu$$$exe_suff + cmd="$CC $extraflag -o $exe gnu.c" + . log_cmd +- if $RUNTEST $exe; then ++ if true; then + # avoid internationalization trouble by setting LANG=C + __gnuc__=`env LANG=C LC_ALL=C LC_MESSAGES=C PATH="$PATH" $CC -v 2>&1 |\ + grep ' version ' | tr '\n' , | sed -e 's/ *,$//' |\ diff --git a/packages/pari/config-get_double_format.patch b/packages/pari/config-get_double_format.patch new file mode 100644 index 000000000..a83acbf37 --- /dev/null +++ b/packages/pari/config-get_double_format.patch @@ -0,0 +1,11 @@ +--- a/config/get_double_format ++++ b/config/get_double_format +@@ -1,7 +1,7 @@ + exe=$osname-$arch-endian$$$exe_suff + cmd="$CC $CFLAGS $extraflag endian.c -o $exe"; . log_cmd + if test -r $exe; then +- doubleformat=`$RUNTEST $exe`; ++ doubleformat=$PARI_DOUBLE_FORMAT; + else + echo "***************************************************************" + echo "Cannot compile endian.c. Aborting. PLEASE REPORT!" diff --git a/packages/pari/config-get_gmp.patch b/packages/pari/config-get_gmp.patch new file mode 100644 index 000000000..944da28c0 --- /dev/null +++ b/packages/pari/config-get_gmp.patch @@ -0,0 +1,11 @@ +--- a/config/get_gmp ++++ b/config/get_gmp +@@ -41,7 +41,7 @@ + fi + + if test -r $exe; then +- gmp_version=`env LD_LIBRARY_PATH="$LD_LIBRARY_PATH$dir_sep$gmp" $RUNTEST $exe`; ++ gmp_version=6.2.1; + fi + case "$gmp_version" in + unsupported) gmp= diff --git a/packages/pari/config-get_readline.patch b/packages/pari/config-get_readline.patch new file mode 100644 index 000000000..d9ea5290d --- /dev/null +++ b/packages/pari/config-get_readline.patch @@ -0,0 +1,11 @@ +--- a/config/get_readline ++++ b/config/get_readline +@@ -52,7 +52,7 @@ + + readline_version= + if test -r $exe; then +- readline_version=`env LD_LIBRARY_PATH="$LD_LIBRARY_PATH$dir_sep$readline" $RUNTEST $exe`; ++ readline_version=8.1; + fi + . cleanup_exe + diff --git a/packages/pari/config-paricfg.h.SH.patch b/packages/pari/config-paricfg.h.SH.patch new file mode 100644 index 000000000..07a07a4ab --- /dev/null +++ b/packages/pari/config-paricfg.h.SH.patch @@ -0,0 +1,26 @@ +--- a/config/paricfg.h.SH ++++ b/config/paricfg.h.SH +@@ -58,19 +58,19 @@ + echo '#define ASMINLINE' >> $file + fi + +-if test -n "$gzip"; then ++if test -n "@TERMUX_PREFIX@/bin/gzip"; then + cat >> $file << EOT + + /* Location of GNU gzip program (enables reading of .Z and .gz files). */ + #define GNUZCAT +-#define ZCAT "$gzip -dc" ++#define ZCAT "@TERMUX_PREFIX@/bin/gzip -dc" + + EOT +-else if test -n "$zcat"; then ++else if test -n "@TERMUX_PREFIX@/bin/zcat"; then + cat >> $file << EOT + + /* Location of zcat program (enables reading of .Z files). */ +-#define ZCAT "$zcat" ++#define ZCAT "@TERMUX_PREFIX@/bin/zcat" + + EOT + fi diff --git a/packages/pari/src-language-es.c.patch b/packages/pari/src-language-es.c.patch new file mode 100644 index 000000000..13453f46e --- /dev/null +++ b/packages/pari/src-language-es.c.patch @@ -0,0 +1,13 @@ +--- a/src/language/es.c ++++ b/src/language/es.c +@@ -4784,8 +4784,8 @@ pari_tmp_dir(void) + s = env_ok("TEMP"); if (s) return s; + #endif + #if defined(UNIX) || defined(__EMX__) +- if (pari_is_rwx("/tmp")) return "/tmp"; +- if (pari_is_rwx("/var/tmp")) return "/var/tmp"; ++ if (pari_is_rwx("@TERMUX_PREFIX@/tmp")) return "@TERMUX_PREFIX@/tmp"; ++ if (pari_is_rwx("@TERMUX_PREFIX@/var/tmp")) return "@TERMUX_PREFIX@/var/tmp"; + #endif + return "."; + } diff --git a/packages/pari/src-language-gplib.c.patch b/packages/pari/src-language-gplib.c.patch new file mode 100644 index 000000000..3de8b3d30 --- /dev/null +++ b/packages/pari/src-language-gplib.c.patch @@ -0,0 +1,11 @@ +--- a/src/language/gplib.c ++++ b/src/language/gplib.c +@@ -806,7 +806,7 @@ gprc_get(void) + f = gprc_chk(str); /* in $HOME */ + if (!f) f = gprc_chk(s); /* in . */ + #ifndef _WIN32 +- if (!f) f = gprc_chk("/etc/gprc"); ++ if (!f) f = gprc_chk("@TERMUX_PREFIX@/etc/gprc"); + #else + if (!f) /* in basedir */ + {