dev-lisp/sbcl: bump
[portage-prefix-bleeding-edge-ebuilds.git] / dev-lisp / sbcl / sbcl-1.0.23.ebuild
blob12a1e8bc40e94887abca6862beddd499ff841f10
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-lisp/sbcl/sbcl-1.0.19.ebuild,v 1.3 2008/11/16 16:31:39 flameeyes Exp $
5 EAPI="prefix"
7 inherit eutils flag-o-matic
9 #same order as http://www.sbcl.org/platform-table.html
10 BV_X86=1.0.15
11 BV_AMD64=1.0.15
12 BV_PPC=1.0
13 BV_SPARC=0.9.17
14 BV_ALPHA=0.9.12
15 BV_MIPS=1.0.17
16 BV_MIPSEL=1.0.17
18 BV_PPC_MACOS=0.9.15
19 BV_X86_MACOS=1.0.23
20 BV_X86_SOLARIS=0.9.14
23 DESCRIPTION="Steel Bank Common Lisp (SBCL) is an implementation of ANSI Common Lisp."
24 HOMEPAGE="http://sbcl.sourceforge.net/"
25 SRC_URI="mirror://sourceforge/sbcl/${P}-source.tar.bz2
26 x86? ( mirror://sourceforge/sbcl/${PN}-${BV_X86}-x86-linux-binary.tar.bz2 )
27 amd64? ( mirror://sourceforge/sbcl/${PN}-${BV_AMD64}-x86-64-linux-binary.tar.bz2 )
28 ppc? ( mirror://sourceforge/sbcl/${PN}-${BV_PPC}-powerpc-linux-binary.tar.bz2 )
29 sparc? ( mirror://sourceforge/sbcl/${PN}-${BV_SPARC}-sparc-linux-binary.tar.bz2 )
30 alpha? ( mirror://sourceforge/sbcl/${PN}-${BV_ALPHA}-alpha-linux-binary.tar.bz2 )
31 mips? ( !cobalt? ( mirror://sourceforge/sbcl/${PN}-${BV_MIPS}-mips-linux-binary.tar.bz2 ) )
32 mips? ( cobalt? ( mirror://sourceforge/sbcl/${PN}-${BV_MIPSEL}-mipsel-linux-binary.tar.bz2 ) )
33 ppc-macos? ( mirror://sourceforge/sbcl/${PN}-${BV_PPC_MACOS}-powerpc-darwin-binary.tar.bz2 )
34 x86-macos? ( mirror://sourceforge/sbcl/${PN}-${BV_X86_MACOS}-x86-darwin-binary.tar.bz2 )
35 x86-solaris? ( mirror://sourceforge/sbcl/${PN}-${BV_X86_SOLARIS}-x86-solaris-binary.tar.gz )"
37 # SRC_URI is part of the metadata cache; it's evaluated contents must be independent of the system that creates the metadata cache.
38 # ILLEGAL: mips? ( mirror://sourceforge/sbcl/${PN}-${BV_MIPS}-$([[$(tc-endian) = big]] && echo mips || echo mipsel)-linux-binary.tar.bz2 )
40 LICENSE="MIT"
41 SLOT="0"
43 KEYWORDS="~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris"
45 IUSE="ldb source threads unicode doc cobalt"
47 DEPEND="doc? ( sys-apps/texinfo media-gfx/graphviz )"
49 PDEPEND="dev-lisp/gentoo-init"
51 PROVIDE="virtual/commonlisp"
53 #Disable warnings about executable stacks, as this won't be fixed soon, by
54 #upstream
55 QA_EXECSTACK="usr/bin/sbcl usr/lib/sbcl/src/runtime/sbcl \
56 usr/lib/sbcl/src/runtime/*.o"
58 pkg_setup() {
59 if has_version sys-devel/gcc && built_with_use sys-devel/gcc hardened && gcc-config -c | grep -qv vanilla; then
60 eerror "So-called \"hardened\" compiler features are incompatible with SBCL. You"
61 eerror "must use gcc-config to select a profile with non-hardened features"
62 eerror "(the \"vanilla\" profile) and \"source /etc/profile\" before continuing."
63 die
65 if use !prefix && (use x86 || use amd64) && has_version "<sys-libs/glibc-2.6" \
66 && ! built_with_use sys-libs/glibc nptl; then
67 eerror "Building SBCL without NPTL support on at least x86 and amd64"
68 eerror "architectures is not a supported configuration in Gentoo. Please"
69 eerror "refer to Bug #119016 for more information."
70 die
72 if use doc && ! built_with_use media-gfx/graphviz png; then
73 eerror "media-gfx/graphviz has to be built with png support."
74 die "Missing png USE-flag for media-gfx/graphviz"
78 CONFIG="${S}/customize-target-features.lisp"
79 ENVD="${T}/50sbcl"
81 usep() {
82 use ${1} && echo "true" || echo "false"
85 sbcl_feature() {
86 echo "$( [[ ${1} == "true" ]] && echo "(enable ${2})" || echo "(disable ${2})")" >> "${CONFIG}"
89 sbcl_apply_features() {
90 cat > "${CONFIG}" <<'EOF'
91 (lambda (list)
92 (flet ((enable (x) (pushnew x list))
93 (disable (x) (setf list (remove x list))))
94 EOF
95 if use x86 || use amd64; then
96 sbcl_feature "$(usep threads)" ":sb-thread"
98 sbcl_feature "$(usep ldb)" ":sb-ldb"
99 sbcl_feature "false" ":sb-test"
100 sbcl_feature "$(usep unicode)" ":sb-unicode"
101 cat >> "${CONFIG}" <<'EOF'
103 list)
105 cat "${CONFIG}"
108 src_unpack() {
109 unpack ${A}
110 mv sbcl-*-* sbcl-binary
111 cd "${S}"
113 epatch "${FILESDIR}"/${PN}-1.0.6-solaris.patch
114 # epatch "${FILESDIR}/disable-tests-gentoo-${PV}.patch"
115 use source && sed 's%"$(BUILD_ROOT)%$(MODULE).lisp "$(BUILD_ROOT)%' -i contrib/vanilla-module.mk
117 sed "s,/lib,/$(get_libdir),g" -i "${S}/install.sh"
118 sed "s,/usr/local/lib,${EPREFIX}/usr/$(get_libdir),g" -i "${S}/src/runtime/runtime.c" # #define SBCL_HOME ...
119 sed "s,/etc/sbclrc,${EPREFIX}/etc/sbclrc,g" -i "${S}/src/code/toplevel.lisp" # change location of /etc/sbclrc ...
121 # customizing SBCL version as per
122 # http://sbcl.cvs.sourceforge.net/sbcl/sbcl/doc/PACKAGING-SBCL.txt?view=markup
123 echo -e ";;; Auto-generated by Gentoo\n\"${PVR}-gentoo\"" > "${S}/version.lisp-expr"
125 # applying customizations
126 sbcl_apply_features
128 find "${S}" -type f -name .cvsignore -print0 | xargs -0 rm -f
129 find "${S}" -depth -type d -name CVS -or -name .git -print0 | xargs -0 rm -rf
130 find "${S}" -type f -name \*.c -print0 | xargs -0 chmod 644
133 src_compile() {
134 local bindir="${WORKDIR}"/sbcl-binary
136 append-ldflags -Wl,--no-as-needed # see Bug #132992
138 # clear the environment to get rid of non-ASCII strings, see bug 174702
139 # set HOME for paludis
140 env - HOME="${T}" \
141 PATH="${bindir}/src/runtime:${PATH}" SBCL_HOME="${bindir}/output" GNUMAKE=make ./make.sh \
142 "sbcl --no-sysinit --no-userinit --disable-debugger --core ${bindir}/output/sbcl.core" \
143 || die "make failed"
145 # need to set HOME because libpango(used by graphviz) complains about it
146 if use doc; then
147 env - HOME="${T}" make -C doc/manual info html || die "Cannot build manual"
148 env - HOME="${T}" make -C doc/internals html || die "Cannot build internal docs"
152 src_test() {
153 # FILES="exhaust.impure.lisp"
154 cd tests
155 sh run-tests.sh
156 # sh run-tests.sh ${FILES}
157 # sh run-tests.sh --break-on-failure ${FILES}
160 src_install() {
161 # install system-wide initfile
162 dodir /etc/
163 cat > "${ED}"/etc/sbclrc <<EOF
164 ;;; The following is required if you want source location functions to
165 ;;; work in SLIME, for example.
167 (setf (logical-pathname-translations "SYS")
168 '(("SYS:SRC;**;*.*.*" #p"${EPREFIX}/usr/$(get_libdir)/sbcl/src/**/*.*")
169 ("SYS:CONTRIB;**;*.*.*" #p"${EPREFIX}/usr/$(get_libdir)/sbcl/**/*.*")))
171 ;;; Setup ASDF
172 (load "${EPREFIX}/etc/gentoo-init.lisp")
175 # Install documentation
176 dodir /usr/share/man
177 dodir /usr/share/doc/${PF}
178 unset SBCL_HOME
179 INSTALL_ROOT="${ED}"/usr DOC_DIR="${ED}"/usr/share/doc/${PF} sh install.sh || die "install.sh failed"
181 doman doc/sbcl-asdf-install.1
183 dodoc BUGS CREDITS INSTALL NEWS OPTIMIZATIONS PRINCIPLES README STYLE SUPPORT TLA TODO
185 if use doc; then
186 dohtml doc/html/*
187 doinfo "${S}"/doc/manual/*.info*
188 dohtml -r "${S}"/doc/internals/sbcl-internals
191 # install the SBCL source
192 if use source; then
193 cp -pPR "${S}"/src "${ED}/usr/$(get_libdir)"/sbcl
194 find "${ED}/usr/$(get_libdir)/sbcl/src" -type f -name '*.fasl' -print0 | xargs -0 rm -f
197 # necessary for running newly-saved images
198 echo "SBCL_HOME=${EPREFIX}/usr/$(get_libdir)/${PN}" > "${ENVD}"
199 echo "SBCL_SOURCE_ROOT=${EPREFIX}/usr/$(get_libdir)/${PN}/src" >> "${ENVD}"
200 doenvd "${ENVD}"
202 impl-save-timestamp-hack sbcl
205 pkg_postinst() {
206 standard-impl-postinst sbcl
209 pkg_postrm() {
210 standard-impl-postrm sbcl /usr/bin/sbcl