app-admin/ansible: 2.5.3 for realz and fix 2.5.2 stable
[gentoo.git] / dev-lisp / clozurecl / clozurecl-1.11.5.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit eutils flag-o-matic multilib toolchain-funcs
7
8 MY_PN=ccl
9 MY_P=${MY_PN}-${PV}
10
11 DESCRIPTION="Common Lisp implementation, derived from Digitool's MCL product"
12 HOMEPAGE="https://ccl.clozure.com"
13 SRC_URI="
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 )"
22
23 LICENSE="Apache-2.0"
24 SLOT="0"
25 KEYWORDS="~amd64 x86 ~amd64-linux ~x86-linux ~x64-macos"
26 IUSE="doc"
27
28 RDEPEND=">=dev-lisp/asdf-2.33-r3:="
29 DEPEND="${RDEPEND}"
30
31 S="${WORKDIR}"/${MY_PN}
32 ENVD="${T}/50ccl"
33
34 src_prepare() {
35         default
36         cp "${EPREFIX}/usr/share/common-lisp/source/asdf/build/asdf.lisp" tools/ || die
37 }
38
39 src_configure() {
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
48         elif use x86; then
49                 CCL_RUNTIME=lx86cl; CCL_HEADERS=x86-headers; CCL_KERNEL=linuxx8632
50         elif use amd64; then
51                 CCL_RUNTIME=lx86cl64; CCL_HEADERS=x86-headers64; CCL_KERNEL=linuxx8664
52         elif use arm; then
53                 CCL_RUNTIME=armcl; CCL_HEADERS=arm-headers; CCL_KERNEL=linuxarm
54         elif use ppc; then
55                 CCL_RUNTIME=ppccl; CCL_HEADERS=headers; CCL_KERNEL=linuxppc
56         elif use ppc64; then
57                 CCL_RUNTIME=ppccl64; CCL_HEADERS=headers64; CCL_KERNEL=linuxppc64
58         fi
59 }
60
61 src_compile() {
62         emake -C lisp-kernel/${CCL_KERNEL} clean
63         emake -C lisp-kernel/${CCL_KERNEL} all CC="$(tc-getCC)"
64
65         unset CCL_DEFAULT_DIRECTORY
66         ./${CCL_RUNTIME} -n -b -Q -e '(ccl:rebuild-ccl :full t)' -e '(ccl:quit)' || die "Compilation failed"
67
68         # remove non-owner write permissions on the full-image
69         chmod go-w ${CCL_RUNTIME}{,.image} || die
70
71         esvn_clean
72 }
73
74 src_install() {
75         local target_dir="/usr/$(get_libdir)/${PN}"
76         local prefix_dir="${EPREFIX}/${target_dir#/}"
77
78         mkdir -p "${D}/${prefix_dir#/}"
79
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
85
86         echo "CCL_DEFAULT_DIRECTORY=${prefix_dir}" > "${ENVD}"
87         doenvd "${ENVD}"
88
89         dosym "${target_dir}/${CCL_RUNTIME}" /usr/bin/ccl
90         dodoc doc/release-notes.txt
91
92         if use doc ; then
93                 dodoc "${DISTDIR}/ccl.html"
94                 dodoc -r doc/manual
95                 dodoc -r examples
96         fi
97 }