dev-lisp/clisp: latest ebuild from https://bugs.gentoo.org/show_bug.cgi?id=218739
[gentoo-soor-overlay.git] / dev-lisp / clisp / clisp-2.44.1.ebuild
blob3c76c1c24674791a87aba5d587c0124f1a991133
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
5 inherit flag-o-matic eutils toolchain-funcs multilib
7 DESCRIPTION="A portable, bytecode-compiled implementation of Common Lisp"
8 HOMEPAGE="http://clisp.sourceforge.net/"
9 SRC_URI="mirror://sourceforge/clisp/${P}.tar.gz"
11 LICENSE="GPL-2"
12 SLOT="2"
13 KEYWORDS="~amd64 ~ppc ~ppc64 -sparc x86"
14 IUSE="hyperspec X new-clx fastcgi gdbm gtk pcre postgres readline svm zlib"
16 RDEPEND="dev-lisp/gentoo-init
17 virtual/libiconv
18 >=dev-libs/libsigsegv-2.4
19 >=dev-libs/ffcall-1.10
20 fastcgi? ( dev-libs/fcgi )
21 gdbm? ( sys-libs/gdbm )
22 gtk? ( >=x11-libs/gtk+-2.10 >=gnome-base/libglade-2.6 )
23 postgres? ( >=dev-db/postgresql-8.0 )
24 readline? ( sys-libs/readline )
25 pcre? ( dev-libs/libpcre )
26 svm? ( sci-libs/libsvm )
27 zlib? ( sys-libs/zlib )
28 X? ( new-clx? ( x11-libs/libXpm ) )
29 hyperspec? ( dev-lisp/hyperspec )"
30 # * GNU gettext
31 # + Not needed on systems with glibc 2.2 or newer, but recommended on all
32 # other systems: needed if you want clisp with native language support.
33 # sys-devel/gettext
35 DEPEND="${RDEPEND} X? ( new-clx? ( x11-misc/imake x11-proto/xextproto ) )"
37 PROVIDE="virtual/commonlisp"
39 enable_modules() {
40 [[ $# = 0 ]] && die "${FUNCNAME[0]} must receive at least one argument"
41 for m in "$@" ; do
42 einfo "enabling module $m"
43 myconf="${myconf} --with-module=${m}"
44 done
47 BUILDDIR="builddir"
49 src_compile() {
50 # built-in features
51 local myconf="--with-ffcall"
52 use readline || myconf="${myconf} --with-noreadline"
54 # default modules
55 enable_modules wildcard rawsock i18n
56 # optional modules
57 use elibc_glibc && enable_modules bindings/glibc
58 if use X; then
59 if use new-clx; then
60 enable_modules clx/new-clx
61 else
62 enable_modules clx/mit-clx
65 if use postgres; then
66 enable_modules postgresql
67 CPPFLAGS="-I $(pg_config --includedir)"
69 use fastcgi && enable_modules fastcgi
70 use gdbm && enable_modules gdbm
71 use gtk && enable_modules gtk2
72 use pcre && enable_modules pcre
73 use svm && enable_modules libsvm
74 use zlib && enable_modules zlib
76 # configure chokes on --infodir option
77 ./configure --prefix=/usr --libdir=/usr/$(get_libdir) \
78 ${myconf} ${BUILDDIR} || die "./configure failed"
79 cd ${BUILDDIR}
80 sed -i 's,"vi","nano",g' config.lisp
81 if use hyperspec; then
82 CLHSROOT="file:///usr/share/doc/hyperspec/HyperSpec/"
83 else
84 CLHSROOT="http://www.lispworks.com/reference/HyperSpec/"
86 sed -i "s,http://www.lisp.org/HyperSpec/,${CLHSROOT},g" config.lisp
87 IMPNOTES="file://${ROOT%/}/usr/share/doc/${PN}-${PVR}/html/impnotes.html"
88 sed -i "s,http://clisp.cons.org/impnotes/,${IMPNOTES},g" config.lisp
89 # parallel build fails
90 emake -j1 || die "emake failed"
93 src_install() {
94 pushd ${BUILDDIR}
95 make DESTDIR="${D}" prefix=/usr install-bin || die
96 doman clisp.1
97 dodoc SUMMARY README* NEWS MAGIC.add ANNOUNCE clisp.dvi clisp.html
98 chmod a+x "${D}"/usr/$(get_libdir)/clisp-${PV}/clisp-link
99 popd
100 dohtml doc/impnotes.{css,html} ${BUILDDIR}/clisp.html doc/clisp.png
101 dodoc ${BUILDDIR}/clisp.ps doc/{editors,CLOS-guide,LISP-tutorial}.txt