new package: pari

This commit is contained in:
Tee KOBAYASHI 2021-12-14 00:14:58 +09:00 committed by Leonid Pliushch
parent 85a1bf5469
commit 50b9308a9b
9 changed files with 143 additions and 0 deletions

28
packages/pari/build.sh Normal file
View File

@ -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*)"
}

View File

@ -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

View File

@ -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/ *,$//' |\

View File

@ -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!"

View File

@ -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=

View File

@ -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

View File

@ -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

View File

@ -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 ".";
}

View File

@ -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 */
{