| 1 |
# Copyright 1999-2010 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/dev-lisp/clisp/clisp-2.48-r1.ebuild,v 1.1 2010/04/14 01:49:38 chiiph Exp $
|
| 4 |
|
| 5 |
EAPI="2"
|
| 6 |
|
| 7 |
inherit flag-o-matic eutils toolchain-funcs multilib
|
| 8 |
|
| 9 |
DESCRIPTION="A portable, bytecode-compiled implementation of Common Lisp"
|
| 10 |
HOMEPAGE="http://clisp.sourceforge.net/"
|
| 11 |
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
|
| 12 |
|
| 13 |
LICENSE="GPL-2"
|
| 14 |
SLOT="2"
|
| 15 |
KEYWORDS="~alpha ~amd64 ~ia64 ~ppc -sparc ~x86"
|
| 16 |
IUSE="berkdb hyperspec X new-clx dbus fastcgi gdbm gtk pari +pcre postgres +readline svm -threads +unicode +zlib"
|
| 17 |
|
| 18 |
RDEPEND="virtual/libiconv
|
| 19 |
>=dev-libs/libsigsegv-2.4
|
| 20 |
>=dev-libs/ffcall-1.10
|
| 21 |
dbus? ( sys-apps/dbus )
|
| 22 |
fastcgi? ( dev-libs/fcgi )
|
| 23 |
gdbm? ( sys-libs/gdbm )
|
| 24 |
gtk? ( >=x11-libs/gtk+-2.10 >=gnome-base/libglade-2.6 )
|
| 25 |
pari? ( >=sci-mathematics/pari-2.3.0 )
|
| 26 |
postgres? ( >=virtual/postgresql-base-8.0 )
|
| 27 |
readline? ( >=sys-libs/readline-5.0 )
|
| 28 |
pcre? ( dev-libs/libpcre )
|
| 29 |
svm? ( sci-libs/libsvm )
|
| 30 |
zlib? ( sys-libs/zlib )
|
| 31 |
X? ( new-clx? ( x11-libs/libXpm ) )
|
| 32 |
hyperspec? ( dev-lisp/hyperspec )
|
| 33 |
berkdb? ( sys-libs/db:4.7 )"
|
| 34 |
|
| 35 |
DEPEND="${RDEPEND}
|
| 36 |
X? ( new-clx? ( x11-misc/imake x11-proto/xextproto ) )"
|
| 37 |
|
| 38 |
PDEPEND="dev-lisp/gentoo-init"
|
| 39 |
|
| 40 |
PROVIDE="virtual/commonlisp"
|
| 41 |
|
| 42 |
enable_modules() {
|
| 43 |
[[ $# = 0 ]] && die "${FUNCNAME[0]} must receive at least one argument"
|
| 44 |
for m in "$@" ; do
|
| 45 |
einfo "enabling module $m"
|
| 46 |
myconf+=" --with-module=${m}"
|
| 47 |
done
|
| 48 |
}
|
| 49 |
|
| 50 |
BUILDDIR="builddir"
|
| 51 |
|
| 52 |
# modules not enabled:
|
| 53 |
# * dirkey: fails to compile, requiring windows.h, possibly wrong #ifdefs
|
| 54 |
# * matlab, netica: not in portage
|
| 55 |
# * oracle: can't install oracle-instantclient
|
| 56 |
|
| 57 |
src_prepare() {
|
| 58 |
# More than -O1 breaks alpha/ia64
|
| 59 |
if use alpha || use ia64; then
|
| 60 |
sed -i -e 's/-O2//g' src/makemake.in || die
|
| 61 |
fi
|
| 62 |
}
|
| 63 |
|
| 64 |
src_configure() {
|
| 65 |
# We need this to build on alpha/ia64
|
| 66 |
if use alpha || use ia64; then
|
| 67 |
replace-flags -O? -O1
|
| 68 |
append-flags '-D NO_MULTIMAP_SHM -D NO_MULTIMAP_FILE -D NO_SINGLEMAP -D NO_TRIVIALMAP'
|
| 69 |
fi
|
| 70 |
|
| 71 |
# QA issue with lisp.run
|
| 72 |
append-flags -Wa,--noexecstack
|
| 73 |
|
| 74 |
# built-in features
|
| 75 |
local myconf="--with-ffcall --without-dynamic-modules"
|
| 76 |
# There's a problem with jit_allocai function
|
| 77 |
# if use jit; then
|
| 78 |
# myconf+=" --with-jitc=lightning"
|
| 79 |
# fi
|
| 80 |
if use threads; then
|
| 81 |
myconf+=" --with-threads=POSIX_THREADS"
|
| 82 |
fi
|
| 83 |
|
| 84 |
# default modules
|
| 85 |
enable_modules wildcard rawsock
|
| 86 |
# optional modules
|
| 87 |
use elibc_glibc && enable_modules bindings/glibc
|
| 88 |
if use X; then
|
| 89 |
if use new-clx; then
|
| 90 |
enable_modules clx/new-clx
|
| 91 |
else
|
| 92 |
enable_modules clx/mit-clx
|
| 93 |
fi
|
| 94 |
fi
|
| 95 |
if use postgres; then
|
| 96 |
enable_modules postgresql
|
| 97 |
append-flags -I$(pg_config --includedir)
|
| 98 |
fi
|
| 99 |
if use berkdb; then
|
| 100 |
enable_modules berkeley-db
|
| 101 |
append-flags -I/usr/include/db4.7
|
| 102 |
fi
|
| 103 |
use dbus && enable_modules dbus
|
| 104 |
use fastcgi && enable_modules fastcgi
|
| 105 |
use gdbm && enable_modules gdbm
|
| 106 |
use gtk && enable_modules gtk2
|
| 107 |
use pari && enable_modules pari
|
| 108 |
use pcre && enable_modules pcre
|
| 109 |
use svm && enable_modules libsvm
|
| 110 |
use zlib && enable_modules zlib
|
| 111 |
|
| 112 |
if use hyperspec; then
|
| 113 |
CLHSROOT="file:///usr/share/doc/hyperspec/HyperSpec/"
|
| 114 |
else
|
| 115 |
CLHSROOT="http://www.lispworks.com/reference/HyperSpec/"
|
| 116 |
fi
|
| 117 |
|
| 118 |
# configure chokes on --sysconfdir option
|
| 119 |
local configure="./configure --prefix=/usr --libdir=/usr/$(get_libdir) \
|
| 120 |
$(use_with readline) $(use_with unicode) \
|
| 121 |
${myconf} --hyperspec=${CLHSROOT} ${BUILDDIR}"
|
| 122 |
einfo "${configure}"
|
| 123 |
${configure} || die "./configure failed"
|
| 124 |
|
| 125 |
sed -i 's,"vi","nano",g' "${BUILDDIR}"/config.lisp || die
|
| 126 |
|
| 127 |
IMPNOTES="file://${ROOT%/}/usr/share/doc/${PN}-${PVR}/html/impnotes.html"
|
| 128 |
sed -i "s,http://clisp.cons.org/impnotes/,${IMPNOTES},g" \
|
| 129 |
"${BUILDDIR}"/config.lisp || die
|
| 130 |
}
|
| 131 |
|
| 132 |
src_compile() {
|
| 133 |
export VARTEXFONTS="${T}"/fonts
|
| 134 |
cd "${BUILDDIR}"
|
| 135 |
# parallel build fails
|
| 136 |
emake -j1 || die "emake failed"
|
| 137 |
}
|
| 138 |
|
| 139 |
src_install() {
|
| 140 |
pushd "${BUILDDIR}"
|
| 141 |
make DESTDIR="${D}" prefix=/usr install-bin || die
|
| 142 |
doman clisp.1 || die
|
| 143 |
dodoc SUMMARY README* NEWS MAGIC.add ANNOUNCE || die
|
| 144 |
fperms a+x /usr/$(get_libdir)/clisp-${PV/_*/}/clisp-link || die
|
| 145 |
# stripping them removes common symbols (defined but uninitialised variables)
|
| 146 |
# which are then needed to build modules...
|
| 147 |
export STRIP_MASK="*/usr/$(get_libdir)/clisp-${PV}/*/*"
|
| 148 |
popd
|
| 149 |
dohtml doc/impnotes.{css,html} doc/regexp.html doc/clisp.png || die
|
| 150 |
dodoc doc/{CLOS-guide,LISP-tutorial}.txt || die
|
| 151 |
}
|
| 152 |
|
| 153 |
pkg_postinst() {
|
| 154 |
if use threads || use jit; then
|
| 155 |
while read line; do elog ${line}; done <<EOF
|
| 156 |
|
| 157 |
Upstream considers threads to be of Alpha quality, therefore
|
| 158 |
it is likely that you will encounter bugs in using them. If you do,
|
| 159 |
please report bugs upstream:
|
| 160 |
|
| 161 |
Mailing list: https://lists.sourceforge.net/lists/listinfo/clisp-devel
|
| 162 |
Bug tracker: http://sourceforge.net/tracker/?atid=101355&group_id=1355
|
| 163 |
|
| 164 |
EOF
|
| 165 |
fi
|
| 166 |
}
|