media-libs/portaudio: Version bump
[gentoo.git] / dev-lisp / clozurecl / clozurecl-1.11-r1.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=6
6
7 inherit eutils multilib toolchain-funcs
8
9 MY_PN=ccl
10 MY_P=${MY_PN}-${PV}
11
12 DESCRIPTION="Common Lisp implementation, derived from Digitool's MCL product"
13 HOMEPAGE="http://ccl.clozure.com/"
14 SRC_URI="
15         x86?   ( ftp://ftp.clozure.com/pub/release/${PV}/${MY_P}-linuxx86.tar.gz )
16         amd64? ( ftp://ftp.clozure.com/pub/release/${PV}/${MY_P}-linuxx86.tar.gz )
17         doc? ( http://ccl.clozure.com/docs/ccl.html )"
18         # ppc?   ( ftp://ftp.clozure.com/pub/release/${PV}/${MY_P}-linuxppc.tar.gz )
19         # ppc64? ( ftp://ftp.clozure.com/pub/release/${PV}/${MY_P}-linuxppc.tar.gz )"
20
21 LICENSE="LLGPL-2.1"
22 SLOT="0"
23 # KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
24 KEYWORDS="~amd64 ~x86"
25 IUSE="doc"
26
27 RDEPEND=">=dev-lisp/asdf-2.33-r3:="
28 DEPEND="${RDEPEND}
29                 !dev-lisp/openmcl"
30
31 S="${WORKDIR}"/${MY_PN}
32 ENVD="${T}"/50ccl
33
34 src_configure() {
35         if use x86; then
36                 CCL_RUNTIME=lx86cl; CCL_HEADERS=x86-headers; CCL_KERNEL=linuxx8632
37         elif use amd64; then
38                 CCL_RUNTIME=lx86cl64; CCL_HEADERS=x86-headers64; CCL_KERNEL=linuxx8664
39         elif use ppc; then
40                 CCL_RUNTIME=ppccl; CCL_HEADERS=headers; CCL_KERNEL=linuxppc
41         elif use ppc64; then
42                 CCL_RUNTIME=ppccl64; CCL_HEADERS=headers64; CCL_KERNEL=linuxppc64
43         fi
44 }
45
46 src_prepare() {
47         default
48         epatch "${FILESDIR}"/ccl-format.patch
49         cp /usr/share/common-lisp/source/asdf/build/asdf.lisp tools/ || die
50 }
51
52 src_compile() {
53         emake -C lisp-kernel/${CCL_KERNEL} clean
54         emake -C lisp-kernel/${CCL_KERNEL} all CC="$(tc-getCC)"
55
56         unset CCL_DEFAULT_DIRECTORY
57         ./${CCL_RUNTIME} -n -b -Q -e '(ccl:rebuild-ccl :full t)' -e '(ccl:quit)' || die "Compilation failed"
58
59         # remove non-owner write permissions on the full-image
60         chmod go-w ${CCL_RUNTIME}{,.image} || die
61
62         esvn_clean
63 }
64
65 src_install() {
66         local install_dir=/usr/$(get_libdir)/${PN}
67
68         exeinto ${install_dir}
69         # install executable
70         doexe ${CCL_RUNTIME}
71         # install core image
72         cp ${CCL_RUNTIME}.image "${D}"/${install_dir} || die
73         # install optional libraries
74         dodir ${install_dir}/tools
75         cp tools/*fsl "${D}"/${install_dir}/tools || die
76
77         # until we figure out which source files are necessary for runtime
78         # optional features and which aren't, we install all sources
79         find . -type f -name '*fsl' -delete || die
80         rm -f lisp-kernel/${CCL_KERNEL}/*.o || die
81         cp -a compiler level-0 level-1 lib library \
82                 lisp-kernel scripts tools xdump contrib \
83                 "${D}"/${install_dir} || die
84         cp -a ${CCL_HEADERS} "${D}"/${install_dir} || die
85
86         make_wrapper ccl "${install_dir}/${CCL_RUNTIME}"
87
88         echo "CCL_DEFAULT_DIRECTORY=${install_dir}" > "${ENVD}"
89         doenvd "${ENVD}"
90
91         dodoc doc/release-notes.txt
92         use doc && dodoc "${DISTDIR}"/ccl.html
93         use doc && dodoc -r examples
94 }