Hi,
Here a patch to upgrade math/pari from 2.1.6 to 2.7.1. It is a big
upgrade as 2.1.6 is something like 10 years old version.
- pari use a shared lib
- it (optionnally) depends of devel/gmp. I choose to explicitely depends
of it, as configure pick it by default, and pari's devel said it have
better performances. Could be reverted if need (or configure a flavor
?)
- build configuration at changed from one monolitic ./Configure script
to multiple snipset of file in ./config . I ported previous patch from
./Configure to new code in ./config when applicable.
- build optimization are removed by patch (as before)
- I have removed alpha specific patch from ./Configure in the previous
version, as I couldn't find any revelant code in new ./Configure.
- gphelp is patched in order to find good directory for documentation (a
RUN_DEPENDS should be added for full functionnality: it need xdvi from
print/texlive/base, but it may be a big dependency).
Tested on amd64.
--
Sébastien Marie
Index: Makefile
===================================================================
RCS file: /cvs/ports/math/pari/Makefile,v
retrieving revision 1.12
diff -u -p -r1.12 Makefile
--- Makefile 11 Mar 2013 11:23:56 -0000 1.12
+++ Makefile 10 Sep 2014 04:40:26 -0000
@@ -1,37 +1,44 @@
# $OpenBSD: Makefile,v 1.12 2013/03/11 11:23:56 espie Exp $
+SHARED_ONLY= Yes
+
COMMENT= number theory-oriented computer algebra system
-DISTNAME= pari-2.1.6
-REVISION= 2
-EXTRACT_SUFX= .tgz
+DISTNAME= pari-2.7.1
CATEGORIES= math
HOMEPAGE= http://pari.math.u-bordeaux.fr/
-# GPL
+# GPLv2+
PERMIT_PACKAGE_CDROM= Yes
-WANTLIB= X11 c m ncurses readline
+WANTLIB= X11 c m ncurses readline gmp
-MASTER_SITES= ${HOMEPAGE}/pub/pari/unix/
+MASTER_SITES= http://pari.math.u-bordeaux.fr/pub/pari/unix/
+LIB_DEPENDS= devel/gmp
BUILD_DEPENDS= print/texlive/base
-USE_GROFF = Yes
+USE_GMAKE= Yes
+
+SHARED_LIBS += pari-gmp 0.0 # 4.0
CONFIGURE_SCRIPT= Configure
CONFIGURE_STYLE= simple
-CONFIGURE_ENV= CFLAGS="${CFLAGS}"
+CONFIGURE_ENV= CC=${CC} \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}"
CONFIGURE_ARGS+= --datadir=${PREFIX}/share/pari \
- --miscdir=${PREFIX}/share/pari \
+ --mandir=${PREFIX}/man/man1 \
--prefix=${PREFIX} \
- --host=${ARCH}
+ --with-gmp
TEST_TARGET= dobench
+pre-configure:
+ ${SUBST_CMD} ${WRKSRC}/config/get_dlld
+
post-install:
mv ${PREFIX}/share/pari/doc ${PREFIX}/share/doc/pari
- mv ${PREFIX}/share/pari/[A-Z]* ${PREFIX}/share/doc/pari
mv ${PREFIX}/share/pari/examples ${PREFIX}/share/examples/pari
.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/math/pari/distinfo,v
retrieving revision 1.2
diff -u -p -r1.2 distinfo
--- distinfo 5 Apr 2007 16:20:06 -0000 1.2
+++ distinfo 10 Sep 2014 04:40:26 -0000
@@ -1,5 +1,2 @@
-MD5 (pari-2.1.6.tgz) = UGoGHI3N7DPRiHbzxVHpUQ==
-RMD160 (pari-2.1.6.tgz) = a3noS2OdGGLfFIslMTberNc79PA=
-SHA1 (pari-2.1.6.tgz) = VL1A+nCgLnbXjQ6hnA9W99pi3o4=
-SHA256 (pari-2.1.6.tgz) = YVBwBDLiy9CFZ66qYrL3+S81C4PyysjnR7HVgYg6Qic=
-SIZE (pari-2.1.6.tgz) = 1541464
+SHA256 (pari-2.7.1.tar.gz) = zGN5GPPAsg3Ju+qZ5jnnooi4nqTQ5OP5txEKEVvLQb4=
+SIZE (pari-2.7.1.tar.gz) = 3140893
Index: patches/patch-Configure
===================================================================
RCS file: patches/patch-Configure
diff -N patches/patch-Configure
--- patches/patch-Configure 30 Apr 2008 19:42:07 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,40 +0,0 @@
-$OpenBSD: patch-Configure,v 1.2 2008/04/30 19:42:07 naddy Exp $
---- Configure.orig Thu Nov 25 16:58:25 2004
-+++ Configure Mon Apr 28 20:14:36 2008
-@@ -844,7 +844,7 @@ if test -n "$__gnuc__"; then
- esac
- ;;
- esac
-- OPTFLAGS="$OPTFLAGS -DGCC_INLINE $warn"
-+ OPTFLAGS="$CFLAGS -DGCC_INLINE $warn"
- DBGFLAGS="-g $warn"
- # Some architectures need -fPIC for building dynamic lib
- case "$osname-$arch" in hpux-*) DLCFLAGS=-fPIC;; esac
-@@ -1006,7 +1006,7 @@ if test "$optimization" = profiling; then DLLD=; else
- # aix-*) DLSUFFIX=a ;; dynamic linking does not work!
- sunos-*) sodest=$VersionMajor$VersionMinor.$patch
- soname=$sodest;;
-- gnu-*|*-alpha|solaris-*|linux-*|freebsd-*)
-+ gnu-*|solaris-*|linux-*|freebsd-*)
- case $libpari_base in
- pari) sodest=$version.$patch;; # released versions
- *) sodest=$patch.0.0;; # unstable versions
-@@ -1044,10 +1044,6 @@ if test -n "$DLLD"; then
- freebsd-*) DLLDFLAGS="-Bshareable -x" ;;
- gnu-*|linux-*) DLLDFLAGS="-shared -soname \$(LIBPARI_SONAME)" ;;
- irix-*) DLLDFLAGS="-shared -elf -no_unresolved -all" ;;
-- *-alpha) DLLDFLAGS="-shared"; EXTRADLLDFLAGS='${LIBS}'
-- case "$optimization" in
-- full) DLLDFLAGS="$DLLDFLAGS -O3" ;;
-- esac;;
- sunos-*) DLLDFLAGS="-assert nodefinitions" ;;
- solaris-*) DLLDFLAGS="-G -h \$(LIBPARI_SONAME)" ;;
- *) DLLD=;;
-@@ -1159,7 +1155,6 @@ extra_flags=
- list=exp2; . ./look
- list=strftime; . ./look
- case "$arch" in
-- alpha) list='times ftime';; # gp-dyn has problems with getrusage
- *) case "$osname" in
- *cygwin*) list='times ftime';; # getrusage based timer always returns 0
- *) list='getrusage times ftime';;
Index: patches/patch-config_get_cc
===================================================================
RCS file: patches/patch-config_get_cc
diff -N patches/patch-config_get_cc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-config_get_cc 10 Sep 2014 04:40:26 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+Don't build with too specific optimizations
+
+--- config/get_cc.orig Tue Mar 25 09:59:21 2014
++++ config/get_cc Mon Sep 8 09:14:37 2014
+@@ -87,7 +87,7 @@ if test -n "$__gnuc__"; then
+ warn="-Wall"
+ OPTFLAGS=-O3
+ ASMINLINE=yes
+- OPTFLAGS="$OPTFLAGS $warn"
++ OPTFLAGS="$CFLAGS $warn"
+ cmd="$CC $CFLAGS $extraflag -fno-strict-aliasing -o $exe gnu.c"
+ . log_cmd
+ if test -s $exe; then
Index: patches/patch-config_get_dlld
===================================================================
RCS file: patches/patch-config_get_dlld
diff -N patches/patch-config_get_dlld
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-config_get_dlld 10 Sep 2014 04:40:26 -0000
@@ -0,0 +1,28 @@
+$OpenBSD$
+--- config/get_dlld.orig Tue Mar 25 09:59:21 2014
++++ config/get_dlld Mon Sep 8 15:19:54 2014
+@@ -27,6 +27,7 @@ case "$osname" in
+ fi;;
+ darwin)soname= ; sodest= ; DLSUFFIX=dylib;
+ compat_ver=$VersionMajor.$VersionMinor.0;
num_ver=$VersionMajor.$VersionMinor.$patch;;
++ openbsd) soname=.${LIBpari-gmp_VERSION}; sodest=.${LIBpari-gmp_VERSION};;
+ *) do_dll=no ;;
+ esac
+
+@@ -81,6 +82,7 @@ if test -n "$DLLD"; then
+ osf1) DLLDFLAGS='-shared' ;;
+ solaris) DLLDFLAGS="-G -h \$(LIBPARI_SONAME)" ;;
+ sunos) DLLDFLAGS='-assert nodefinitions' ;;
++ openbsd) DLLDFLAGS='-shared' ;;
+ os2) ;; # see below
+ linux) ;; # for e.g. the Portland Group cc (pgcc)
+ *) DLLD=;;
+@@ -107,7 +109,7 @@ if test -n "$DLLD"; then
+ fi
+ case "$osname" in
+ # Beware: will run through 'eval' [ hence ${...} instead of \$(...) ]
+- gnu*|cygwin|osf1|freebsd|linux|sunos|solaris) EXTRADLLDFLAGS='-lc
${LIBS}';;
++ gnu*|cygwin|osf1|freebsd|openbsd|linux|sunos|solaris) EXTRADLLDFLAGS='-lc
${LIBS}';;
+ esac
+
+ if test "$fastread" != yes; then
Index: patches/patch-config_get_ld
===================================================================
RCS file: patches/patch-config_get_ld
diff -N patches/patch-config_get_ld
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-config_get_ld 10 Sep 2014 04:40:26 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- config/get_ld.orig Sun Sep 7 19:24:32 2014
++++ config/get_ld Sun Sep 7 19:24:45 2014
+@@ -70,7 +70,7 @@ if test "$GNULDused" = yes; then
+ runpathprefix='-rpath '
+ else # guess...
+ case "$osname" in
+- gnu|osf1|linux|cygwin*|freebsd|netbsd) runpathprefix='-rpath ' ;;
++ gnu|osf1|linux|cygwin*|freebsd|netbsd|openbsd) runpathprefix='-rpath ' ;;
+ solaris) runpathprefix='-R ' ;;
+ hpux) runpathprefix='+b ' ;;
+ aix) runpathprefix='-blibpath:' ;;
Index: patches/patch-config_version
===================================================================
RCS file: patches/patch-config_version
diff -N patches/patch-config_version
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-config_version 10 Sep 2014 04:40:26 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- config/version.orig Mon Sep 8 11:46:57 2014
++++ config/version Mon Sep 8 11:47:14 2014
+@@ -32,7 +32,7 @@ version=$VersionMajor.$VersionMinor
+ pari_release="$version.$patch"
+ if test `expr $VersionMinor % 2` = 1; then
+ pari_release_verbose="$pari_release (STABLE)"
+- soname_num=`expr '(' $VersionMinor '+' 1 ')' / 2`
++ soname_num=${LIBpari_VERSION}
+ else
+ pari_release_verbose="$pari_release (DEVELOPMENT VERSION)"
+ soname_num=$patch
Index: patches/patch-doc_gphelp_in
===================================================================
RCS file: patches/patch-doc_gphelp_in
diff -N patches/patch-doc_gphelp_in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-doc_gphelp_in 10 Sep 2014 04:40:26 -0000
@@ -0,0 +1,21 @@
+$OpenBSD$
+--- doc/gphelp.in.orig Sat May 10 19:59:29 2014
++++ doc/gphelp.in Mon Sep 8 16:42:30 2014
+@@ -43,7 +43,7 @@
+ # GPXDVI: which 'xdvi' program to call (xdvi by default)
+ #
+ $version= "@version@";
+-$datadir= "@datadir@";
++$datadir= "@datadir@/../doc/pari";
+ # no expanded material (@key@) below
+ $wwwsite= "http://pari.math.u-bordeaux.fr/";
+
+@@ -53,7 +53,7 @@ $gzip = "gzip";
+ $zcat = "$gzip -dc";
+ $bzip = "bzip2";
+ $bzcat = "$bzip -dc";
+-$docdir = &get_docdir();
++$docdir = $datadir;
+ $tex = $ENV{GPTEX} || "tex";
+
+ $refcard = (@ARGV and $ARGV[-1] =~ /refcard/i);
Index: pkg/PFRAG.shared
===================================================================
RCS file: pkg/PFRAG.shared
diff -N pkg/PFRAG.shared
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pkg/PFRAG.shared 10 Sep 2014 04:40:26 -0000
@@ -0,0 +1,2 @@
+@comment $OpenBSD$
+lib/libpari.so
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/math/pari/pkg/PLIST,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 PLIST
--- pkg/PLIST 8 Feb 2005 02:36:12 -0000 1.1.1.1
+++ pkg/PLIST 10 Sep 2014 04:40:26 -0000
@@ -1,10 +1,12 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2005/02/08 02:36:12 msf Exp $
+%%SHARED%%
bin/gp
-bin/gp-2.1
+@bin bin/gp-2.7
bin/gphelp
bin/tex2mail
include/pari/
include/pari/genpari.h
+include/pari/mpinl.h
include/pari/pari.h
include/pari/paricast.h
include/pari/paricfg.h
@@ -13,33 +15,29 @@ include/pari/paridecl.h
include/pari/parierr.h
include/pari/parigen.h
include/pari/pariinl.h
-include/pari/pariport.h
+include/pari/parimt.h
+include/pari/parinf.h
+include/pari/pariold.h
+include/pari/paripriv.h
include/pari/paristio.h
include/pari/parisys.h
-include/pari/paritype.h
-lib/libpari.a
-@comment lib/libpari.a.2.1
+include/pari/paritune.h
+@lib lib/libpari-gmp.so.${LIBpari-gmp_VERSION}
+lib/pari/
+lib/pari/pari.cfg
+@man man/man1/gp-2.7.1
@man man/man1/gp.1
@man man/man1/gphelp.1
@man man/man1/pari.1
@man man/man1/tex2mail.1
share/doc/pari/
-share/doc/pari/AUTHORS
-share/doc/pari/Announce.2.1
-share/doc/pari/CHANGES
-share/doc/pari/COMPAT
-share/doc/pari/COPYING
-share/doc/pari/CVS.txt
-share/doc/pari/MACHINES
-share/doc/pari/Makefile
-share/doc/pari/NEW
-share/doc/pari/README
-share/doc/pari/TODO
share/doc/pari/appa.tex
share/doc/pari/appb.tex
-share/doc/pari/appc.tex
+share/doc/pari/appd.tex
+share/doc/pari/develop.dvi
+share/doc/pari/develop.tex
+share/doc/pari/libpari.dvi
share/doc/pari/paricfg.tex
-share/doc/pari/paricfg.tex.in
share/doc/pari/parimacro.tex
share/doc/pari/pdfmacs.tex
share/doc/pari/refcard.dvi
@@ -63,18 +61,19 @@ share/examples/pari/bench.gp
share/examples/pari/cl.gp
share/examples/pari/classno.gp
share/examples/pari/contfrac.gp
+share/examples/pari/extgcd.c
share/examples/pari/lucas.gp
-share/examples/pari/matexp.c
share/examples/pari/rho.gp
share/examples/pari/squfof.gp
share/examples/pari/taylor.gp
share/pari/
+share/pari/PARI/
+share/pari/PARI/822.pm
share/pari/misc/
share/pari/misc/README
share/pari/misc/color.dft
share/pari/misc/gpalias
share/pari/misc/gpflog
share/pari/misc/gprc.dft
-share/pari/misc/new.dic
-share/pari/misc/pari.xpm
share/pari/misc/xgp
+share/pari/pari.desc