1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils multilib flag-o-matic
9 DESCRIPTION="Axiom is a general purpose Computer Algebra system"
10 HOMEPAGE="http://axiom.axiom-developer.org/"
11 SRC_URI="http://www.axiom-developer.org/axiom-website/downloads/${PN}-may2008-src.tgz"
15 KEYWORDS="~amd64 ~x86"
18 # NOTE: Do not strip since this seems to remove some crucial
19 # runtime paths as well, thereby, breaking axiom
22 DEPEND="virtual/latex-base
31 # for 2.6.25 kernels and higher we need to have
32 # /proc/sys/kernel/randomize_va_space set to somthing other
33 # than 2, otherwise gcl fails to compile (see bug #186926).
34 local current_setting=$(/sbin/sysctl kernel.randomize_va_space 2>/dev/null | cut -d' ' -f3)
35 if [[ ${current_setting} == 2 ]]; then
37 eerror "Your kernel has brk randomization enabled. This will"
38 eerror "cause axiom to fail to compile *and* run (see bug #186926)."
39 eerror "You can issue:"
41 eerror " /sbin/sysctl -w kernel.randomize_va_space=1"
43 eerror "as root to turn brk randomization off temporarily."
44 eerror "However, when not using axiom you may want to turn"
45 eerror "brk randomization back on via"
47 eerror " /sbin/sysctl -w kernel.randomize_va_space=2"
49 eerror "since it results in a less secure kernel."
50 die "Kernel brk randomization detected"
55 cp "${FILESDIR}"/noweb-2.9-insecure-tmp-file.patch.input \
56 "${S}"/zips/noweb-2.9-insecure-tmp-file.patch \
57 || die "Failed to fix noweb"
58 cp "${FILESDIR}"/${PN}-200711-gcl-configure.patch \
59 "${S}"/zips/gcl-2.6.7.configure.in.patch \
60 || die "Failed to fix gcl-2.6.7 configure"
61 epatch "${FILESDIR}"/noweb-2.9-insecure-tmp-file.Makefile.patch
63 # lots of strict-aliasing badness
64 append-flags -fno-strict-aliasing
69 sed -e "s:GCLVERSION=gcl-2.6.8pre$:GCLVERSION=gcl-2.6.7:" \
70 -i Makefile.pamphlet Makefile \
71 || die "Failed to select proper gcl"
73 # fix libXpm.a location
74 sed -e "s:X11R6/lib:$(get_libdir):g" -i Makefile.pamphlet \
75 || die "Failed to fix libXpm lib paths"
77 # Let the fun begin...
78 AXIOM="${S}"/mnt/linux emake -j1
82 emake DESTDIR="${D}"/opt/axiom COMMAND="${D}"/opt/axiom/mnt/linux/bin/axiom install
84 mv "${D}"/opt/axiom/mnt/linux/* "${D}"/opt/axiom \
85 || die "Failed to mv axiom into its final destination path."
86 rm -fr "${D}"/opt/axiom/mnt \
87 || die "Failed to remove old directory."
90 dosym /opt/axiom/bin/axiom /usr/bin/axiom
92 sed -e "2d;3i AXIOM=/opt/axiom" \
93 -i "${D}"/opt/axiom/bin/axiom \
94 || die "Failed to patch axiom runscript!"
96 dodoc changelog readme faq