summaryrefslogtreecommitdiff
path: root/sci-mathematics/open-axiom/open-axiom-9999.ebuild
blob: 58e5ef9ee79aaa2ab7c4c0b2a2c0db448398b0f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=2
inherit eutils autotools subversion

DESCRIPTION="The open computer algebra system (Axiom fork)"
HOMEPAGE="http://open-axiom.org"
ESVN_REPO_URI="https://open-axiom.svn.sf.net/svnroot/open-axiom/trunk"
ESVN_PROJECT="open-axiom"
SRC_URI=""

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
LISPS=( sbcl clisp gcl ecls clozurecl )
CONF=(   .     .    .  ecl     ccl    )

# The first lisp is default
IUSE="X threads +${LISPS[0]}"
n=${#LISPS[*]}
for ((i=1; i < n; i++)); do
	IUSE="$IUSE -${LISPS[$i]}"
done



RDEPEND="X? ( x11-libs/libXpm
x11-libs/libXau
x11-libs/libSM
x11-libs/libxcb
x11-libs/libXdmcp
x11-libs/libICE )"

DEPEND="${RDEPEND}
app-text/noweb
sbcl?      ( >=dev-lisp/sbcl-1.0.22 !=dev-lisp/sbcl-1.0.29 )
clisp?     ( >=dev-lisp/clisp-1.44 )
gcl?       ( || ( =dev-lisp/gcl-2.6.7 =dev-lisp/gcl-2.6.8 ) )
ecls?      ( >=dev-lisp/ecls-0.9l  )
clozurecl? ( >=dev-lisp/clozurecl-1.3 )"

choose_lisp() {
	if [ ${CONF[$1]} != '.' ]; then
		echo ${CONF[$1]}
	else
		echo ${LISPS[$1]}
	fi
}

pkg_setup() {
	local l n i
	LISP=''
	n=${#LISPS[*]}
	for ((i=0; i < n; i++)); do
		if use ${LISPS[$i]}; then
			if [ -z "$LISP" ]; then
				l=${LISPS[$i]}
				LISP=$(choose_lisp $i)
			else
				ewarn "Only one lisp can be used and it will be $l."
				ewarn "Check your USE flags."
				epause 5
			fi
		fi
	done
	if [ -z "$LISP" ]; then
		LISP=$(choose_lisp 0)
		ewarn "No lisp platform specified."
		ewarn "Chosing ${LISPS[0]} as default."
		ewarn "Building OpenAxiom may fail due to loosing dependecies."
		epause 5
	fi
}

src_prepare() {
	eautoreconf
}

src_configure() {
	econf \
		$(use_with X x) \
		$(use_enable gcl gcl) \
		--with-lisp=$LISP \
		$(use_enable threads threads) \
		|| die "econf failed"
}

src_compile() {
	# Parallel make broken
	emake -j1 || die "emake failed"

}

src_install() {
	emake DESTDIR="${D}" install || die "emake install failed"
	dodoc ChangeLog* NEWS README AUTHORS MAINTAINERS TODO STYLES INSTALL
	doicon ${FILESDIR}/open-axiom.png
	make_desktop_entry \
		open-axiom \
		OpenAxiom \
		open-axiom \
		"" \
		"Terminal=true"
}