dev-qt/qtx11extras: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / sci-mathematics / singular / singular-4.0.3.ebuild
1 # Copyright 1999-2020 Gentoo Authors
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 toolchain-funcs 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? ( >=app-editors/emacs-23.1:* )
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
47 src_prepare() {
48         eapply "${FILESDIR}"/"${P}"-fix-resources-name.patch
49         eapply "${FILESDIR}"/"${P}"-fix-destdir.patch
50         eapply_user
51         # autoreconf everything since otherwise it assumes autmake-1.13 is installed
52         eautoreconf
53 }
54
55 src_configure() {
56         econf --with-gmp \
57                   --with-ntl \
58                   --with-flint \
59                   --enable-gfanlib \
60                   --disable-debug \
61                   --disable-doc \
62                   --enable-factory \
63                   --enable-libfac \
64                   --enable-IntegerProgramming \
65                   $(use_with python python embed) \
66                   $(use_with boost Boost) \
67                   $(use_enable emacs) \
68                   $(use_with readline) || die "configure failed"
69 }
70
71 src_compile() {
72         emake
73
74         if use emacs; then
75                 cd "${S}"/emacs/
76                 elisp-compile *.el || die "elisp-compile failed"
77         fi
78 }
79
80 pkg_postinst() {
81         einfo "The authors ask you to register as a SINGULAR user."
82         einfo "Please check the license file for details."
83
84         if use emacs; then
85                 echo
86                 ewarn "Please note that the ESingular emacs wrapper has been"
87                 ewarn "removed in favor of full fledged singular support within"
88                 ewarn "Gentoo's emacs infrastructure; i.e. just fire up emacs"
89                 ewarn "and you should be good to go! See bug #193411 for more info."
90                 echo
91         fi
92
93         use emacs && elisp-site-regen
94 }
95
96 pkg_postrm() {
97         use emacs && elisp-site-regen
98 }