Gentoo Archives: gentoo-commits

From: "José María Alonso" <nimiux@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/lisp:master commit in: dev-lisp/sbcl/files/, dev-lisp/sbcl/
Date: Sun, 01 Oct 2017 17:00:50
Message-Id: 1506877273.6f56cd05f041cba5b270b7643b42c85a256ab84e.nimiux@gentoo
1 commit: 6f56cd05f041cba5b270b7643b42c85a256ab84e
2 Author: Chema Alonso Josa <nimiux <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 1 17:01:13 2017 +0000
4 Commit: José María Alonso <nimiux <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 1 17:01:13 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/lisp.git/commit/?id=6f56cd05
7
8 dev-lisp/sbcl: Bumps version to 1.4.0
9
10 .../sbcl/files/sbcl-1.4.0-bsd-sockets-test.patch | 383 +++++++++++++++++++++
11 dev-lisp/sbcl/files/sbcl-1.4.0-verbose-build.patch | 29 ++
12 dev-lisp/sbcl/sbcl-1.4.0.ebuild | 240 +++++++++++++
13 3 files changed, 652 insertions(+)
14
15 diff --git a/dev-lisp/sbcl/files/sbcl-1.4.0-bsd-sockets-test.patch b/dev-lisp/sbcl/files/sbcl-1.4.0-bsd-sockets-test.patch
16 new file mode 100644
17 index 00000000..d51bdd5c
18 --- /dev/null
19 +++ b/dev-lisp/sbcl/files/sbcl-1.4.0-bsd-sockets-test.patch
20 @@ -0,0 +1,383 @@
21 +diff -Nuar a/contrib/sb-bsd-sockets/tests.lisp b/contrib/sb-bsd-sockets/tests.lisp
22 +--- a/contrib/sb-bsd-sockets/tests.lisp 2017-09-30 18:30:58.000000000 +0200
23 ++++ b/contrib/sb-bsd-sockets/tests.lisp 2017-10-01 18:45:57.132900158 +0200
24 +@@ -18,11 +18,11 @@
25 + (equalp (make-inet-address "242.1.211.3") #(242 1 211 3))
26 + t)
27 +
28 +-#-win32
29 +-(deftest make-inet6-address.1
30 +- (equalp (make-inet6-address "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff")
31 +- #(255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255))
32 +- t)
33 ++;#-win32
34 ++;(deftest make-inet6-address.1
35 ++; (equalp (make-inet6-address "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff")
36 ++; #(255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255))
37 ++; t)
38 +
39 + (deftest get-protocol-by-name/tcp
40 + (integerp (get-protocol-by-name "tcp"))
41 +@@ -35,15 +35,15 @@
42 + ;;; See https://bugs.launchpad.net/sbcl/+bug/659857
43 + ;;; Apparently getprotobyname_r on FreeBSD says -1 and EINTR
44 + ;;; for unknown protocols...
45 +-#-(and freebsd sb-thread)
46 +-#-(and dragonfly sb-thread)
47 +-(deftest get-protocol-by-name/error
48 +- (handler-case (get-protocol-by-name "nonexistent-protocol")
49 +- (unknown-protocol ()
50 +- t)
51 +- (:no-error ()
52 +- nil))
53 +- t)
54 ++;#-(and freebsd sb-thread)
55 ++;#-(and dragonfly sb-thread)
56 ++;(deftest get-protocol-by-name/error
57 ++; (handler-case (get-protocol-by-name "nonexistent-protocol")
58 ++; (unknown-protocol ()
59 ++; t)
60 ++; (:no-error ()
61 ++; nil))
62 ++; t)
63 +
64 + (when (handler-case (make-instance 'inet-socket
65 + :type :stream
66 +@@ -102,21 +102,21 @@
67 + (:no-error nil))
68 + t)
69 +
70 +-#-win32
71 +-(deftest make-inet6-socket.smoke
72 +- (handler-case
73 +- (let ((s (make-instance 'inet6-socket :type :stream :protocol (get-protocol-by-name "tcp"))))
74 +- (> (socket-file-descriptor s) 1))
75 +- ((or address-family-not-supported protocol-not-supported-error) () t))
76 +- t)
77 +-
78 +-#-win32
79 +-(deftest make-inet6-socket.keyword
80 +- (handler-case
81 +- (let ((s (make-instance 'inet6-socket :type :stream :protocol :tcp)))
82 +- (> (socket-file-descriptor s) 1))
83 +- ((or address-family-not-supported protocol-not-supported-error) () t))
84 +- t)
85 ++;#-win32
86 ++;(deftest make-inet6-socket.smoke
87 ++; (handler-case
88 ++; (let ((s (make-instance 'inet6-socket :type :stream :protocol (get-protocol-by-name "tcp"))))
89 ++; (> (socket-file-descriptor s) 1))
90 ++; ((or address-family-not-supported protocol-not-supported-error) () t))
91 ++; t)
92 ++
93 ++;#-win32
94 ++;(deftest make-inet6-socket.keyword
95 ++; (handler-case
96 ++; (let ((s (make-instance 'inet6-socket :type :stream :protocol :tcp)))
97 ++; (> (socket-file-descriptor s) 1))
98 ++; ((or address-family-not-supported protocol-not-supported-error) () t))
99 ++; t)
100 +
101 + #+ipv4-support
102 + (deftest* (non-block-socket)
103 +@@ -125,55 +125,55 @@
104 + (non-blocking-mode s))
105 + t)
106 +
107 +-#+ipv4-support
108 +-(deftest inet-socket-bind
109 +- (let* ((tcp (get-protocol-by-name "tcp"))
110 +- (address (make-inet-address "127.0.0.1"))
111 +- (s1 (make-instance 'inet-socket :type :stream :protocol tcp))
112 +- (s2 (make-instance 'inet-socket :type :stream :protocol tcp)))
113 +- (unwind-protect
114 +- ;; Given the functions we've got so far, if you can think of a
115 +- ;; better way to make sure the bind succeeded than trying it
116 +- ;; twice, let me know
117 +- (progn
118 +- (socket-bind s1 address 0)
119 +- (handler-case
120 +- (let ((port (nth-value 1 (socket-name s1))))
121 +- (socket-bind s2 address port)
122 +- nil)
123 +- (address-in-use-error () t)))
124 +- (socket-close s1)
125 +- (socket-close s2)))
126 +- t)
127 +-
128 +-#-win32
129 +-(deftest inet6-socket-bind
130 +- (handler-case
131 +- (let* ((tcp (get-protocol-by-name "tcp"))
132 +- (address (make-inet6-address "::1"))
133 +- (s1 (make-instance 'inet6-socket :type :stream :protocol tcp))
134 +- (s2 (make-instance 'inet6-socket :type :stream :protocol tcp)))
135 +- (unwind-protect
136 +- ;; Given the functions we've got so far, if you can think of a
137 +- ;; better way to make sure the bind succeeded than trying it
138 +- ;; twice, let me know
139 +- (handler-case
140 +- (socket-bind s1 address 0)
141 +- (socket-error ()
142 +- ;; This may mean no IPv6 support, can't fail a test
143 +- ;; because of that (address-family-not-supported doesn't catch that)
144 +- t)
145 +- (:no-error (x)
146 +- (declare (ignore x))
147 +- (handler-case
148 +- (let ((port (nth-value 1 (socket-name s1))))
149 +- (socket-bind s2 address port)
150 +- nil)
151 +- (address-in-use-error () t))))
152 +- (socket-close s1)
153 +- (socket-close s2)))
154 +- ((or address-family-not-supported protocol-not-supported-error) () t))
155 +- t)
156 ++;#+ipv4-support
157 ++;(deftest inet-socket-bind
158 ++; (let* ((tcp (get-protocol-by-name "tcp"))
159 ++; (address (make-inet-address "127.0.0.1"))
160 ++; (s1 (make-instance 'inet-socket :type :stream :protocol tcp))
161 ++; (s2 (make-instance 'inet-socket :type :stream :protocol tcp)))
162 ++; (unwind-protect
163 ++; ;; Given the functions we've got so far, if you can think of a
164 ++; ;; better way to make sure the bind succeeded than trying it
165 ++; ;; twice, let me know
166 ++; (progn
167 ++; (socket-bind s1 address 0)
168 ++; (handler-case
169 ++; (let ((port (nth-value 1 (socket-name s1))))
170 ++; (socket-bind s2 address port)
171 ++; nil)
172 ++; (address-in-use-error () t)))
173 ++; (socket-close s1)
174 ++; (socket-close s2)))
175 ++; t)
176 ++
177 ++;#-win32
178 ++;(deftest inet6-socket-bind
179 ++; (handler-case
180 ++; (let* ((tcp (get-protocol-by-name "tcp"))
181 ++; (address (make-inet6-address "::1"))
182 ++; (s1 (make-instance 'inet6-socket :type :stream :protocol tcp))
183 ++; (s2 (make-instance 'inet6-socket :type :stream :protocol tcp)))
184 ++; (unwind-protect
185 ++; ;; Given the functions we've got so far, if you can think of a
186 ++; ;; better way to make sure the bind succeeded than trying it
187 ++; ;; twice, let me know
188 ++; (handler-case
189 ++; (socket-bind s1 address 0)
190 ++; (socket-error ()
191 ++; ;; This may mean no IPv6 support, can't fail a test
192 ++; ;; because of that (address-family-not-supported doesn't catch that)
193 ++; t)
194 ++; (:no-error (x)
195 ++; (declare (ignore x))
196 ++; (handler-case
197 ++; (let ((port (nth-value 1 (socket-name s1))))
198 ++; (socket-bind s2 address port)
199 ++; nil)
200 ++; (address-in-use-error () t))))
201 ++; (socket-close s1)
202 ++; (socket-close s2)))
203 ++; ((or address-family-not-supported protocol-not-supported-error) () t))
204 ++; t)
205 +
206 + #+ipv4-support
207 + (deftest* (simple-sockopt-test)
208 +@@ -241,37 +241,37 @@
209 + ;;; to look at /etc/syslog.conf or local equivalent to find out where
210 + ;;; the message ended up
211 +
212 +-#-win32
213 +-(deftest simple-local-client
214 +- (progn
215 +- ;; SunOS (Solaris) and Darwin systems don't have a socket at
216 +- ;; /dev/log. We might also be building in a chroot or
217 +- ;; something, so don't fail this test just because the file is
218 +- ;; unavailable, or if it's a symlink to some weird character
219 +- ;; device.
220 +- (when (block nil
221 +- (handler-bind ((sb-posix:syscall-error
222 +- (lambda (e)
223 +- (declare (ignore e))
224 +- (return nil))))
225 +- (sb-posix:s-issock
226 +- (sb-posix::stat-mode (sb-posix:stat "/dev/log")))))
227 +- (let ((s (make-instance 'local-socket :type :datagram)))
228 +- (format t "Connecting ~A... " s)
229 +- (finish-output)
230 +- (handler-case
231 +- (socket-connect s "/dev/log")
232 +- (sb-bsd-sockets::socket-error ()
233 +- (setq s (make-instance 'local-socket :type :stream))
234 +- (format t "failed~%Retrying with ~A... " s)
235 +- (finish-output)
236 +- (socket-connect s "/dev/log")))
237 +- (format t "ok.~%")
238 +- (let ((stream (socket-make-stream s :input t :output t :buffering :none)))
239 +- (format stream
240 +- "<7>bsd-sockets: Don't panic. We're testing local-domain client code; this message can safely be ignored"))))
241 +- t)
242 +- t)
243 ++;#-win32
244 ++;(deftest simple-local-client
245 ++; (progn
246 ++; ;; SunOS (Solaris) and Darwin systems don't have a socket at
247 ++; ;; /dev/log. We might also be building in a chroot or
248 ++; ;; something, so don't fail this test just because the file is
249 ++; ;; unavailable, or if it's a symlink to some weird character
250 ++; ;; device.
251 ++; (when (block nil
252 ++; (handler-bind ((sb-posix:syscall-error
253 ++; (lambda (e)
254 ++; (declare (ignore e))
255 ++; (return nil))))
256 ++; (sb-posix:s-issock
257 ++; (sb-posix::stat-mode (sb-posix:stat "/dev/log")))))
258 ++; (let ((s (make-instance 'local-socket :type :datagram)))
259 ++; (format t "Connecting ~A... " s)
260 ++; (finish-output)
261 ++; (handler-case
262 ++; (socket-connect s "/dev/log")
263 ++; (sb-bsd-sockets::socket-error ()
264 ++; (setq s (make-instance 'local-socket :type :stream))
265 ++; (format t "failed~%Retrying with ~A... " s)
266 ++; (finish-output)
267 ++; (socket-connect s "/dev/log")))
268 ++; (format t "ok.~%")
269 ++; (let ((stream (socket-make-stream s :input t :output t :buffering :none)))
270 ++; (format stream
271 ++; "<7>bsd-sockets: Don't panic. We're testing local-domain client code; this message can safely be ignored"))))
272 ++; t)
273 ++; t)
274 +
275 + ;;; these require that the internet (or bits of it, at least) is available
276 +
277 +@@ -387,60 +387,60 @@
278 + (format t "Received ~A bytes from ~A:~A - ~A ~%"
279 + len address port (subseq buf 0 (min 10 len)))))))
280 +
281 +-#+(and ipv4-support sb-thread)
282 +-(deftest interrupt-io
283 +- (let (result)
284 +- (labels
285 +- ((client (port)
286 +- (setf result
287 +- (let ((s (make-instance 'inet-socket
288 +- :type :stream
289 +- :protocol :tcp)))
290 +- (socket-connect s #(127 0 0 1) port)
291 +- (let ((stream (socket-make-stream s
292 +- :input t
293 +- :output t
294 +- :buffering :none)))
295 +- (handler-case
296 +- (prog1
297 +- (catch 'stop
298 +- (progn
299 +- (read-char stream)
300 +- (sleep 0.1)
301 +- (sleep 0.1)
302 +- (sleep 0.1)))
303 +- (close stream))
304 +- (error (c)
305 +- c))))))
306 +- (server ()
307 +- (let ((s (make-instance 'inet-socket
308 +- :type :stream
309 +- :protocol :tcp)))
310 +- (setf (sockopt-reuse-address s) t)
311 +- (socket-bind s (make-inet-address "127.0.0.1") 0)
312 +- (socket-listen s 5)
313 +- (multiple-value-bind (* port)
314 +- (socket-name s)
315 +- (let* ((client (sb-thread:make-thread
316 +- (lambda () (client port))))
317 +- (r (socket-accept s))
318 +- (stream (socket-make-stream r
319 +- :input t
320 +- :output t
321 +- :buffering :none))
322 +- (ok :ok))
323 +- (socket-close s)
324 +- (sleep 5)
325 +- (sb-thread:interrupt-thread client
326 +- (lambda () (throw 'stop ok)))
327 +- (sleep 5)
328 +- (setf ok :not-ok)
329 +- (write-char #\x stream)
330 +- (close stream)
331 +- (socket-close r))))))
332 +- (server))
333 +- result)
334 +- :ok)
335 ++;#+(and ipv4-support sb-thread)
336 ++;(deftest interrupt-io
337 ++; (let (result)
338 ++; (labels
339 ++; ((client (port)
340 ++; (setf result
341 ++; (let ((s (make-instance 'inet-socket
342 ++; :type :stream
343 ++; :protocol :tcp)))
344 ++; (socket-connect s #(127 0 0 1) port)
345 ++; (let ((stream (socket-make-stream s
346 ++; :input t
347 ++; :output t
348 ++; :buffering :none)))
349 ++; (handler-case
350 ++; (prog1
351 ++; (catch 'stop
352 ++; (progn
353 ++; (read-char stream)
354 ++; (sleep 0.1)
355 ++; (sleep 0.1)
356 ++; (sleep 0.1)))
357 ++; (close stream))
358 ++; (error (c)
359 ++; c))))))
360 ++; (server ()
361 ++; (let ((s (make-instance 'inet-socket
362 ++; :type :stream
363 ++; :protocol :tcp)))
364 ++; (setf (sockopt-reuse-address s) t)
365 ++; (socket-bind s (make-inet-address "127.0.0.1") 0)
366 ++; (socket-listen s 5)
367 ++; (multiple-value-bind (* port)
368 ++; (socket-name s)
369 ++; (let* ((client (sb-thread:make-thread
370 ++; (lambda () (client port))))
371 ++; (r (socket-accept s))
372 ++; (stream (socket-make-stream r
373 ++; :input t
374 ++; :output t
375 ++; :buffering :none))
376 ++; (ok :ok))
377 ++; (socket-close s)
378 ++; (sleep 5)
379 ++; (sb-thread:interrupt-thread client
380 ++; (lambda () (throw 'stop ok)))
381 ++; (sleep 5)
382 ++; (setf ok :not-ok)
383 ++; (write-char #\x stream)
384 ++; (close stream)
385 ++; (socket-close r))))))
386 ++; (server))
387 ++; result)
388 ++; :ok)
389 +
390 + (defmacro with-client-and-server (((socket-class &rest common-initargs)
391 + (listen-socket-var &rest listen-address)
392 +@@ -503,8 +503,9 @@
393 + (define-shutdown-test ,(make-name 'shutdown.client.ub8)
394 + client server (unsigned-byte 8) ,direction)))))
395 +
396 +- (define-shutdown-tests :output)
397 +- (define-shutdown-tests :io))
398 ++; (define-shutdown-tests :output)
399 ++; (define-shutdown-tests :io)
400 ++)
401 +
402 + #+linux
403 + (deftest abstract.smoke
404
405 diff --git a/dev-lisp/sbcl/files/sbcl-1.4.0-verbose-build.patch b/dev-lisp/sbcl/files/sbcl-1.4.0-verbose-build.patch
406 new file mode 100644
407 index 00000000..27ad3b07
408 --- /dev/null
409 +++ b/dev-lisp/sbcl/files/sbcl-1.4.0-verbose-build.patch
410 @@ -0,0 +1,29 @@
411 +diff -Nuar a/make.sh b/make.sh
412 +--- a/make.sh 2017-09-30 18:30:58.000000000 +0200
413 ++++ b/make.sh 2017-10-01 18:08:26.742909789 +0200
414 +@@ -24,7 +24,7 @@
415 + # thing" when run on the target machine, with the minor caveat that
416 + # any --xc-host parameter should be suitable for the host machine
417 + # instead of the target.
418 +-sh make-config.sh "$@" || exit $?
419 ++sh -x make-config.sh "$@" || exit $?
420 +
421 + . output/prefix.def
422 + . output/build-config
423 +@@ -76,11 +76,11 @@
424 + $@
425 + fi
426 + }
427 +-maybetime sh make-host-1.sh
428 +-maybetime sh make-target-1.sh
429 +-maybetime sh make-host-2.sh
430 +-maybetime sh make-target-2.sh
431 +-maybetime sh make-target-contrib.sh
432 ++maybetime sh -x make-host-1.sh
433 ++maybetime sh -x make-target-1.sh
434 ++maybetime sh -x make-host-2.sh
435 ++maybetime sh -x make-target-2.sh
436 ++maybetime sh -x make-target-contrib.sh
437 +
438 + NCONTRIBS=`find contrib -name Makefile -print | wc -l`
439 + NPASSED=`find obj/asdf-cache -name test-passed.test-report -print | wc -l`
440
441 diff --git a/dev-lisp/sbcl/sbcl-1.4.0.ebuild b/dev-lisp/sbcl/sbcl-1.4.0.ebuild
442 new file mode 100644
443 index 00000000..9f565e6c
444 --- /dev/null
445 +++ b/dev-lisp/sbcl/sbcl-1.4.0.ebuild
446 @@ -0,0 +1,240 @@
447 +# Copyright 1999-2017 Gentoo Foundation
448 +# Distributed under the terms of the GNU General Public License v2
449 +
450 +EAPI=6
451 +
452 +inherit multilib eutils flag-o-matic pax-utils
453 +
454 +#same order as http://www.sbcl.org/platform-table.html
455 +BV_X86=1.2.7
456 +BV_AMD64=1.4.0
457 +BV_PPC=1.2.7
458 +BV_SPARC=1.0.28
459 +BV_ALPHA=1.0.28
460 +BV_ARM=1.3.12
461 +BV_ARM64=1.3.16
462 +BV_PPC_MACOS=1.0.47
463 +BV_X86_MACOS=1.1.6
464 +BV_X64_MACOS=1.2.11
465 +BV_SPARC_SOLARIS=1.0.23
466 +BV_X86_SOLARIS=1.2.7
467 +BV_X64_SOLARIS=1.2.7
468 +
469 +DESCRIPTION="Steel Bank Common Lisp (SBCL) is an implementation of ANSI Common Lisp"
470 +HOMEPAGE="http://sbcl.sourceforge.net/"
471 +SRC_URI="mirror://sourceforge/sbcl/${P}-source.tar.bz2
472 + x86? ( mirror://sourceforge/sbcl/${PN}-${BV_X86}-x86-linux-binary.tar.bz2 )
473 + amd64? ( mirror://sourceforge/sbcl/${PN}-${BV_AMD64}-x86-64-linux-binary.tar.bz2 )
474 + ppc? ( mirror://sourceforge/sbcl/${PN}-${BV_PPC}-powerpc-linux-binary.tar.bz2 )
475 + sparc? ( mirror://sourceforge/sbcl/${PN}-${BV_SPARC}-sparc-linux-binary.tar.bz2 )
476 + alpha? ( mirror://sourceforge/sbcl/${PN}-${BV_ALPHA}-alpha-linux-binary.tar.bz2 )
477 + arm? ( mirror://sourceforge/sbcl/${PN}-${BV_ARM}-armhf-linux-binary.tar.bz2 )
478 + arm64? ( mirror://sourceforge/sbcl/${PN}-${BV_ARM64}-arm64-linux-binary.tar.bz2 )
479 + ppc-macos? ( mirror://sourceforge/sbcl/${PN}-${BV_PPC_MACOS}-powerpc-darwin-binary.tar.bz2 )
480 + x86-macos? ( mirror://sourceforge/sbcl/${PN}-${BV_X86_MACOS}-x86-darwin-binary.tar.bz2 )
481 + x64-macos? ( mirror://sourceforge/sbcl/${PN}-${BV_X64_MACOS}-x86-64-darwin-binary.tar.bz2 )
482 + sparc-solaris? ( mirror://sourceforge/sbcl/${PN}-${BV_SPARC_SOLARIS}-sparc-solaris-binary.tar.bz2 )
483 + x86-solaris? ( mirror://sourceforge/sbcl/${PN}-${BV_X86_SOLARIS}-x86-solaris-binary.tar.bz2 )
484 + x64-solaris? ( mirror://sourceforge/sbcl/${PN}-${BV_X64_SOLARIS}-x86-64-solaris-binary.tar.bz2 )"
485 +
486 +LICENSE="MIT"
487 +SLOT="0/${PV}"
488 +KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x86-solaris"
489 +IUSE="debug doc source +threads +unicode pax_kernel zlib"
490 +
491 +CDEPEND=">=dev-lisp/asdf-3.1:="
492 +DEPEND="${CDEPEND}
493 + doc? ( sys-apps/texinfo >=media-gfx/graphviz-2.26.0 )
494 + pax_kernel? ( sys-apps/elfix )"
495 +RDEPEND="${CDEPEND}
496 + !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.6 ) )"
497 +
498 +# Disable warnings about executable stacks, as this won't be fixed soon by upstream
499 +QA_EXECSTACK="usr/bin/sbcl"
500 +
501 +CONFIG="${S}/customize-target-features.lisp"
502 +ENVD="${T}/50sbcl"
503 +
504 +# Prevent ASDF from using the system libraries
505 +CL_SOURCE_REGISTRY="(:source-registry :ignore-inherited-configuration)"
506 +ASDF_OUTPUT_TRANSLATIONS="(:output-translations :ignore-inherited-configuration)"
507 +
508 +usep() {
509 + use ${1} && echo "true" || echo "false"
510 +}
511 +
512 +sbcl_feature() {
513 + echo "$( [[ ${1} == "true" ]] && echo "(enable ${2})" || echo "(disable ${2})")" >> "${CONFIG}"
514 +}
515 +
516 +sbcl_apply_features() {
517 + sed 's/^X//' > "${CONFIG}" <<-'EOF'
518 + (lambda (list)
519 + X (flet ((enable (x) (pushnew x list))
520 + X (disable (x) (setf list (remove x list))))
521 + EOF
522 + if use x86 || use amd64; then
523 + sbcl_feature "$(usep threads)" ":sb-thread"
524 + fi
525 + sbcl_feature "true" ":sb-ldb"
526 + sbcl_feature "false" ":sb-test"
527 + sbcl_feature "$(usep unicode)" ":sb-unicode"
528 + sbcl_feature "$(usep zlib)" ":sb-core-compression"
529 + sbcl_feature "$(usep debug)" ":sb-xref-for-internals"
530 + sed 's/^X//' >> "${CONFIG}" <<-'EOF'
531 + X )
532 + X list)
533 + EOF
534 + cat "${CONFIG}"
535 +}
536 +
537 +src_unpack() {
538 + unpack ${A}
539 + mv sbcl-*-* sbcl-binary || die
540 + cd "${S}"
541 +}
542 +
543 +src_prepare() {
544 + # bug #468482
545 + eapply "${FILESDIR}"/concurrency-test-1.3.15.patch
546 + # bugs #486552, #527666, #517004
547 + eapply "${FILESDIR}"/${PN}-1.4.0-bsd-sockets-test.patch
548 + # bugs #560276, #561018
549 + eapply "${FILESDIR}"/sb-posix-test-1.2.15.patch
550 +
551 + eapply "${FILESDIR}"/${PN}-1.2.11-solaris.patch
552 + eapply "${FILESDIR}"/${PN}-1.4.0-verbose-build.patch
553 +
554 + eapply_user
555 +
556 + # bugs #526194, #620532
557 + sed -e "s@CFLAGS +=.*\$@CFLAGS = ${CFLAGS} -Wall -Wsign-compare -Wpointer-arith@" \
558 + -e "s@LINKFLAGS += -g\$@LINKFLAGS = ${LDFLAGS}@" \
559 + -e "s@LINKFLAGS += -no-pie\$@LINKFLAGS = ${LDFLAGS} -no-pie@" \
560 + -e "s@LINKFLAGS += -nopie\$@LINKFLAGS = ${LDFLAGS} -nopie@" \
561 + -i src/runtime/GNUmakefile || die
562 +
563 + sed -e "s@SBCL_PREFIX=\"/usr/local\"@SBCL_PREFIX=\"${EPREFIX}/usr\"@" \
564 + -i make-config.sh || die
565 +
566 + # Use installed ASDF version
567 + cp "${EPREFIX}"/usr/share/common-lisp/source/asdf/build/asdf.lisp contrib/asdf/ || die
568 + # Avoid installation of ASDF info page. See bug #605752
569 + sed '/INFOFILES/s/asdf.info//' -i doc/manual/Makefile || die
570 +
571 + use source && sed 's%"$(BUILD_ROOT)%$(MODULE).lisp "$(BUILD_ROOT)%' -i contrib/vanilla-module.mk
572 +
573 + # Some shells(such as dash) don't have "time" as builtin
574 + # and we don't want to DEPEND on sys-process/time
575 + sed "s,^time ,," -i make.sh || die
576 + sed "s,/lib,/$(get_libdir),g" -i install.sh || die
577 + # #define SBCL_HOME ...
578 + sed "s,/usr/local/lib,${EPREFIX}/usr/$(get_libdir),g" -i src/runtime/runtime.c || die
579 + # change location of /etc/sbclrc ...
580 + sed "s,/etc/sbclrc,${EPREFIX}/etc/sbclrc,g" -i src/code/toplevel.lisp || die
581 +
582 + find . -type f -name .cvsignore -delete
583 +}
584 +
585 +src_configure() {
586 + # customizing SBCL version as per
587 + # http://sbcl.cvs.sourceforge.net/sbcl/sbcl/doc/PACKAGING-SBCL.txt?view=markup
588 + echo -e ";;; Auto-generated by Gentoo\n\"gentoo-${PR}\"" > branch-version.lisp-expr
589 +
590 + # applying customizations
591 + sbcl_apply_features
592 +}
593 +
594 +src_compile() {
595 + local bindir="${WORKDIR}"/sbcl-binary
596 +
597 + strip-unsupported-flags ; filter-flags -fomit-frame-pointer
598 +
599 + if use pax_kernel ; then
600 + # To disable PaX on hardened systems
601 + pax-mark -mr "${bindir}"/src/runtime/sbcl
602 +
603 + # Hack to disable PaX on second GENESIS stage
604 + sed -i -e '/^[ \t]*echo \/\/doing warm init - compilation phase$/a\ paxmark.sh -mr \.\/src\/runtime\/sbcl' \
605 + "${S}"/make-target-2.sh || die "Cannot disable PaX on second GENESIS runtime"
606 + fi
607 +
608 + # clear the environment to get rid of non-ASCII strings, see bug #174702
609 + # set HOME for paludis
610 + env - HOME="${T}" PATH="${PATH}" \
611 + CC="$(tc-getCC)" AS="$(tc-getAS)" LD="$(tc-getLD)" \
612 + CPPFLAGS="${CPPFLAGS}" CFLAGS="${CFLAGS}" ASFLAGS="${ASFLAGS}" LDFLAGS="${LDFLAGS}" \
613 + GNUMAKE=make ./make.sh \
614 + "sh ${bindir}/run-sbcl.sh --no-sysinit --no-userinit --disable-debugger" \
615 + || die "make failed"
616 +
617 + # need to set HOME because libpango(used by graphviz) complains about it
618 + if use doc; then
619 + env - HOME="${T}" PATH="${PATH}" \
620 + CL_SOURCE_REGISTRY="(:source-registry :ignore-inherited-configuration)" \
621 + ASDF_OUTPUT_TRANSLATIONS="(:output-translations :ignore-inherited-configuration)" \
622 + make -C doc/manual info html || die "Cannot build manual"
623 + env - HOME="${T}" PATH="${PATH}" \
624 + CL_SOURCE_REGISTRY="(:source-registry :ignore-inherited-configuration)" \
625 + ASDF_OUTPUT_TRANSLATIONS="(:output-translations :ignore-inherited-configuration)" \
626 + make -C doc/internals info html || die "Cannot build internal docs"
627 + fi
628 +}
629 +
630 +src_test() {
631 + ewarn "Unfortunately, it is known that some tests fail eg."
632 + ewarn "run-program.impure.lisp. This is an issue of the upstream's"
633 + ewarn "development and not of Gentoo's side. Please, before filing"
634 + ewarn "any bug(s) search for older submissions. Thank you."
635 + time ( cd tests && sh run-tests.sh )
636 +}
637 +
638 +src_install() {
639 + # install system-wide initfile
640 + dodir /etc/
641 + sed 's/^X//' > "${ED}"/etc/sbclrc <<-EOF
642 + ;;; The following is required if you want source location functions to
643 + ;;; work in SLIME, for example.
644 + X
645 + (setf (logical-pathname-translations "SYS")
646 + X '(("SYS:SRC;**;*.*.*" #p"${EPREFIX}/usr/$(get_libdir)/sbcl/src/**/*.*")
647 + X ("SYS:CONTRIB;**;*.*.*" #p"${EPREFIX}/usr/$(get_libdir)/sbcl/**/*.*")))
648 + X
649 + ;;; Setup ASDF2
650 + (load "${EPREFIX}/etc/common-lisp/gentoo-init.lisp")
651 + EOF
652 +
653 + # Install documentation
654 + unset SBCL_HOME
655 + INSTALL_ROOT="${ED}/usr" LIB_DIR="${EPREFIX}/usr/$(get_libdir)" DOC_DIR="${ED}/usr/share/doc/${PF}" \
656 + sh install.sh || die "install.sh failed"
657 +
658 + # bug #517008
659 + pax-mark -mr "${D}"/usr/bin/sbcl
660 +
661 + # rm empty directories lest paludis complain about this
662 + find "${ED}" -empty -type d -exec rmdir -v {} +
663 +
664 + if use doc; then
665 + dodoc -r doc/internals/sbcl-internals
666 +
667 + doinfo doc/manual/*.info*
668 + doinfo doc/internals/sbcl-internals.info
669 +
670 + docinto internals-notes
671 + dodoc doc/internals-notes/*
672 + else
673 + rm -Rv "${ED}/usr/share/doc/${PF}" || die
674 + fi
675 +
676 + # install the SBCL source
677 + if use source; then
678 + ./clean.sh
679 + cp -av src "${ED}/usr/$(get_libdir)/sbcl/" || die
680 + fi
681 +
682 + # necessary for running newly-saved images
683 + echo "SBCL_HOME=${EPREFIX}/usr/$(get_libdir)/${PN}" > "${ENVD}"
684 + echo "SBCL_SOURCE_ROOT=${EPREFIX}/usr/$(get_libdir)/${PN}/src" >> "${ENVD}"
685 + doenvd "${ENVD}"
686 +}