summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Kahle <tomka@gentoo.org>2010-11-12 18:56:55 +0000
committerThomas Kahle <tomka@gentoo.org>2010-11-12 18:56:55 +0000
commit158f191ab0ef4f07b5fe99dfd1f29bda32480dec (patch)
tree005876629d13fa0ee6e752c7cb65a6c040db88aa /sci-mathematics
parentNew package: sci-libs/lrslib imported from science overlay. Fixes bug #338685 (diff)
downloadgentoo-2-158f191ab0ef4f07b5fe99dfd1f29bda32480dec.tar.gz
gentoo-2-158f191ab0ef4f07b5fe99dfd1f29bda32480dec.tar.bz2
gentoo-2-158f191ab0ef4f07b5fe99dfd1f29bda32480dec.zip
readding sci-mathematics/Macaulay2
Was last-rited after bug 248365 Readd fixes bug 246095 (Portage version: 2.1.9.24/cvs/Linux i686)
Diffstat (limited to 'sci-mathematics')
-rw-r--r--sci-mathematics/Macaulay2/ChangeLog11
-rw-r--r--sci-mathematics/Macaulay2/Macaulay2-1.4.ebuild139
-rw-r--r--sci-mathematics/Macaulay2/files/1.4-paths-of-external-programs.patch61
-rw-r--r--sci-mathematics/Macaulay2/files/70Macaulay2-gentoo.el11
-rw-r--r--sci-mathematics/Macaulay2/metadata.xml16
5 files changed, 238 insertions, 0 deletions
diff --git a/sci-mathematics/Macaulay2/ChangeLog b/sci-mathematics/Macaulay2/ChangeLog
new file mode 100644
index 000000000000..6984840fce29
--- /dev/null
+++ b/sci-mathematics/Macaulay2/ChangeLog
@@ -0,0 +1,11 @@
+# ChangeLog for sci-mathematics/Macaulay2
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/Macaulay2/ChangeLog,v 1.19 2010/11/12 18:56:55 tomka Exp $
+
+*Macaulay2-1.4 (12 Nov 2010)
+
+ 12 Nov 2010; Thomas Kahle <tomka@gentoo.org>
+ +files/1.4-paths-of-external-programs.patch, +files/70Macaulay2-gentoo.el,
+ +Macaulay2-1.4.ebuild, +metadata.xml:
+ Macaulay2 is back! Was removed in bug #248365, readd fixes bug #246095.
+
diff --git a/sci-mathematics/Macaulay2/Macaulay2-1.4.ebuild b/sci-mathematics/Macaulay2/Macaulay2-1.4.ebuild
new file mode 100644
index 000000000000..39ade66b05b2
--- /dev/null
+++ b/sci-mathematics/Macaulay2/Macaulay2-1.4.ebuild
@@ -0,0 +1,139 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/Macaulay2/Macaulay2-1.4.ebuild,v 1.1 2010/11/12 18:56:55 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
+ 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
+
+ # 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 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/files/1.4-paths-of-external-programs.patch b/sci-mathematics/Macaulay2/files/1.4-paths-of-external-programs.patch
new file mode 100644
index 000000000000..9b16e5a51669
--- /dev/null
+++ b/sci-mathematics/Macaulay2/files/1.4-paths-of-external-programs.patch
@@ -0,0 +1,61 @@
+diff -U 3 -dHrN M2source.orig/Macaulay2/packages/FourTiTwo.m2 M2source.patches/Macaulay2/packages/FourTiTwo.m2
+--- M2source.orig/Macaulay2/packages/FourTiTwo.m2 2010-09-19 02:32:45.000000000 +0200
++++ M2source.patches/Macaulay2/packages/FourTiTwo.m2 2010-09-19 02:37:25.000000000 +0200
+@@ -47,7 +47,7 @@
+
+ path'4ti2 = (options FourTiTwo).Configuration#"path"
+ -- NOTE: the absolute path should be put into the .init file for 4ti2 inside the .Macaulay2 directory.
+-if path'4ti2 == "" then path'4ti2 = prefixDirectory | currentLayout#"programs"
++if path'4ti2 == "" then path'4ti2 = "/usr/bin/"
+
+ getFilename = () -> (
+ filename := temporaryFileName();
+diff -U 3 -dHrN M2source.orig/Macaulay2/packages/gfanInterface.m2 M2source.patches/Macaulay2/packages/gfanInterface.m2
+--- M2source.orig/Macaulay2/packages/gfanInterface.m2 2010-09-19 02:32:45.000000000 +0200
++++ M2source.patches/Macaulay2/packages/gfanInterface.m2 2010-09-19 02:38:08.000000000 +0200
+@@ -26,7 +26,7 @@
+ }
+
+ gfan'path = gfanInterface#Options#Configuration#"path"
+-if gfan'path == "" then gfan'path = prefixDirectory | currentLayout#"programs"
++if gfan'path == "" then gfan'path = "/usr/bin/"
+ if instance(gfan'path, String) then gfan'path = {gfan'path}
+ if not instance(gfan'path,List) then error "expected configuration option gfan'path to be a list of strings or a string"
+ gfan'path = join(
+diff -U 3 -dHrN M2source.orig/Macaulay2/packages/Nauty.m2 M2source.patches/Macaulay2/packages/Nauty.m2
+--- M2source.orig/Macaulay2/packages/Nauty.m2 2010-09-19 02:33:04.000000000 +0200
++++ M2source.patches/Macaulay2/packages/Nauty.m2 2010-09-19 02:40:46.000000000 +0200
+@@ -27,7 +27,8 @@
+ -- Check the ~/.Macaulay2/init-Nauty.m2 file for the absolute path.
+ -- If it's not there, then use the M2-Programs directory.
+ nauty'path = (options Nauty).Configuration#"path";
+-if nauty'path == "" then nauty'path = prefixDirectory | currentLayout#"programs";
++if nauty'path == "" then nauty'path = "/usr/bin/";
++
+
+ -------------------
+ -- Exports
+diff -U 3 -dHrN M2source.orig/Macaulay2/packages/Normaliz.m2 M2source.patches/Macaulay2/packages/Normaliz.m2
+--- M2source.orig/Macaulay2/packages/Normaliz.m2 2010-09-19 02:33:04.000000000 +0200
++++ M2source.patches/Macaulay2/packages/Normaliz.m2 2010-09-19 02:39:12.000000000 +0200
+@@ -156,7 +156,7 @@
+ nmzExec="norm64";
+ );
+ -- return nmzExec;
+- return prefixDirectory | currentLayout#"programs" | nmzExec;
++ return "/usr/bin/" | nmzExec;
+ );
+
+
+diff -U 3 -dHrN M2source.orig/Macaulay2/packages/StatePolytope.m2 M2source.patches/Macaulay2/packages/StatePolytope.m2
+--- M2source.orig/Macaulay2/packages/StatePolytope.m2 2010-09-19 02:32:46.000000000 +0200
++++ M2source.patches/Macaulay2/packages/StatePolytope.m2 2010-09-19 02:38:39.000000000 +0200
+@@ -31,7 +31,7 @@
+
+
+ gfanCommand = (options StatePolytope)#Configuration#"gfan command"
+-if gfanCommand === "gfan" then gfanCommand = prefixDirectory | currentLayout#"programs" | gfanCommand
++if gfanCommand === "gfan" then gfanCommand = "/usr/bin/" | gfanCommand
+ gfanCommand = "!" | gfanCommand
+
+ --The next two functions print out the ring and the ideal in the format required by gfan
diff --git a/sci-mathematics/Macaulay2/files/70Macaulay2-gentoo.el b/sci-mathematics/Macaulay2/files/70Macaulay2-gentoo.el
new file mode 100644
index 000000000000..ac86e2132ed5
--- /dev/null
+++ b/sci-mathematics/Macaulay2/files/70Macaulay2-gentoo.el
@@ -0,0 +1,11 @@
+;; sci-mathematics/Macaulay2 init file
+
+(add-to-list 'load-path "/usr/share/emacs/site-lisp/Macaulay2")
+
+(defvar M2-exe "/usr/bin/M2" "*The default Macaulay2 executable name.")
+(autoload 'M2 "M2.el" "Run Macaulay 2 in a buffer." t)
+(autoload 'Macaulay2 "M2" "Run Macaulay 2 in a buffer, non-interactive." t)
+(autoload 'M2-mode "M2" "Macaulay 2 editing mode" t)
+(autoload 'm2-mode "M2" "Macaulay 2 editing mode, name in lower case" t)
+(autoload 'm2-comint-mode "M2" "Macaulay 2 command interpreter mode, name in lower case" t)
+(setq auto-mode-alist (append auto-mode-alist '(("\\.m2$" . M2-mode)))) \ No newline at end of file
diff --git a/sci-mathematics/Macaulay2/metadata.xml b/sci-mathematics/Macaulay2/metadata.xml
new file mode 100644
index 000000000000..09dd6f4ff10a
--- /dev/null
+++ b/sci-mathematics/Macaulay2/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>tomka@gentoo.org</email>
+ <name>Thomas Kahle</name>
+</maintainer>
+<herd>sci-mathematics</herd>
+<use>
+ <flag name="optimization">Accept upstream's choices for -O option, i.e. -O3 almost everywhere.</flag>
+</use>
+<longdescription lang="en">
+ Macaulay2 is a research tool for algraic geometry and commutative
+ algebra.
+</longdescription>
+</pkgmetadata>