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

Contents of /sci-mathematics/Macaulay2/Macaulay2-1.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Mon Jan 7 06:27:55 2008 UTC (10 years, 7 months ago) by mr_bones_
Branch: MAIN
Changes since 1.1: +2 -2 lines
whitespace
(Portage version: 2.1.3.19)

1 markusle 1.1 # Copyright 1999-2008 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 mr_bones_ 1.2 # $Header: /var/cvsroot/gentoo-x86/sci-mathematics/Macaulay2/Macaulay2-1.0.ebuild,v 1.1 2008/01/06 15:51:17 markusle Exp $
4 markusle 1.1
5     inherit elisp-common eutils flag-o-matic toolchain-funcs autotools
6    
7     IUSE="emacs"
8    
9     DESCRIPTION="research tool for commutative algebra and algebraic geometry"
10     SRC_URI="mirror://gentoo/${P}-src.tar.bz2
11     ftp://www.mathematik.uni-kl.de/pub/Math/Singular/Factory/factory-3-0-3.tar.gz \
12     ftp://www.mathematik.uni-kl.de/pub/Math/Singular/Libfac/libfac-3-0-3.tar.gz"
13    
14     HOMEPAGE="http://www.math.uiuc.edu/Macaulay2/"
15    
16     SLOT="0"
17     LICENSE="GPL-2"
18     KEYWORDS="~x86 ~amd64"
19    
20     DEPEND="sys-libs/gdbm
21     dev-libs/gmp
22     dev-libs/ntl
23     dev-libs/boehm-gc
24     virtual/blas
25     virtual/lapack
26     dev-util/ctags
27     sys-libs/ncurses
28     emacs? ( virtual/emacs )"
29    
30     SITEFILE=70Macaulay2-gentoo.el
31    
32     pkg_setup() {
33    
34     # boehm-gc currently is broken with USE='threads'
35     # (see bug #195335) causing Macaulay2 to fail
36     if built_with_use =dev-libs/boehm-gc-7* threads; then
37     echo
38     eerror "dev-libs/boehm-gc-7* with USE=\"threads\" is"
39     eerror "currently broken (see bug #195335) causing"
40     eerror "Macaulay to fail building. Please re-emerge"
41     eerror "dev-libs/boehm-gc-7* with USE=\"-threads\"!"
42     die "boehm-gc setup error"
43     echo
44     fi
45     }
46    
47     src_unpack() {
48     unpack ${A}
49     cd "${S}"
50     epatch "${FILESDIR}"/${P}-example-fix.patch
51    
52     sed -e "s:\$docdirtail/${PN}:\$docdirtail/${P}:" \
53     -i configure.ac \
54     || die "Failed to fix doc install directory."
55     }
56    
57     src_compile() {
58     cd "${WORKDIR}/factory-3.0.3"
59     econf --enable-NTL --prefix="${WORKDIR}" || \
60     die "failed to configure factory"
61     emake || die "failed to build factory"
62     make install || die "failed to install factory"
63    
64     cd "${WORKDIR}/libfac"
65     CPPFLAGS="-I${WORKDIR}/include" econf --with-NOSTREAMIO \
66     --prefix="${WORKDIR}" || die "failed to configure libfac"
67     emake || die "failed to build libfac"
68     make install || die "failed to install libfac"
69    
70     cd "${S}"
71     sed -e "/^docm2RelDir/s:Macaulay2:${P}:" \
72     -i include/config.Makefile.in \
73     || die "failed to fix makefile"
74    
75     CXXFLAGS="${CXXFLAGS} -Wno-deprecated"
76     append-ldflags "-L${WORKDIR}/$(get_libdir)"
77     emake -j1 && CPPFLAGS="-I/usr/include/gc -I${WORKDIR}/include" \
78     ./configure --prefix="${D}/usr" --disable-encap \
79     --with-lapacklibs="$(pkg-config lapack --libs)" \
80     || die "failed to configure Macaulay"
81    
82     emake -j1 || die "failed to build Macaulay"
83     }
84    
85     # checks are currently very broken
86     #src_test() {
87     # cd "${S}"
88     # make check || die "tests failed"
89     #}
90    
91     src_install () {
92     make install || die "install failed"
93    
94     # nothing useful in here, get rid of it
95 mr_bones_ 1.2 # NOTE: Macaulay installs into lib even on amd64 hence don't
96 markusle 1.1 # replace lib with $(get_libdir) below!
97     rm -fr "${D}"/usr/lib \
98     || die "failed to remove empty /usr/lib"
99    
100     use emacs && elisp-site-file-install "${FILESDIR}/${SITEFILE}"
101     }
102    
103     pkg_postinst() {
104     if use emacs; then
105     elisp-site-regen
106     elog "If you want to set a hot key for Macaulay2 in Emacs add a line similar to"
107     elog "(global-set-key [ f12 ] 'M2)"
108     elog "in order to set it to F12 (or choose a different one."
109     fi
110     }
111     pkg_postrm() {
112     use emacs && elisp-site-regen
113     }

  ViewVC Help
Powered by ViewVC 1.1.20