1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils flag-o-matic multilib toolchain-funcs
11 DESCRIPTION="Common Lisp implementation, derived from Digitool's MCL product"
12 HOMEPAGE="https://ccl.clozure.com"
14 x86? ( https://github.com/Clozure/ccl/releases/download/v${PV}/${MY_P}-linuxx86.tar.gz )
15 amd64? ( https://github.com/Clozure/ccl/releases/download/v${PV}/${MY_P}-linuxx86.tar.gz )
16 arm? ( https://github.com/Clozure/ccl/releases/download/v${PV}/${MY_P}-linuxarm.tar.gz )
17 x86-macos? ( https://github.com/Clozure/ccl/releases/download/v${PV}/${MY_P}-darwinx86.tar.gz )
18 x64-macos? ( https://github.com/Clozure/ccl/releases/download/v${PV}/${MY_P}-darwinx86.tar.gz )
19 x86-solaris? ( https://github.com/Clozure/ccl/releases/download/v${PV}/${MY_P}-solarisx86.tar.gz )
20 x64-solaris? ( https://github.com/Clozure/ccl/releases/download/v${PV}/${MY_P}-solarisx86.tar.gz )
21 doc? ( ${HOMEPAGE}/docs/ccl.html )"
25 KEYWORDS="~amd64 x86 ~amd64-linux ~x86-linux ~x64-macos"
28 RDEPEND=">=dev-lisp/asdf-2.33-r3:="
31 S="${WORKDIR}"/${MY_PN}
36 cp "${EPREFIX}/usr/share/common-lisp/source/asdf/build/asdf.lisp" tools/ || die
40 if use x86-macos; then
41 CCL_RUNTIME=dx86cl; CCL_HEADERS=darwin-x86-headers; CCL_KERNEL=darwinx8632
42 elif use x64-macos; then
43 CCL_RUNTIME=dx86cl64; CCL_HEADERS=darwin-x86-headers64; CCL_KERNEL=darwinx8664
44 elif use x86-solaris; then
45 CCL_RUNTIME=sx86cl; CCL_HEADERS=solarisx86-headers; CCL_KERNEL=solarisx86
46 elif use x64-solaris; then
47 CCL_RUNTIME=sx86cl64; CCL_HEADERS=solarisx64-headers; CCL_KERNEL=solarisx64
49 CCL_RUNTIME=lx86cl; CCL_HEADERS=x86-headers; CCL_KERNEL=linuxx8632
51 CCL_RUNTIME=lx86cl64; CCL_HEADERS=x86-headers64; CCL_KERNEL=linuxx8664
53 CCL_RUNTIME=armcl; CCL_HEADERS=arm-headers; CCL_KERNEL=linuxarm
55 CCL_RUNTIME=ppccl; CCL_HEADERS=headers; CCL_KERNEL=linuxppc
57 CCL_RUNTIME=ppccl64; CCL_HEADERS=headers64; CCL_KERNEL=linuxppc64
62 emake -C lisp-kernel/${CCL_KERNEL} clean
63 emake -C lisp-kernel/${CCL_KERNEL} all CC="$(tc-getCC)"
65 unset CCL_DEFAULT_DIRECTORY
66 ./${CCL_RUNTIME} -n -b -Q -e '(ccl:rebuild-ccl :full t)' -e '(ccl:quit)' || die "Compilation failed"
68 # remove non-owner write permissions on the full-image
69 chmod go-w ${CCL_RUNTIME}{,.image} || die
75 local target_dir="/usr/$(get_libdir)/${PN}"
76 local prefix_dir="${EPREFIX}/${target_dir#/}"
78 mkdir -p "${D}/${prefix_dir#/}"
80 find . -type f -name '*fsl' -delete || die
81 rm -f lisp-kernel/${CCL_KERNEL}/*.o || die
82 cp -a compiler level-0 level-1 lib library lisp-kernel scripts \
83 tools xdump ${CCL_HEADERS} ${CCL_RUNTIME} ${CCL_RUNTIME}.image \
84 "${D}/${prefix_dir#/}" || die
86 echo "CCL_DEFAULT_DIRECTORY=${prefix_dir}" > "${ENVD}"
89 dosym "${target_dir}/${CCL_RUNTIME}" /usr/bin/ccl
90 dodoc doc/release-notes.txt
93 dodoc "${DISTDIR}/ccl.html"