Gentoo Archives: gentoo-commits

From: Andrey Grozin <grozin@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lisp/clozurecl/files/, dev-lisp/clozurecl/
Date: Tue, 21 Nov 2017 17:09:18
Message-Id: 1511284101.25062be3a7b4ff2c5fbbb7a3f7401c7c8b9b2e09.grozin@gentoo
1 commit: 25062be3a7b4ff2c5fbbb7a3f7401c7c8b9b2e09
2 Author: Andrey Grozin <grozin <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 21 17:08:21 2017 +0000
4 Commit: Andrey Grozin <grozin <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 21 17:08:21 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25062be3
7
8 dev-lisp/clozurecl: add the upstream patch for compatibility with glibc-2.26
9
10 Closes: https://bugs.gentoo.org/638304
11 Package-Manager: Portage-2.3.14, Repoman-2.3.6
12
13 dev-lisp/clozurecl/clozurecl-1.11-r3.ebuild | 102 +++++++++++++++++++++
14 dev-lisp/clozurecl/files/ccl-1.11-glibc-2.26.patch | 41 +++++++++
15 2 files changed, 143 insertions(+)
16
17 diff --git a/dev-lisp/clozurecl/clozurecl-1.11-r3.ebuild b/dev-lisp/clozurecl/clozurecl-1.11-r3.ebuild
18 new file mode 100644
19 index 00000000000..5482af1a6e1
20 --- /dev/null
21 +++ b/dev-lisp/clozurecl/clozurecl-1.11-r3.ebuild
22 @@ -0,0 +1,102 @@
23 +# Copyright 1999-2017 Gentoo Foundation
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=6
27 +
28 +inherit eutils flag-o-matic multilib toolchain-funcs
29 +
30 +MY_PN=ccl
31 +MY_P=${MY_PN}-${PV}
32 +
33 +DESCRIPTION="Common Lisp implementation, derived from Digitool's MCL product"
34 +HOMEPAGE="https://ccl.clozure.com"
35 +SRC_URI="
36 + x86? ( ${HOMEPAGE}/ftp/pub/release/${PV}/${MY_P}-linuxx86.tar.gz )
37 + amd64? ( ${HOMEPAGE}/ftp/pub/release/${PV}/${MY_P}-linuxx86.tar.gz )
38 + arm? ( ${HOMEPAGE}/ftp/pub/release/${PV}/${MY_P}-linuxarm.tar.gz )
39 + x86-macos? ( ${HOMEPAGE}/ftp/pub/release/${PV}/${MY_P}-darwinx86.tar.gz )
40 + x64-macos? ( ${HOMEPAGE}/ftp/pub/release/${PV}/${MY_P}-darwinx86.tar.gz )
41 + x86-solaris? ( ${HOMEPAGE}/ftp/pub/release/${PV}/${MY_P}-solarisx86.tar.gz )
42 + x64-solaris? ( ${HOMEPAGE}/ftp/pub/release/${PV}/${MY_P}-solarisx86.tar.gz )
43 + doc? ( ${HOMEPAGE}/docs/ccl.html )"
44 +
45 +LICENSE="LLGPL-2.1"
46 +SLOT="0"
47 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-macos"
48 +IUSE="doc"
49 +
50 +RDEPEND=">=dev-lisp/asdf-2.33-r3:="
51 +DEPEND="${RDEPEND}"
52 +
53 +S="${WORKDIR}"/${MY_PN}
54 +ENVD="${T}/50ccl"
55 +
56 +src_configure() {
57 + if use x86-macos; then
58 + CCL_RUNTIME=dx86cl; CCL_HEADERS=darwin-x86-headers; CCL_KERNEL=darwinx8632
59 + elif use x64-macos; then
60 + CCL_RUNTIME=dx86cl64; CCL_HEADERS=darwin-x86-headers64; CCL_KERNEL=darwinx8664
61 + elif use x86-solaris; then
62 + CCL_RUNTIME=sx86cl; CCL_HEADERS=solarisx86-headers; CCL_KERNEL=solarisx86
63 + elif use x64-solaris; then
64 + CCL_RUNTIME=sx86cl64; CCL_HEADERS=solarisx64-headers; CCL_KERNEL=solarisx64
65 + elif use x86; then
66 + CCL_RUNTIME=lx86cl; CCL_HEADERS=x86-headers; CCL_KERNEL=linuxx8632
67 + elif use amd64; then
68 + CCL_RUNTIME=lx86cl64; CCL_HEADERS=x86-headers64; CCL_KERNEL=linuxx8664
69 + elif use arm; then
70 + CCL_RUNTIME=armcl; CCL_HEADERS=arm-headers; CCL_KERNEL=linuxarm
71 + elif use ppc; then
72 + CCL_RUNTIME=ppccl; CCL_HEADERS=headers; CCL_KERNEL=linuxppc
73 + elif use ppc64; then
74 + CCL_RUNTIME=ppccl64; CCL_HEADERS=headers64; CCL_KERNEL=linuxppc64
75 + fi
76 +}
77 +
78 +src_prepare() {
79 + default
80 + eapply "${FILESDIR}/${MY_PN}-format.patch"
81 + # bug #638304 https://github.com/Clozure/ccl/commit/a87d61b88e1f48a563335062668970f7e6290ecf
82 + eapply "${FILESDIR}/${MY_P}-glibc-2.26.patch"
83 + # https://lists.clozure.com/pipermail/openmcl-devel/2016-September/011399.html
84 + sed -i "s/-dynamic/-no_pie/" "${S}/lisp-kernel/darwinx8664/Makefile" || die
85 + cp "${EPREFIX}/usr/share/common-lisp/source/asdf/build/asdf.lisp" tools/ || die
86 +}
87 +
88 +src_compile() {
89 + emake -C lisp-kernel/${CCL_KERNEL} clean
90 + emake -C lisp-kernel/${CCL_KERNEL} all CC="$(tc-getCC)"
91 +
92 + unset CCL_DEFAULT_DIRECTORY
93 + ./${CCL_RUNTIME} -n -b -Q -e '(ccl:rebuild-ccl :full t)' -e '(ccl:quit)' || die "Compilation failed"
94 +
95 + # remove non-owner write permissions on the full-image
96 + chmod go-w ${CCL_RUNTIME}{,.image} || die
97 +
98 + esvn_clean
99 +}
100 +
101 +src_install() {
102 + local target_dir="/usr/$(get_libdir)/${PN}"
103 + local prefix_dir="${EPREFIX}/${target_dir#/}"
104 +
105 + mkdir -p "${D}/${prefix_dir#/}"
106 +
107 + find . -type f -name '*fsl' -delete || die
108 + rm -f lisp-kernel/${CCL_KERNEL}/*.o || die
109 + cp -a compiler contrib level-0 level-1 lib library lisp-kernel scripts \
110 + tools xdump ${CCL_HEADERS} ${CCL_RUNTIME} ${CCL_RUNTIME}.image \
111 + "${D}/${prefix_dir#/}" || die
112 +
113 + echo "CCL_DEFAULT_DIRECTORY=${prefix_dir}" > "${ENVD}"
114 + doenvd "${ENVD}"
115 +
116 + dosym "${target_dir}/${CCL_RUNTIME}" /usr/bin/ccl
117 + dodoc doc/release-notes.txt
118 +
119 + if use doc ; then
120 + dodoc "${DISTDIR}/ccl.html"
121 + dodoc -r doc/manual
122 + dodoc -r examples
123 + fi
124 +}
125
126 diff --git a/dev-lisp/clozurecl/files/ccl-1.11-glibc-2.26.patch b/dev-lisp/clozurecl/files/ccl-1.11-glibc-2.26.patch
127 new file mode 100644
128 index 00000000000..3a9bdf64e54
129 --- /dev/null
130 +++ b/dev-lisp/clozurecl/files/ccl-1.11-glibc-2.26.patch
131 @@ -0,0 +1,41 @@
132 +diff -U2 -r ccl.orig/lisp-kernel/platform-linuxx8632.h ccl/lisp-kernel/platform-linuxx8632.h
133 +--- ccl.orig/lisp-kernel/platform-linuxx8632.h 2015-11-07 02:10:11.000000000 +0600
134 ++++ ccl/lisp-kernel/platform-linuxx8632.h 2017-11-21 23:50:31.630113003 +0700
135 +@@ -21,5 +21,7 @@
136 + #define PLATFORM_WORD_SIZE PLATFORM_WORD_SIZE_32
137 +
138 +-typedef struct ucontext ExceptionInformation;
139 ++#include <ucontext.h>
140 ++
141 ++typedef ucontext_t ExceptionInformation;
142 +
143 + #define MAXIMUM_MAPPABLE_MEMORY (9U<<28)
144 +diff -U2 -r ccl.orig/lisp-kernel/platform-linuxx8664.h ccl/lisp-kernel/platform-linuxx8664.h
145 +--- ccl.orig/lisp-kernel/platform-linuxx8664.h 2015-11-07 02:10:11.000000000 +0600
146 ++++ ccl/lisp-kernel/platform-linuxx8664.h 2017-11-21 23:51:44.693114350 +0700
147 +@@ -21,5 +21,7 @@
148 + #define PLATFORM_WORD_SIZE PLATFORM_WORD_SIZE_64
149 +
150 +-typedef struct ucontext ExceptionInformation;
151 ++#include <ucontext.h>
152 ++
153 ++typedef ucontext_t ExceptionInformation;
154 +
155 + #define MAXIMUM_MAPPABLE_MEMORY (512L<<30L)
156 +diff -U2 -r ccl.orig/lisp-kernel/x86-exceptions.c ccl/lisp-kernel/x86-exceptions.c
157 +--- ccl.orig/lisp-kernel/x86-exceptions.c 2015-11-07 02:10:11.000000000 +0600
158 ++++ ccl/lisp-kernel/x86-exceptions.c 2017-11-21 23:55:00.816117965 +0700
159 +@@ -1678,5 +1678,5 @@
160 + void *puc;
161 + siginfo_t info;
162 +- struct ucontext uc;
163 ++ ucontext_t uc;
164 + struct _fpstate fpstate;
165 + char retcode[8];
166 +@@ -2426,5 +2426,5 @@
167 + change copy_ucontext().
168 + */
169 +- stack.ss_size -= sizeof(struct ucontext);
170 ++ stack.ss_size -= sizeof(ucontext_t);
171 + #endif
172 + if (sigaltstack(&stack, NULL) != 0) {