From 8500325f8d2c4e41229667bf18a828c0d69bbb0b Mon Sep 17 00:00:00 2001 From: Thomas Kahle Date: Sun, 25 Sep 2011 19:44:37 +0000 Subject: [PATCH] Fix pari-2.5 compatibility (Bug 381347) and two emacs-improvements Package-Manager: portage-2.1.10.19/cvs/Linux i686 --- sci-mathematics/Macaulay2/ChangeLog | 9 +- .../Macaulay2/Macaulay2-1.4-r1.ebuild | 146 ++++++++++++++++++ sci-mathematics/Macaulay2/Manifest | 12 +- .../files/1.4-comint-use-fields.patch | 20 +++ .../files/1.4-fix-emacs-syntax-table.patch | 13 ++ .../Macaulay2/files/1.4-pari-2.5-compat.patch | 17 ++ 6 files changed, 212 insertions(+), 5 deletions(-) create mode 100644 sci-mathematics/Macaulay2/Macaulay2-1.4-r1.ebuild create mode 100644 sci-mathematics/Macaulay2/files/1.4-comint-use-fields.patch create mode 100644 sci-mathematics/Macaulay2/files/1.4-fix-emacs-syntax-table.patch create mode 100644 sci-mathematics/Macaulay2/files/1.4-pari-2.5-compat.patch diff --git a/sci-mathematics/Macaulay2/ChangeLog b/sci-mathematics/Macaulay2/ChangeLog index d6cfc5d2a32e..8606d84c6c29 100644 --- a/sci-mathematics/Macaulay2/ChangeLog +++ b/sci-mathematics/Macaulay2/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sci-mathematics/Macaulay2 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/Macaulay2/ChangeLog,v 1.23 2011/05/14 14:34:21 tomka Exp $ +# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/Macaulay2/ChangeLog,v 1.24 2011/09/25 19:44:37 tomka Exp $ + +*Macaulay2-1.4-r1 (25 Sep 2011) + + 25 Sep 2011; Thomas Kahle + +files/1.4-comint-use-fields.patch, +files/1.4-fix-emacs-syntax-table.patch, + +Macaulay2-1.4-r1.ebuild, +files/1.4-pari-2.5-compat.patch: + Fix pari-2.5 compatibility (Bug 381347) and two emacs-improvements 14 May 2011; Thomas Kahle Macaulay2-1.4.ebuild: x86 stable per bug 366379 diff --git a/sci-mathematics/Macaulay2/Macaulay2-1.4-r1.ebuild b/sci-mathematics/Macaulay2/Macaulay2-1.4-r1.ebuild new file mode 100644 index 000000000000..e1660d8fa484 --- /dev/null +++ b/sci-mathematics/Macaulay2/Macaulay2-1.4-r1.ebuild @@ -0,0 +1,146 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/Macaulay2/Macaulay2-1.4-r1.ebuild,v 1.1 2011/09/25 19:44:37 tomka Exp $ + +EAPI="2" + +inherit autotools elisp-common eutils flag-o-matic + +IUSE="emacs optimization" +MY_REV="12617" + +FACTORYVER="3-1-1" + +DESCRIPTION="research tool for commutative algebra and algebraic geometry" +SRC_BASE="http://www.math.uiuc.edu/${PN}/Downloads/" +SRC_URI="${SRC_BASE}/OtherSourceCode/1.4/factory-${FACTORYVER}.tar.gz + ${SRC_BASE}/OtherSourceCode/1.4/libfac-${FACTORYVER}.tar.gz + http://www.math.uiuc.edu/${PN}/Extra/gc-7.2alpha5-2010-09-03.tar.gz + ${SRC_BASE}/SourceCode/${P}-r${MY_REV}-src.tar.bz2" + +HOMEPAGE="http://www.math.uiuc.edu/Macaulay2/" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="~amd64 ~x86" + +DEPEND="sys-libs/gdbm + >=dev-libs/ntl-5.5.2 + >=sci-mathematics/pari-2.3.4[gmp] + >=sys-libs/readline-6.1 + dev-libs/libxml2:2 + sci-mathematics/frobby + sci-mathematics/4ti2 + sci-mathematics/nauty + >=sci-mathematics/normaliz-2.5 + sci-mathematics/gfan + >=dev-libs/mpfr-3.0.0 + >=sci-libs/mpir-2.1.1[cxx] + sci-libs/cddlib + sci-libs/cdd+ + sci-libs/lrslib[gmp] + virtual/blas + virtual/lapack + dev-util/ctags + sys-libs/ncurses + sys-process/time + emacs? ( virtual/emacs )" +RDEPEND="${DEPEND}" + +SITEFILE=70Macaulay2-gentoo.el + +S="${WORKDIR}/${P}-r${MY_REV}" + +pkg_setup () { + tc-export CC CPP CXX + append-cppflags "-I/usr/include/frobby" +} + +src_prepare() { + # Patching .m2 files to look for external programs in + # /usr/bin + epatch "${FILESDIR}"/${PV}-paths-of-external-programs.patch + + # The following three are all upstream and need to be removed on bump. + # Fix an incompatibility with pari-2.5 + epatch "${FILESDIR}"/${PV}-pari-2.5-compat.patch + # Two M2.el improvements + epatch "${FILESDIR}"/${PV}-comint-use-fields.patch + epatch "${FILESDIR}"/${PV}-fix-emacs-syntax-table.patch + + # Fixing make warnings about unavailable jobserver: + sed -i "s/\$(MAKE)/+ \$(MAKE)/g" "${S}"/distributions/Makefile.in + + # Factory, and libfac are statically linked libraries which (in this flavor) are not used by any + # other program. We build them internally and don't install them + mkdir "${S}/BUILD/tarfiles" || die "Creation of directory failed" + cp "${DISTDIR}/factory-3-1-1.tar.gz" "${S}/BUILD/tarfiles/" \ + || die "copy failed" + cp "${DISTDIR}/libfac-3-1-1.tar.gz" "${S}/BUILD/tarfiles/" \ + || die "copy failed" + # Macaulay 2 in this version insists on a snapshot of boehm-gc that is not available elsewhere + # We will let it build its internal version until >=boehm-gc-7.2_alpha5 is in in tree. Note: + # The resulting QA warning is known. + cp "${DISTDIR}/gc-7.2alpha5-2010-09-03.tar.gz" "${S}/BUILD/tarfiles/" \ + || die "copy failed" + + eautoreconf +} + +src_configure (){ + # Recommended in bug #268064 Possibly unecessary + # but should not hurt anybody. + if ! use emacs; then + tags="ctags" + fi + + # configure instead of econf to enable install with --prefix + ./configure --prefix="${D}/usr" \ + --disable-encap \ + --disable-strip \ + $(use_enable optimization optimize) \ + --enable-build-libraries="factory gc libfac" \ + --with-unbuilt-programs="4ti2 gfan normaliz nauty cddplus lrslib" \ + || die "failed to configure Macaulay" +} + +src_compile() { + # Parallel build not supported yet + emake -j1 || die "failed to build Macaulay" + + if use emacs; then + cd "${S}/Macaulay2/emacs" + elisp-compile *.el || die "elisp-compile failed" + fi +} + +src_test() { + emake check || die "tests failed" +} + +src_install () { + # Parallel install not supported yet + emake -j1 install || die "install failed" + + # Remove emacs files and install them in the + # correct place if use emacs + rm -rf "${D}"/usr/share/emacs/site-lisp + if use emacs; then + cd "${S}/Macaulay2/emacs" + elisp-install ${PN} *.elc *.el || die "elisp-install failed" + elisp-site-file-install "${FILESDIR}/${SITEFILE}" + fi +} + +pkg_postinst() { + if use emacs; then + elisp-site-regen + elog "If you want to set a hot key for Macaulay2 in Emacs add a line similar to" + elog "(global-set-key [ f12 ] 'M2)" + elog "in order to set it to F12 (or choose a different one)." + fi +} + +pkg_postrm() { + use emacs && elisp-site-regen +} diff --git a/sci-mathematics/Macaulay2/Manifest b/sci-mathematics/Macaulay2/Manifest index 1cd9f55cdccd..f75af71ae01e 100644 --- a/sci-mathematics/Macaulay2/Manifest +++ b/sci-mathematics/Macaulay2/Manifest @@ -1,19 +1,23 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 +AUX 1.4-comint-use-fields.patch 964 RMD160 a2ef29a4b590734e9c7685a904b875e251f43405 SHA1 4b6014e67977d55853637dcd559cccc75712d6a7 SHA256 6d5434a158b3973c91cfaaba56738c61de0a033a4aee0e03e9b74f7b5c9d9e20 +AUX 1.4-fix-emacs-syntax-table.patch 495 RMD160 3ea06826fe9b2d89d08efc3bfc7aac58fef0b166 SHA1 89b416862dac3a859b6c485806b56ebdd78059cd SHA256 710b0b1d50b6788553220ddde6553070e335642485a32713cf3f6d3e845a45b7 +AUX 1.4-pari-2.5-compat.patch 702 RMD160 681653173f5eeacbc0f0dba5547d4f900a2d816a SHA1 0a2aa2d0ccf9d8d707751ce82c4de24c94c3ed43 SHA256 d4bebc010a3eace30cf740887cb7ceda661969700397d4ffae78dc8eff97639f AUX 1.4-paths-of-external-programs.patch 3175 RMD160 ad0f634b52b3fe883e49a53815481ca5b73d93c3 SHA1 4644c4b8c64678ca8205515436666651f467ee58 SHA256 162823069e075d7b7712db841d8c7bb8e1f03f2c33d4ade18e0b7a20543f5230 AUX 70Macaulay2-gentoo.el 597 RMD160 bdf3a30bb4d15a77e0dff86c866134d06c443fa0 SHA1 d4a4036042ab13bc20d8be90b559e9168bfc0ef5 SHA256 e5583d11e6ab662261abb32e90fcf31ccf6bd56f2b23b691b9255d1b8d8acb2f DIST Macaulay2-1.4-r12617-src.tar.bz2 4003881 RMD160 cb7958d8a347e45e10d717a8654d04e05a17ff00 SHA1 b88115b748c43a4f306a7b9fe6b47f7554498ec8 SHA256 9ddaf6f7288629647150067f46ca634a9b3c88fedfe3a9e21231531867ad9d91 DIST factory-3-1-1.tar.gz 540431 RMD160 63b5d71c93b1c0f628d758959822f61b0a9c702c SHA1 2b0e087de5ff4d4b63c003e1b6f9926577f17264 SHA256 1f86833248ef2bb5fd7820201d08df864bda2d8be58bc69255ecdca6fdf12c1b DIST gc-7.2alpha5-2010-09-03.tar.gz 1257818 RMD160 58954216c702add21e24eecb2225274e760faf49 SHA1 1686ccc823376e7e693cae3b3c387c2aa052154b SHA256 adba7f6663d911d4031a1a6a87de6f75d5d8f7870ad362e16f5395449911c1fa DIST libfac-3-1-1.tar.gz 90104 RMD160 8ca086ad2dc1dfbf3d8824e244f0b1af087eef62 SHA1 3753363a6f56cfeb0d0be3bdf471d6bd55c14ede SHA256 4c463af2d22375aa62be4fb1f9a32cada6723ca5e3ddbd8a4f5cab72b675e33a +EBUILD Macaulay2-1.4-r1.ebuild 4195 RMD160 072c679584ce9dad8aec6c089951691809fc3a40 SHA1 173095909366e047a213eba5f81e8ccbc96b7d69 SHA256 9fb1ab2c8fd9712543334955c526aa95d7a2a2d62f7fac0625f6a4d2d671e097 EBUILD Macaulay2-1.4.ebuild 3892 RMD160 01ce63449e4c7067eabb0a5260cadd021d840d4c SHA1 ac9aadce353e54cdd54224db544113d62eb2bcec SHA256 d5d9631515263d355e548827512e44fd526ffd41b5db981ac9acae35fbfca39c -MISC ChangeLog 957 RMD160 4d2f6faf345f7d159291d7e302e47290e8d35b1c SHA1 c81075f593c6786bca9ffd80d765873ef0eee0ce SHA256 6bd97e743354c0a3f63c818609bec8beff74222c6f4fd54a634f536c8fa22764 +MISC ChangeLog 1248 RMD160 2cc9e35af031a387301e4f782e2226371394238b SHA1 15c637c8502bca60157176ff4b9e2b79709a0ef4 SHA256 f71e8327c0398136e71fca7b75300ee0524178b3d894e8061fd3e6480bc56a49 MISC metadata.xml 501 RMD160 fc264092440af9ae6f0372e5daf80e75699ad57b SHA1 7ebc4185ac26fc23b865607ba79f73239869338d SHA256 0f1bd9e307bc0b7f1e5f116c5993f8c36cd796a11bf7f5deca930d43d1d3574b -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) -iF4EAREIAAYFAk3Okf8ACgkQodBTJSDyo66DEQD9EgQm5ay3DyaN+2Augiz+NQiS -kHl2Wj34SO5/f0VzrLEA/ifTfbNZasnQ+ODok17Unmm15lvuy5oXbpiH8kLBY99t -=KLi1 +iF4EAREIAAYFAk5/hKsACgkQodBTJSDyo64hwAD/Q45sPY5z1SyLD21fGjUuvdOn +COoJ6A9r0u4aB27JLGAA/jpHsfNZGGygryDN7YH1eDzcn9TXW2RGYozDc1CE5Gde +=Q38u -----END PGP SIGNATURE----- diff --git a/sci-mathematics/Macaulay2/files/1.4-comint-use-fields.patch b/sci-mathematics/Macaulay2/files/1.4-comint-use-fields.patch new file mode 100644 index 000000000000..5895f3ef2145 --- /dev/null +++ b/sci-mathematics/Macaulay2/files/1.4-comint-use-fields.patch @@ -0,0 +1,20 @@ +Index: Macaulay2/emacs/M2.el +=================================================================== +--- Macaulay2/emacs/M2.el (revision 13949) ++++ Macaulay2/emacs/M2.el (revision 13951) +@@ -38,7 +38,6 @@ + \\{M2-comint-mode-map}" + (M2-common) + (setq comint-prompt-regexp M2-comint-prompt-regexp) +- (setq comint-use-prompt-regexp-instead-of-fields t) + (set (make-local-variable 'comint-dynamic-complete-functions) '( M2-dynamic-complete-symbol comint-dynamic-complete-filename)) + ;; give up trying to fix this: + ;; (set (make-local-variable 'ansi-color-for-comint-mode-on) nil) +@@ -46,7 +45,6 @@ + + (defun M2-common() + "Set up features common to both Macaulay 2 major modes." +- (set (make-local-variable 'comint-use-prompt-regexp-instead-of-fields) nil) ; we might want to start using "input fields", too! + (set (make-local-variable 'comment-start) "-- ") + (set (make-local-variable 'comment-end) "") + (set (make-local-variable 'comment-column) 60) diff --git a/sci-mathematics/Macaulay2/files/1.4-fix-emacs-syntax-table.patch b/sci-mathematics/Macaulay2/files/1.4-fix-emacs-syntax-table.patch new file mode 100644 index 000000000000..32fc43bc14a2 --- /dev/null +++ b/sci-mathematics/Macaulay2/files/1.4-fix-emacs-syntax-table.patch @@ -0,0 +1,13 @@ +Index: Macaulay2/emacs/M2.el +=================================================================== +--- Macaulay2/emacs/M2.el (revision 13991) ++++ Macaulay2/emacs/M2.el (revision 14000) +@@ -102,7 +102,7 @@ + (mapcar + (function + (lambda (syntax-table) +- (modify-syntax-entry ?\\ "\\" syntax-table) ++ (modify-syntax-entry ?\\ "." syntax-table) + (modify-syntax-entry ?- ". 12" syntax-table) + (modify-syntax-entry ?\n ">" syntax-table) + (modify-syntax-entry ?\^m ">" syntax-table) diff --git a/sci-mathematics/Macaulay2/files/1.4-pari-2.5-compat.patch b/sci-mathematics/Macaulay2/files/1.4-pari-2.5-compat.patch new file mode 100644 index 000000000000..5b254a8eb447 --- /dev/null +++ b/sci-mathematics/Macaulay2/files/1.4-pari-2.5-compat.patch @@ -0,0 +1,17 @@ +Index: Macaulay2/d/pari-c.c +=================================================================== +--- Macaulay2/d/pari-c.c (revision 13515) ++++ Macaulay2/d/pari-c.c (revision 13519) +@@ -154,9 +154,11 @@ + */ + + #define pari_examine(x) do { fputs(" " #x ": ", stdout); voir(x,-1); } while (0) +-#define pari_display(x) do { fputs(" " #x ": ", stdout); outbeaut(x); } while (0) ++#define pari_display(x) do { fputs(" " #x ": ", stdout); output(x); } while (0) + #define abs(x) ((x)<0?-(x):(x)) + ++#define max(a,b) ((a)>(b)?(a):(b)) ++ + static void gmp_examine0(mpz_t z) { + int i, n = max(z->_mp_alloc,abs(z->_mp_size)); + printf("alloc %d size %d %s {",z->_mp_alloc,z->_mp_size,z->_mp_size < 0 ? "-" : "+"); -- 2.26.2