/[gentoo-x86]/sci-mathematics/Macaulay2/Macaulay2-1.4-r1.ebuild
Gentoo

Contents of /sci-mathematics/Macaulay2/Macaulay2-1.4-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Wed Dec 14 08:44:52 2011 UTC (2 years, 9 months ago) by phajdan.jr
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +2 -2 lines
x86 stable wrt bug #394157

(Portage version: 2.1.10.11/cvs/Linux i686)

1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-mathematics/Macaulay2/Macaulay2-1.4-r1.ebuild,v 1.3 2011/12/13 21:29:04 tomka Exp $
4
5 EAPI="2"
6
7 inherit autotools elisp-common eutils flag-o-matic
8
9 IUSE="emacs optimization"
10 MY_REV="12617"
11
12 FACTORYVER="3-1-1"
13
14 DESCRIPTION="research tool for commutative algebra and algebraic geometry"
15 SRC_BASE="http://www.math.uiuc.edu/${PN}/Downloads/"
16 SRC_URI="${SRC_BASE}/OtherSourceCode/1.4/factory-${FACTORYVER}.tar.gz
17 ${SRC_BASE}/OtherSourceCode/1.4/libfac-${FACTORYVER}.tar.gz
18 http://www.math.uiuc.edu/${PN}/Extra/gc-7.2alpha5-2010-09-03.tar.gz
19 ${SRC_BASE}/SourceCode/${P}-r${MY_REV}-src.tar.bz2"
20
21 HOMEPAGE="http://www.math.uiuc.edu/Macaulay2/"
22
23 SLOT="0"
24 LICENSE="GPL-2"
25 KEYWORDS="amd64 x86"
26 # Tests are broken and building the package runs thousands of tests anyway
27 RESTRICT="test"
28
29 DEPEND="sys-libs/gdbm
30 >=dev-libs/ntl-5.5.2
31 >=sci-mathematics/pari-2.3.4[gmp]
32 >=sys-libs/readline-6.1
33 dev-libs/libxml2:2
34 sci-mathematics/frobby
35 sci-mathematics/4ti2
36 sci-mathematics/nauty
37 >=sci-mathematics/normaliz-2.5
38 <sci-mathematics/normaliz-2.7
39 sci-mathematics/gfan
40 >=dev-libs/mpfr-3.0.0
41 >=sci-libs/mpir-2.1.1[cxx]
42 sci-libs/cddlib
43 sci-libs/cdd+
44 sci-libs/lrslib[gmp]
45 virtual/blas
46 virtual/lapack
47 dev-util/ctags
48 sys-libs/ncurses
49 sys-process/time
50 emacs? ( virtual/emacs )"
51 RDEPEND="${DEPEND}"
52
53 SITEFILE=70Macaulay2-gentoo.el
54
55 S="${WORKDIR}/${P}-r${MY_REV}"
56
57 pkg_setup () {
58 tc-export CC CPP CXX
59 append-cppflags "-I/usr/include/frobby"
60 }
61
62 src_prepare() {
63 # Patching .m2 files to look for external programs in
64 # /usr/bin
65 epatch "${FILESDIR}"/${PV}-paths-of-external-programs.patch
66
67 # The following three are all upstream and need to be removed on bump.
68 # Fix an incompatibility with pari-2.5
69 epatch "${FILESDIR}"/${PV}-pari-2.5-compat.patch
70 # Two M2.el improvements
71 epatch "${FILESDIR}"/${PV}-comint-use-fields.patch
72 epatch "${FILESDIR}"/${PV}-fix-emacs-syntax-table.patch
73
74 # Fixing make warnings about unavailable jobserver:
75 sed -i "s/\$(MAKE)/+ \$(MAKE)/g" "${S}"/distributions/Makefile.in
76
77 # Factory, and libfac are statically linked libraries which (in this flavor) are not used by any
78 # other program. We build them internally and don't install them
79 mkdir "${S}/BUILD/tarfiles" || die "Creation of directory failed"
80 cp "${DISTDIR}/factory-3-1-1.tar.gz" "${S}/BUILD/tarfiles/" \
81 || die "copy failed"
82 cp "${DISTDIR}/libfac-3-1-1.tar.gz" "${S}/BUILD/tarfiles/" \
83 || die "copy failed"
84 # Macaulay 2 in this version insists on a snapshot of boehm-gc that is not available elsewhere
85 # We will let it build its internal version until >=boehm-gc-7.2_alpha5 is in in tree. Note:
86 # The resulting QA warning is known.
87 cp "${DISTDIR}/gc-7.2alpha5-2010-09-03.tar.gz" "${S}/BUILD/tarfiles/" \
88 || die "copy failed"
89
90 eautoreconf
91 }
92
93 src_configure (){
94 # Recommended in bug #268064 Possibly unecessary
95 # but should not hurt anybody.
96 if ! use emacs; then
97 tags="ctags"
98 fi
99
100 # configure instead of econf to enable install with --prefix
101 ./configure --prefix="${D}/usr" \
102 --disable-encap \
103 --disable-strip \
104 $(use_enable optimization optimize) \
105 --enable-build-libraries="factory gc libfac" \
106 --with-unbuilt-programs="4ti2 gfan normaliz nauty cddplus lrslib" \
107 || die "failed to configure Macaulay"
108 }
109
110 src_compile() {
111 # Parallel build not supported yet
112 emake -j1 || die "failed to build Macaulay"
113
114 if use emacs; then
115 cd "${S}/Macaulay2/emacs"
116 elisp-compile *.el || die "elisp-compile failed"
117 fi
118 }
119
120 src_test() {
121 emake check || die "tests failed"
122 }
123
124 src_install () {
125 # Parallel install not supported yet
126 emake -j1 install || die "install failed"
127
128 # Remove emacs files and install them in the
129 # correct place if use emacs
130 rm -rf "${D}"/usr/share/emacs/site-lisp
131 if use emacs; then
132 cd "${S}/Macaulay2/emacs"
133 elisp-install ${PN} *.elc *.el || die "elisp-install failed"
134 elisp-site-file-install "${FILESDIR}/${SITEFILE}"
135 fi
136 }
137
138 pkg_postinst() {
139 if use emacs; then
140 elisp-site-regen
141 elog "If you want to set a hot key for Macaulay2 in Emacs add a line similar to"
142 elog "(global-set-key [ f12 ] 'M2)"
143 elog "in order to set it to F12 (or choose a different one)."
144 fi
145 }
146
147 pkg_postrm() {
148 use emacs && elisp-site-regen
149 }

  ViewVC Help
Powered by ViewVC 1.1.20