summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Fabbro <bicatali@gentoo.org>2010-05-04 21:56:10 +0000
committerSebastien Fabbro <bicatali@gentoo.org>2010-05-04 21:56:10 +0000
commit092496bcb6678d48aa8f2d44e516fb09806a78f5 (patch)
tree0175bb011dd1a2be68e74208f353d58abb307302 /sci-mathematics/pari
parentremove unused use flag (diff)
downloadgentoo-2-092496bcb6678d48aa8f2d44e516fb09806a78f5.tar.gz
gentoo-2-092496bcb6678d48aa8f2d44e516fb09806a78f5.tar.bz2
gentoo-2-092496bcb6678d48aa8f2d44e516fb09806a78f5.zip
Version bump. Added -fno-strict-aliasing to compiler flags, per bug #316139. Change use flag static to static-libs
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'sci-mathematics/pari')
-rw-r--r--sci-mathematics/pari/ChangeLog11
-rw-r--r--sci-mathematics/pari/files/docs.patch30
-rw-r--r--sci-mathematics/pari/files/pari-non-exec-stack-x86-gentoo.patch11
-rw-r--r--sci-mathematics/pari/files/wrong_functype-r1.patch35
-rw-r--r--sci-mathematics/pari/files/wrong_functype.patch48
-rw-r--r--sci-mathematics/pari/pari-2.1.6.ebuild87
-rw-r--r--sci-mathematics/pari/pari-2.1.7-r1.ebuild95
-rw-r--r--sci-mathematics/pari/pari-2.3.4-r1.ebuild13
-rw-r--r--sci-mathematics/pari/pari-2.3.5.ebuild159
9 files changed, 176 insertions, 313 deletions
diff --git a/sci-mathematics/pari/ChangeLog b/sci-mathematics/pari/ChangeLog
index 866b5d0bea0f..bee19ee56fc3 100644
--- a/sci-mathematics/pari/ChangeLog
+++ b/sci-mathematics/pari/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for sci-mathematics/pari
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/pari/ChangeLog,v 1.74 2010/01/11 22:38:57 jer Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/pari/ChangeLog,v 1.75 2010/05/04 21:56:09 bicatali Exp $
+
+*pari-2.3.5 (04 May 2010)
+
+ 04 May 2010; Sébastien Fabbro <bicatali@gentoo.org> -pari-2.1.6.ebuild,
+ -pari-2.1.7-r1.ebuild, pari-2.3.4-r1.ebuild, +pari-2.3.5.ebuild,
+ -files/docs.patch, -files/pari-non-exec-stack-x86-gentoo.patch,
+ -files/wrong_functype.patch, -files/wrong_functype-r1.patch:
+ Version bump. Added -fno-strict-aliasing to compiler flags, per bug
+ #316139. Change use flag static to static-libs
11 Jan 2010; Jeroen Roovers <jer@gentoo.org> pari-2.3.4-r1.ebuild:
Reintroduce CC so for instance distcc will not say "...gcc is
diff --git a/sci-mathematics/pari/files/docs.patch b/sci-mathematics/pari/files/docs.patch
deleted file mode 100644
index 1a5b251b41d7..000000000000
--- a/sci-mathematics/pari/files/docs.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-*** doc/refcard.tex Mon Nov 6 19:59:00 2000
---- doc/refcard.tex.new Tue Jun 24 03:07:15 2003
-***************
-*** 17,23 ****
---- 17,29 ----
- %% which I modified from his GNU emacs reference card
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- \def\TITLE{Pari-GP reference card}
-+ % ignore parimacro.tex's \magnification setting
-+ \let\oldmagnification\magnification
-+ \catcode`@=11
-+ \def\magnification{\afterassignment\relax\count@}%
-+ \catcode`@=12
- \input parimacro.tex
-+ \let\magnification\oldmagnification
- \ifPDF
- \input pdfmacs.tex
- \pdfpagewidth=11.69in
-*** doc/users.tex Mon Nov 6 19:59:01 2000
---- doc/users.tex.new Tue Jun 24 03:07:15 2003
-***************
-*** 63,69 ****
- \ifPDF \writesecnumbers \fi
- \expandafter\end % stop here the first time (don't process index)
- \fi
-- \newpage
-
- \ifPDF
- % Add a bookmark entry for the index. CHB
---- 63,68 ----
diff --git a/sci-mathematics/pari/files/pari-non-exec-stack-x86-gentoo.patch b/sci-mathematics/pari/files/pari-non-exec-stack-x86-gentoo.patch
deleted file mode 100644
index a3ee992b8859..000000000000
--- a/sci-mathematics/pari/files/pari-non-exec-stack-x86-gentoo.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -Naur pari-2.1.7-old/src/kernel/ix86/l0asm.c pari-2.1.7/src/kernel/ix86/l0asm.c
---- pari-2.1.7-old/src/kernel/ix86/l0asm.c 2002-04-06 12:14:02.000000000 +0000
-+++ pari-2.1.7/src/kernel/ix86/l0asm.c 2006-01-19 19:22:49.000000000 +0000
-@@ -206,3 +206,7 @@
- FUNEND()
-
- ALIGN
-+
-+#ifdef __ELF__
-+ .section .note.GNU-stack,"",@progbits
-+#endif
diff --git a/sci-mathematics/pari/files/wrong_functype-r1.patch b/sci-mathematics/pari/files/wrong_functype-r1.patch
deleted file mode 100644
index 5eb95e622c7a..000000000000
--- a/sci-mathematics/pari/files/wrong_functype-r1.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff -ru src/gp/gp_rl.c src.new/gp/gp_rl.c
---- src/gp/gp_rl.c 2001-04-27 15:55:38.000000000 +0200
-+++ src.new/gp/gp_rl.c 2005-01-06 11:04:45.198086689 +0100
-@@ -79,11 +79,13 @@
- #endif
-
- #ifdef HAS_RL_COMPLETION_MATCHES
--# define COMPLETION_MATCHES ((CF)rl_completion_matches)
-+# define COMPLETION_MATCHES(a,b) \
-+ (completion_matches((char *)(a),(b)))
- # define FILE_COMPLETION ((GF)rl_filename_completion_function)
- # define USER_COMPLETION ((GF)rl_username_completion_function)
- #else
--# define COMPLETION_MATCHES ((CF)completion_matches)
-+# define COMPLETION_MATCHES(a,b) \
-+ (completion_matches((char *)(a),(b)))
- # define FILE_COMPLETION ((GF)filename_completion_function)
- # define USER_COMPLETION ((GF)username_completion_function)
- #endif
-diff -ru src.old/gp/gp_rl.c src/gp/gp_rl.c
---- src.old/gp/gp_rl.c 2005-01-06 11:07:18.000000000 +0100
-+++ src/gp/gp_rl.c 2005-01-06 11:15:10.509112328 +0100
-@@ -625,10 +625,8 @@
- /* we always want the whole list of completions under emacs */
- if (under_emacs) rl_completion_query_items = 0x8fff;
-
--#define Bind(a,b,c) (((void(*)(int,Function*,Keymap)) rl_bind_key_in_map)\
-- ((a), (Function*)(b), (c)))
--#define Defun(a,b,c) (((void(*)(const char*,Function*,int)) rl_add_defun)\
-- ((a), (Function*)(b), (c)))
-+#define Bind(a,b,c) (rl_bind_key_in_map((a), (Function*)(b), (c)))
-+#define Defun(a,b,c) (rl_add_defun((char*)(a), (Function*)(b), (c)))
-
- Defun("short-help", rl_short_help, -1);
- Defun("long-help", rl_long_help, -1);
diff --git a/sci-mathematics/pari/files/wrong_functype.patch b/sci-mathematics/pari/files/wrong_functype.patch
deleted file mode 100644
index a1dd4c98fe0a..000000000000
--- a/sci-mathematics/pari/files/wrong_functype.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-diff -ru src/gp/gp_rl.c src.new/gp/gp_rl.c
---- src/gp/gp_rl.c 2001-04-27 15:55:38.000000000 +0200
-+++ src.new/gp/gp_rl.c 2005-01-06 11:04:45.198086689 +0100
-@@ -79,11 +79,13 @@
- #endif
-
- #ifdef HAS_RL_COMPLETION_MATCHES
--# define COMPLETION_MATCHES ((CF)rl_completion_matches)
-+# define COMPLETION_MATCHES(a,b) \
-+ (completion_matches((char *)(a),(b)))
- # define FILE_COMPLETION ((GF)rl_filename_completion_function)
- # define USER_COMPLETION ((GF)rl_username_completion_function)
- #else
--# define COMPLETION_MATCHES ((CF)completion_matches)
-+# define COMPLETION_MATCHES(a,b) \
-+ (completion_matches((char *)(a),(b)))
- # define FILE_COMPLETION ((GF)filename_completion_function)
- # define USER_COMPLETION ((GF)username_completion_function)
- #endif
-diff -ru src.old/gp/gp_rl.c src/gp/gp_rl.c
---- src.old/gp/gp_rl.c 2005-01-06 11:07:18.000000000 +0100
-+++ src/gp/gp_rl.c 2005-01-06 11:15:10.509112328 +0100
-@@ -625,10 +625,8 @@
- /* we always want the whole list of completions under emacs */
- if (under_emacs) rl_completion_query_items = 0x8fff;
-
--#define Bind(a,b,c) (((void(*)(int,Function*,Keymap)) rl_bind_key_in_map)\
-- ((a), (Function*)(b), (c)))
--#define Defun(a,b,c) (((void(*)(const char*,Function*,int)) rl_add_defun)\
-- ((a), (Function*)(b), (c)))
-+#define Bind(a,b,c) (rl_bind_key_in_map((a), (Function*)(b), (c)))
-+#define Defun(a,b,c) (rl_add_defun((char*)(a), (Function*)(b), (c)))
-
- Defun("short-help", rl_short_help, -1);
- Defun("long-help", rl_long_help, -1);
-diff -ru src-old/basemath/buch2.c src/basemath/buch2.c
---- src-old/basemath/buch2.c 2001-11-04 15:09:54.000000000 +0100
-+++ src/basemath/buch2.c 2005-01-07 10:08:25.442785391 +0100
-@@ -2922,7 +2922,8 @@
-
- /* random relations */
- if (cglob == KCCO) /* enough relations, initialize nevertheless */
-- ((void(*)(long))random_relation)(-1);
-+ random_relation(-1,0,0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-+
- else
- {
- GEN maarch;
diff --git a/sci-mathematics/pari/pari-2.1.6.ebuild b/sci-mathematics/pari/pari-2.1.6.ebuild
deleted file mode 100644
index 0bf5ea4f092d..000000000000
--- a/sci-mathematics/pari/pari-2.1.6.ebuild
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright 1999-2008 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/pari/pari-2.1.6.ebuild,v 1.17 2008/05/18 11:40:06 markusle Exp $
-
-inherit eutils toolchain-funcs flag-o-matic
-
-DESCRIPTION="pari (or pari-gp) : a software package for computer-aided number theory"
-HOMEPAGE="http://pari.math.u-bordeaux.fr/"
-SRC_URI="http://pari.math.u-bordeaux.fr/pub/${PN}/unix/OLD/${P}.tgz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="alpha amd64 hppa mips ppc ~sparc x86"
-IUSE="doc emacs"
-
-DEPEND="doc? ( virtual/latex-base )"
-
-src_unpack() {
- unpack ${A}
- cd "${S}"
- epatch "${FILESDIR}"/docs.patch
- epatch "${FILESDIR}"/wrong_functype-r1.patch
-}
-
-src_compile() {
- # Fix usage of toolchain
- tc-getAS; tc-getLD; tc-getCC; tc-getCXX
-
- # Special handling for sparc
- local myhost
- [ "${PROFILE_ARCH}" == "sparc64" ] && myhost="sparc64-linux" \
- || myhost="$(echo ${CHOST} | cut -f "1 3" -d '-')"
- einfo "Building for ${myhost}"
-
- #need to force optimization here, as it breaks without
- if is-flag -O0; then
- replace-flags -O0 -O2
- elif ! is-flag -O?; then
- append-flags -O2
- fi
- #we also need to force -fPIC on amd64
- if [ "${ARCH}" = "amd64" ] && ! is-flag -fPIC; then append-flags -fPIC; fi
-
- ./Configure \
- --host=${myhost} \
- --prefix=/usr \
- --miscdir=/usr/share/doc/${PF} \
- --datadir=/usr/share/${P} \
- --libdir=/usr/$(get_libdir) \
- --mandir=/usr/share/man/man1 || die "./configure failed"
- addwrite "/var/lib/texmf"
- addwrite "/usr/share/texmf"
- addwrite "/var/cache/fonts"
-
- if use hppa
- then
- mymake=DLLD\=/usr/bin/gcc\ DLLDFLAGS\=-shared\ -Wl,-soname=\$\(LIBPARI_SONAME\)\ -lm
- fi
-
- # Shared libraries should be PIC on ALL architectures.
- # Danny van Dyk <kugelfang@gentoo.org> 2005/03/31
- # Fixes BUG #49583
- einfo "Building shared library..."
- cd Olinux-* || die "Bad directory. File a BUG!"
- emake ${mymake} CFLAGS="${CFLAGS} -DGCC_INLINE -fPIC" lib-dyn || die "Building shared library failed!"
-
- einfo "Building executables..."
- emake ${mymake} CFLAGS="${CFLAGS} -DGCC_INLINE" gp ../gp || die "Building executables failed!"
-
- use doc || rm -rf doc/*.tex
- use doc && emake doc
-}
-
-src_test() {
- ebegin "Testing pari kernel"
- make CFLAGS="-Wl,-lpari" test-kernel > /dev/null
- eend $?
-}
-
-src_install() {
- make DESTDIR="${D}" LIBDIR="${D}"/usr/$(get_libdir) install || die
- if use emacs; then
- insinto /usr/share/emacs/site-lisp
- doins emacs/pari.el
- fi
- dodoc AUTHORS Announce.2.1 CHANGES README TODO
-}
diff --git a/sci-mathematics/pari/pari-2.1.7-r1.ebuild b/sci-mathematics/pari/pari-2.1.7-r1.ebuild
deleted file mode 100644
index 4e71cb3124a1..000000000000
--- a/sci-mathematics/pari/pari-2.1.7-r1.ebuild
+++ /dev/null
@@ -1,95 +0,0 @@
-# Copyright 1999-2008 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/pari/pari-2.1.7-r1.ebuild,v 1.11 2008/05/18 11:40:06 markusle Exp $
-
-inherit eutils toolchain-funcs flag-o-matic
-
-DESCRIPTION="pari (or pari-gp) : a software package for computer-aided number theory"
-HOMEPAGE="http://pari.math.u-bordeaux.fr/"
-SRC_URI="http://pari.math.u-bordeaux.fr/pub/pari/unix/OLD/${P}.tgz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="alpha amd64 hppa ~mips ppc ppc64 sparc x86"
-IUSE="doc emacs"
-
-DEPEND="doc? ( virtual/latex-base )"
-
-src_unpack() {
- unpack ${A}
- cd "${S}"
- epatch "${FILESDIR}"/docs.patch
-
- # remove exec stacks for x86; see bug #117434
- epatch "${FILESDIR}"/pari-non-exec-stack-x86-gentoo.patch
-}
-
-src_compile() {
- # Fix usage of toolchain
- tc-getAS; tc-getLD; tc-getCC; tc-getCXX
-
- # Special handling for sparc
- local myhost
- [ "${PROFILE_ARCH}" == "sparc64" ] && myhost="sparc64-linux" \
- || myhost="$(echo ${CHOST} | cut -f "1 3" -d '-')"
- einfo "Building for ${myhost}"
-
- #need to force optimization here, as it breaks without
- if is-flag -O0; then
- replace-flags -O0 -O2
- elif ! is-flag -O?; then
- append-flags -O2
- fi
-
- # fix up build scripts to get rid of insecure RUNPATHS
- # see bug #117434
- sed -e "s|\$runpathprefix \$TOP/\$objdir:\$tmp||" \
- -e "s|\$runpathprefix \$tmp||" -i config/Makefile.SH || \
- die "Failed to fix Makefile.SH"
- sed -e "s|-L\$libdir|-L./|" -i Configure || \
- die "Failed to fix Configure"
-
- ./Configure \
- --host=${myhost} \
- --prefix=/usr \
- --miscdir=/usr/share/doc/${PF} \
- --datadir=/usr/share/${P} \
- --libdir=/usr/$(get_libdir) \
- --mandir=/usr/share/man/man1 || die "./configure failed"
- addwrite "/var/lib/texmf"
- addwrite "/usr/share/texmf"
- addwrite "/var/cache/fonts"
-
- if use hppa
- then
- mymake=DLLD\=/usr/bin/gcc\ DLLDFLAGS\=-shared\ -Wl,-soname=\$\(LIBPARI_SONAME\)\ -lm
- fi
-
- # Shared libraries should be PIC on ALL architectures.
- # Danny van Dyk <kugelfang@gentoo.org> 2005/03/31
- # Fixes BUG #49583
- einfo "Building shared library..."
- cd Olinux-* || die "Bad directory. File a BUG!"
- emake ${mymake} CFLAGS="${CFLAGS} -DGCC_INLINE -fPIC" lib-dyn || die "Building shared library failed!"
-
- einfo "Building executables..."
- emake ${mymake} CFLAGS="${CFLAGS} -DGCC_INLINE" gp ../gp || die "Building executables failed!"
-
- use doc || rm -rf doc/*.tex
- use doc && emake doc
-}
-
-src_test() {
- ebegin "Testing pari kernel"
- make CFLAGS="-Wl,-lpari" test-kernel > /dev/null
- eend $?
-}
-
-src_install() {
- make DESTDIR="${D}" LIBDIR="${D}"/usr/$(get_libdir) install || die
- if use emacs; then
- insinto /usr/share/emacs/site-lisp
- doins emacs/pari.el
- fi
- dodoc AUTHORS Announce.2.1 CHANGES README TODO
-}
diff --git a/sci-mathematics/pari/pari-2.3.4-r1.ebuild b/sci-mathematics/pari/pari-2.3.4-r1.ebuild
index c0f20a32ff29..b9ddb9f76f17 100644
--- a/sci-mathematics/pari/pari-2.3.4-r1.ebuild
+++ b/sci-mathematics/pari/pari-2.3.4-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/pari/pari-2.3.4-r1.ebuild,v 1.9 2010/01/11 22:38:57 jer Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/pari/pari-2.3.4-r1.ebuild,v 1.10 2010/05/04 21:56:09 bicatali Exp $
EAPI=2
inherit elisp-common eutils flag-o-matic toolchain-funcs
@@ -18,7 +18,7 @@ SRC_URI="${SRC_COM}/unix/${P}.tar.gz
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="alpha amd64 hppa ~mips ppc ppc64 ~sparc x86 ~x86-fbsd"
-IUSE="doc data emacs fltk gmp static X"
+IUSE="doc data emacs fltk gmp static-libs X"
RDEPEND="sys-libs/readline
emacs? ( virtual/emacs )
@@ -64,6 +64,7 @@ src_prepare() {
}
src_configure() {
+ append-flags -fno-strict-aliasing
tc-export CC
# need to force optimization here, as it breaks without
if is-flag -O0; then
@@ -94,9 +95,9 @@ src_compile() {
emake ${mymake} CFLAGS="${CFLAGS} -DGCC_INLINE -fPIC" lib-dyn \
|| die "Building shared library failed!"
- if use static; then
+ if use static-libs; then
emake ${mymake} CFLAGS="${CFLAGS} -DGCC_INLINE" lib-sta \
- || die "Building static library failed!"
+ || die "Building static-libs library failed!"
fi
emake ${mymake} CFLAGS="${CFLAGS} -DGCC_INLINE" gp ../gp \
@@ -142,10 +143,10 @@ src_install() {
emake DESTDIR="${D}" install-data || die "Failed to install data files"
fi
- if use static; then
+ if use static-libs; then
emake \
DESTDIR="${D}" \
- install-lib-sta || die "Install of static library failed"
+ install-lib-sta || die "Install of static-libs library failed"
fi
}
diff --git a/sci-mathematics/pari/pari-2.3.5.ebuild b/sci-mathematics/pari/pari-2.3.5.ebuild
new file mode 100644
index 000000000000..8d7099d72361
--- /dev/null
+++ b/sci-mathematics/pari/pari-2.3.5.ebuild
@@ -0,0 +1,159 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/pari/pari-2.3.5.ebuild,v 1.1 2010/05/04 21:56:09 bicatali Exp $
+
+EAPI=2
+inherit elisp-common eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="A software package for computer-aided number theory"
+HOMEPAGE="http://pari.math.u-bordeaux.fr/"
+
+SRC_COM="http://pari.math.u-bordeaux.fr/pub/${PN}"
+SRC_URI="${SRC_COM}/unix/${P}.tar.gz
+ data? ( ${SRC_COM}/packages/elldata.tgz
+ ${SRC_COM}/packages/galdata.tgz
+ ${SRC_COM}/packages/seadata.tgz
+ ${SRC_COM}/packages/nftables.tgz )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
+IUSE="doc data emacs fltk gmp static-libs X"
+
+RDEPEND="sys-libs/readline
+ emacs? ( virtual/emacs )
+ fltk? ( x11-libs/fltk )
+ gmp? ( dev-libs/gmp )
+ X? ( x11-libs/libX11 )
+ doc? ( X? ( x11-misc/xdg-utils ) )"
+DEPEND="${RDEPEND}
+ doc? ( virtual/latex-base )"
+
+SITEFILE=50${PN}-gentoo.el
+
+get_compile_dir() {
+ pushd "${S}/config" >& /dev/null
+ local fastread=yes
+ source ./get_archos
+ popd >& /dev/null
+ echo "O${osname}-${arch}"
+}
+
+src_prepare() {
+ # move data into place
+ if use data; then
+ mv "${WORKDIR}"/data "${S}" || die "failed to move data"
+ fi
+ epatch "${FILESDIR}/"${PN}-2.3.2-strip.patch
+ epatch "${FILESDIR}/"${PN}-2.3.2-ppc-powerpc-arch-fix.patch
+
+ # disable default building of docs during install
+ sed -i \
+ -e "s:install-doc install-examples:install-examples:" \
+ config/Makefile.SH || die "Failed to fix makefile"
+ # propagate ldflags
+ sed -i \
+ -e 's/-shared $extra/-shared $extra \\$(LDFLAGS)/' \
+ config/get_dlld || die "Failed to fix LDFLAGS"
+ # move doc dir to a gentoo doc dir and replace hardcoded xdvi by xdg-open
+ sed -i \
+ -e "s:\$d = \$0:\$d = '/usr/share/doc/${PF}':" \
+ -e 's:"xdvi":"xdg-open":' \
+ -e 's:xdvi -paper 29.7x21cm:xdg-open:' \
+ doc/gphelp.in || die "Failed to fix doc dir"
+}
+
+src_configure() {
+ append-flags -fno-strict-aliasing
+ tc-export CC
+ # need to force optimization here, as it breaks without
+ if is-flag -O0; then
+ replace-flags -O0 -O2
+ elif ! is-flag -O?; then
+ append-flags -O2
+ fi
+ # sysdatadir installs a pari.cfg stuff which is informative only
+ ./Configure \
+ --prefix=/usr \
+ --datadir=/usr/share/${PN} \
+ --libdir=/usr/$(get_libdir) \
+ --sysdatadir=/usr/share/doc/${PF} \
+ --mandir=/usr/share/man/man1 \
+ --with-readline \
+ $(use_with gmp) \
+ || die "./Configure failed"
+}
+
+src_compile() {
+ if use hppa; then
+ mymake=DLLD\=/usr/bin/gcc\ DLLDFLAGS\=-shared\ -Wl,-soname=\$\(LIBPARI_SONAME\)\ -lm
+ fi
+
+ local installdir=$(get_compile_dir)
+ cd "${installdir}" || die "Bad directory"
+
+ emake ${mymake} CFLAGS="${CFLAGS} -DGCC_INLINE -fPIC" lib-dyn \
+ || die "Building shared library failed!"
+
+ if use static-libs; then
+ emake ${mymake} CFLAGS="${CFLAGS} -DGCC_INLINE" lib-sta \
+ || die "Building static library failed!"
+ fi
+
+ emake ${mymake} CFLAGS="${CFLAGS} -DGCC_INLINE" gp ../gp \
+ || die "Building executables failed!"
+
+ if use doc; then
+ cd "${S}"
+ # To prevent sandbox violations by metafont
+ VARTEXFONTS="${T}"/fonts emake docpdf \
+ || die "Failed to generate docs"
+ fi
+ if use emacs; then
+ cd "${S}/emacs"
+ elisp-compile *.el || die "elisp-compile failed"
+ fi
+}
+
+src_test() {
+ emake test-kernel || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "Install failed"
+
+ if use emacs; then
+ elisp-install ${PN} emacs/*.el emacs/*.elc \
+ || die "elisp-install failed"
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+ fi
+
+ dodoc AUTHORS Announce.2.1 CHANGES README NEW MACHINES COMPAT
+ if use doc; then
+ emake \
+ DESTDIR="${D}" \
+ EXDIR="${D}/usr/share/doc/${PF}/examples" \
+ DOCDIR="${D}/usr/share/doc/${PF}" \
+ install-doc || die "Failed to install docs"
+ insinto /usr/share/doc/${PF}
+ doins doc/*.pdf || die "Failed to install pdf docs"
+ fi
+
+ if use data; then
+ emake DESTDIR="${D}" install-data || die "Failed to install data files"
+ fi
+
+ if use static-libs; then
+ emake \
+ DESTDIR="${D}" \
+ install-lib-sta || die "Install of static library failed"
+ fi
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}