Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions build/pari/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#!/usr/bin/bash
#
# {{{
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
# }}}
#
# OmniOS package for the PARI/GP computer algebra system
# Copyright 2025 David Stes
# NOTE: PARI from https://pari.math.u-bordeaux.fr is NOT covered by the OmniOS package copyright
# Files or logfiles derived from PARI are NOT covered by the OmniOS package copyright

. ../../lib/build.sh

PROG=pari
VER=2.17.3
PKG=ooce/library/math/pari
SUMMARY="PARI/GP"
DESC="Computer algebra system with the main aim of facilitating number theory computations"

OPREFIX=$PREFIX
PREFIX+=/$PROG

set_arch 64

# make target is gp
# check test target is dyntest-all
MAKE_TARGET=gp

# PARI/GP configure is not GNU autoconf
# set build style autoconf-like for prep-build
CONFIGURE_CMD=./Configure
# reset_configure_opts

# the PARI test script is in : src/test/dotest
# PARI measures with test-all diffs between static and dyn linked gp
# it prints timing information and checks for correctness
# the timing info could be useful but for our purpose remove/filter it from the testsuite.log
TESTSUITE_SED="
s/gp-sta..TIME=[ ]*[0-9]*//g
s/gp-dyn..TIME=[ ]*[0-9]*//g
/Total bench/d
"

# for dotest-env in testsuite
# if not set testsuite seems to report a bug and exit code nonzero
export AAA='XXX'
export BBB='YYY'

XFORM_ARGS="
-DOPREFIX=${OPREFIX#/}
-DPREFIX=${PREFIX#/}
-DPROG=$PROG
-DPKGROOT=$PROG
"

# build with GNU gmp
# could use an IPS mediator for selecting the native (non GNU gmp) arithmetic
# PARI/GP does not find gmp headers
# --with-gmp-lib=/usr/lib/amd64
CONFIGURE_OPTS[amd64]="
--prefix=$PREFIX
--bindir=$PREFIX/bin
--libdir=$PREFIX/lib/$arch
--with-readline
--mt=pthread
--with-gmp
--with-gmp-include=/usr/include/gmp
"

LDFLAGS[i386]+=" -R$OPREFIX/lib"
LDFLAGS[amd64]+=" -R$OPREFIX/lib/amd64"
LDFLAGS[i386]+=" -lssp_ns"

# create package functions
init
download_source $PROG $PROG $VER
patch_source
prep_build autoconf-like
build
strip_install
run_testsuite dyntest-all
make_package
clean_up

# Vim hints
# vim:ts=4:sw=4:et:fdm=marker
21 changes: 21 additions & 0 deletions build/pari/local.mog
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.

# Copyright 2025 David Stes
# NOTE: PARI from https://pari.math.u-bordeaux.fr is NOT covered by the OmniOS package copyright
# Files or logfiles derived from PARI are NOT covered by the OmniOS package copyright

license COPYING license=GPLv2

<transform path=$(PREFIX)/share/info -> drop>

<include binlink.mog>
<include manlink.mog>

11 changes: 11 additions & 0 deletions build/pari/patches/01-genfunclist.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- pari-2.13.3/config/genfunclist Wed Mar 25 12:58:26 2020
+++ p0/pari-2.13.3/config/genfunclist Mon Nov 22 15:52:15 2021
@@ -2,7 +2,7 @@
FL="$1"
DIR="$2"
TMPFL=$FL.tmp$$
-(cd $DIR && find ../functions -name CVS -prune -o -name '.*' -prune -o -name '*~' -prune -o -type f -print | env LANG= LC_COLLATE= LC_ALL= sort | xargs cksum ) > $TMPFL
+(cd $DIR && find ../functions -name CVS -prune -o -name '.*' -prune -o -name '*~' -prune -o -type l -print | env LANG= LC_COLLATE= LC_ALL= sort | xargs cksum ) > $TMPFL
if cmp $FL $TMPFL >/dev/null 2>&1; then
rm -f $TMPFL
else
11 changes: 11 additions & 0 deletions build/pari/patches/02-get_mt.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- pari-2.17.3/config/get_mt Tue Feb 27 22:12:25 2024
+++ p0/pari-2.17.3/config/get_mt Fri Dec 19 18:31:06 2025
@@ -3,7 +3,7 @@
case $thread_engine in
single);;
pthread)
- MT_LIBS="-lpthread"
+ MT_LIBS="" # with -lpthread unused object libpthread.so.1 warning
cmd="$CC $CFLAGS $extraflag -o $exe $file $MT_LIBS"
. log_cmd
if test -r $exe; then
1 change: 1 addition & 0 deletions build/pari/patches/series
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
02-get_mt.patch
Loading