*/*: [QA] Remove redundant `|| die` guards
[gentoo.git] / sci-mathematics / singular / singular-4.0.3.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit autotools elisp-common flag-o-matic multilib prefix versionator
7
8 MY_PN=Singular
9 MY_PV=$(replace_all_version_separators '.')
10 # Consistency is different...
11 MY_DIR2=$(get_version_component_range 1-3 ${PV})
12 MY_DIR=$(replace_all_version_separators '-' ${MY_DIR2})
13 # This is where the share tarball unpacks to
14
15 DESCRIPTION="Computer algebra system for polynomial computations"
16 HOMEPAGE="http://www.singular.uni-kl.de/"
17 SRC_URI="http://www.mathematik.uni-kl.de/ftp/pub/Math/${MY_PN}/SOURCES/${MY_DIR}/${PN}-${MY_PV}.tar.gz
18                  http://www.mathematik.uni-kl.de/ftp/pub/Math/${MY_PN}/SOURCES/${MY_DIR}/${PN}-${MY_PV}-share.tar.gz"
19
20 LICENSE="GPL-2"
21 SLOT="0"
22 KEYWORDS="~amd64 ~ppc ~x86 ~x86-linux ~x86-macos"
23 IUSE="boost doc emacs examples python +readline"
24
25 RDEPEND="dev-libs/gmp:0
26         >=dev-libs/ntl-5.5.1
27         emacs? ( >=virtual/emacs-22 )
28         sci-mathematics/flint
29         sci-mathematics/4ti2
30         sci-libs/cddlib"
31
32 DEPEND="${RDEPEND}
33         dev-lang/perl
34         boost? ( dev-libs/boost )
35         readline? ( sys-libs/readline )"
36
37 SITEFILE=60${PN}-gentoo.el
38
39 S="${WORKDIR}/${PN}-${MY_DIR2}"
40
41 pkg_setup() {
42         append-flags "-fPIC"
43         append-ldflags "-fPIC"
44         tc-export AR CC CPP CXX
45
46         # Ensure that >=emacs-22 is selected
47         if use emacs; then
48                 elisp-need-emacs 22 || die "Emacs version too low"
49         fi
50 }
51
52 src_prepare () {
53         eapply "${FILESDIR}"/"${P}"-fix-resources-name.patch
54         eapply "${FILESDIR}"/"${P}"-fix-destdir.patch
55         eapply_user
56         # autoreconf everything since otherwise it assumes autmake-1.13 is installed
57         eautoreconf
58 }
59
60 src_configure() {
61         econf --with-gmp \
62                   --with-ntl \
63                   --with-flint \
64                   --enable-gfanlib \
65                   --disable-debug \
66                   --disable-doc \
67                   --enable-factory \
68                   --enable-libfac \
69                   --enable-IntegerProgramming \
70                   $(use_with python python embed) \
71                   $(use_with boost Boost) \
72                   $(use_enable emacs) \
73                   $(use_with readline) || die "configure failed"
74 }
75
76 src_compile() {
77         emake
78
79         if use emacs; then
80                 cd "${S}"/emacs/
81                 elisp-compile *.el || die "elisp-compile failed"
82         fi
83 }
84
85 pkg_postinst() {
86         einfo "The authors ask you to register as a SINGULAR user."
87         einfo "Please check the license file for details."
88
89         if use emacs; then
90                 echo
91                 ewarn "Please note that the ESingular emacs wrapper has been"
92                 ewarn "removed in favor of full fledged singular support within"
93                 ewarn "Gentoo's emacs infrastructure; i.e. just fire up emacs"
94                 ewarn "and you should be good to go! See bug #193411 for more info."
95                 echo
96         fi
97
98         use emacs && elisp-site-regen
99 }
100
101 pkg_postrm() {
102         use emacs && elisp-site-regen
103 }