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/, dev-lisp/sbcl/files/
Date: Tue, 04 Apr 2017 18:39:37
Message-Id: 1491331207.4d6252c4113397492af97da0ff6ad7c1a48df6db.nimiux@gentoo
1 commit: 4d6252c4113397492af97da0ff6ad7c1a48df6db
2 Author: Chema Alonso Josa <nimiux <AT> gentoo <DOT> org>
3 AuthorDate: Tue Apr 4 18:40:07 2017 +0000
4 Commit: José María Alonso <nimiux <AT> gentoo <DOT> org>
5 CommitDate: Tue Apr 4 18:40:07 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/lisp.git/commit/?id=4d6252c4
7
8 dev-lisp/sbcl: Bumps version to 1.3.16
9
10 .../files/sbcl-1.3.16-gentoo-fix_install_man.patch | 12 ++
11 dev-lisp/sbcl/sbcl-1.3.16.ebuild | 234 +++++++++++++++++++++
12 2 files changed, 246 insertions(+)
13
14 diff --git a/dev-lisp/sbcl/files/sbcl-1.3.16-gentoo-fix_install_man.patch b/dev-lisp/sbcl/files/sbcl-1.3.16-gentoo-fix_install_man.patch
15 new file mode 100644
16 index 00000000..5e01b331
17 --- /dev/null
18 +++ b/dev-lisp/sbcl/files/sbcl-1.3.16-gentoo-fix_install_man.patch
19 @@ -0,0 +1,12 @@
20 +diff -Nuar a/install.sh b/install.sh
21 +--- a/install.sh 2017-03-27 11:57:34.000000000 +0200
22 ++++ b/install.sh 2017-04-04 20:21:25.510085555 +0200
23 +@@ -110,7 +110,7 @@
24 + CP="cp -f"
25 +
26 + # man
27 +-$CP doc/sbcl.1 "$BUILD_ROOT$MAN_DIR"/man1/ && echo " man $BUILD_ROOT$MAN_DIR/man1/sbcl.1"
28 ++$CP doc/sbcl-asdf-install.1 "$BUILD_ROOT$MAN_DIR"/man1/ && echo " man $BUILD_ROOT$MAN_DIR/man1/sbcl-asdf-install.1"
29 +
30 + # info
31 + for info in doc/manual/*.info
32
33 diff --git a/dev-lisp/sbcl/sbcl-1.3.16.ebuild b/dev-lisp/sbcl/sbcl-1.3.16.ebuild
34 new file mode 100644
35 index 00000000..57ea1430
36 --- /dev/null
37 +++ b/dev-lisp/sbcl/sbcl-1.3.16.ebuild
38 @@ -0,0 +1,234 @@
39 +# Copyright 1999-2017 Gentoo Foundation
40 +# Distributed under the terms of the GNU General Public License v2
41 +
42 +EAPI=6
43 +inherit multilib eutils flag-o-matic pax-utils
44 +
45 +#same order as http://www.sbcl.org/platform-table.html
46 +BV_X86=1.2.7
47 +BV_AMD64=1.3.16
48 +BV_PPC=1.2.7
49 +BV_SPARC=1.0.28
50 +BV_ALPHA=1.0.28
51 +BV_ARM=1.3.12
52 +BV_ARM64=1.3.16
53 +BV_PPC_MACOS=1.0.47
54 +BV_X86_MACOS=1.1.6
55 +BV_X64_MACOS=1.2.11
56 +BV_SPARC_SOLARIS=1.0.23
57 +BV_X86_SOLARIS=1.2.7
58 +BV_X64_SOLARIS=1.2.7
59 +
60 +DESCRIPTION="Steel Bank Common Lisp (SBCL) is an implementation of ANSI Common Lisp"
61 +HOMEPAGE="http://sbcl.sourceforge.net/"
62 +SRC_URI="mirror://sourceforge/sbcl/${P}-source.tar.bz2
63 + x86? ( mirror://sourceforge/sbcl/${PN}-${BV_X86}-x86-linux-binary.tar.bz2 )
64 + amd64? ( mirror://sourceforge/sbcl/${PN}-${BV_AMD64}-x86-64-linux-binary.tar.bz2 )
65 + ppc? ( mirror://sourceforge/sbcl/${PN}-${BV_PPC}-powerpc-linux-binary.tar.bz2 )
66 + sparc? ( mirror://sourceforge/sbcl/${PN}-${BV_SPARC}-sparc-linux-binary.tar.bz2 )
67 + alpha? ( mirror://sourceforge/sbcl/${PN}-${BV_ALPHA}-alpha-linux-binary.tar.bz2 )
68 + arm? ( mirror://sourceforge/sbcl/${PN}-${BV_ARM}-armhf-linux-binary.tar.bz2 )
69 + ppc-macos? ( mirror://sourceforge/sbcl/${PN}-${BV_PPC_MACOS}-powerpc-darwin-binary.tar.bz2 )
70 + x86-macos? ( mirror://sourceforge/sbcl/${PN}-${BV_X86_MACOS}-x86-darwin-binary.tar.bz2 )
71 + x64-macos? ( mirror://sourceforge/sbcl/${PN}-${BV_X64_MACOS}-x86-64-darwin-binary.tar.bz2 )
72 + sparc-solaris? ( mirror://sourceforge/sbcl/${PN}-${BV_SPARC_SOLARIS}-sparc-solaris-binary.tar.bz2 )
73 + x86-solaris? ( mirror://sourceforge/sbcl/${PN}-${BV_X86_SOLARIS}-x86-solaris-binary.tar.bz2 )
74 + x64-solaris? ( mirror://sourceforge/sbcl/${PN}-${BV_X64_SOLARIS}-x86-64-solaris-binary.tar.bz2 )"
75 +
76 +LICENSE="MIT"
77 +SLOT="0/${PV}"
78 +KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x86-solaris"
79 +IUSE="debug doc source +threads +unicode pax_kernel zlib"
80 +
81 +CDEPEND=">=dev-lisp/asdf-3.1:="
82 +DEPEND="${CDEPEND}
83 + doc? ( sys-apps/texinfo >=media-gfx/graphviz-2.26.0 )
84 + pax_kernel? ( sys-apps/elfix )"
85 +RDEPEND="${CDEPEND}
86 + !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.6 ) )"
87 +
88 +# Disable warnings about executable stacks, as this won't be fixed soon by upstream
89 +QA_EXECSTACK="usr/bin/sbcl"
90 +
91 +CONFIG="${S}/customize-target-features.lisp"
92 +ENVD="${T}/50sbcl"
93 +
94 +# Prevent ASDF from using the system libraries
95 +CL_SOURCE_REGISTRY="(:source-registry :ignore-inherited-configuration)"
96 +ASDF_OUTPUT_TRANSLATIONS="(:output-translations :ignore-inherited-configuration)"
97 +
98 +usep() {
99 + use ${1} && echo "true" || echo "false"
100 +}
101 +
102 +sbcl_feature() {
103 + echo "$( [[ ${1} == "true" ]] && echo "(enable ${2})" || echo "(disable ${2})")" >> "${CONFIG}"
104 +}
105 +
106 +sbcl_apply_features() {
107 + sed 's/^X//' > "${CONFIG}" <<-'EOF'
108 + (lambda (list)
109 + X (flet ((enable (x) (pushnew x list))
110 + X (disable (x) (setf list (remove x list))))
111 + EOF
112 + if use x86 || use amd64; then
113 + sbcl_feature "$(usep threads)" ":sb-thread"
114 + fi
115 + sbcl_feature "true" ":sb-ldb"
116 + sbcl_feature "false" ":sb-test"
117 + sbcl_feature "$(usep unicode)" ":sb-unicode"
118 + sbcl_feature "$(usep zlib)" ":sb-core-compression"
119 + sbcl_feature "$(usep debug)" ":sb-xref-for-internals"
120 + sed 's/^X//' >> "${CONFIG}" <<-'EOF'
121 + X )
122 + X list)
123 + EOF
124 + cat "${CONFIG}"
125 +}
126 +
127 +src_unpack() {
128 + unpack ${A}
129 + mv sbcl-*-* sbcl-binary || die
130 + cd "${S}"
131 +}
132 +
133 +src_prepare() {
134 + eapply "${FILESDIR}"/${P}-gentoo-fix_install_man.patch
135 + # bug #468482
136 + eapply "${FILESDIR}"/concurrency-test-1.3.15.patch
137 + # bugs #486552, #527666, #517004
138 + eapply "${FILESDIR}"/bsd-sockets-test-1.3.12.patch
139 + # bugs #560276, #561018
140 + eapply "${FILESDIR}"/sb-posix-test-1.2.15.patch
141 +
142 + eapply "${FILESDIR}"/${PN}-1.2.11-solaris.patch
143 + eapply "${FILESDIR}"/${PN}-1.2.13-verbose-build.patch
144 +
145 + eapply_user
146 +
147 + # bug #526194
148 + sed -e "s@CFLAGS =.*\$@CFLAGS = ${CFLAGS} -g -Wall -Wsign-compare@" \
149 + -e "s@LINKFLAGS =.*\$@LINKFLAGS = ${LDFLAGS} -g@" \
150 + -i src/runtime/GNUmakefile || die
151 +
152 + sed -e "s@SBCL_PREFIX=\"/usr/local\"@SBCL_PREFIX=\"${EPREFIX}/usr\"@" \
153 + -i make-config.sh || die
154 +
155 + cp "${EPREFIX}"/usr/share/common-lisp/source/asdf/build/asdf.lisp contrib/asdf/ || die
156 +
157 + use source && sed 's%"$(BUILD_ROOT)%$(MODULE).lisp "$(BUILD_ROOT)%' -i contrib/vanilla-module.mk
158 +
159 + # Some shells(such as dash) don't have "time" as builtin
160 + # and we don't want to DEPEND on sys-process/time
161 + sed "s,^time ,," -i make.sh || die
162 + sed "s,/lib,/$(get_libdir),g" -i install.sh || die
163 + # #define SBCL_HOME ...
164 + sed "s,/usr/local/lib,${EPREFIX}/usr/$(get_libdir),g" -i src/runtime/runtime.c || die
165 + # change location of /etc/sbclrc ...
166 + sed "s,/etc/sbclrc,${EPREFIX}/etc/sbclrc,g" -i src/code/toplevel.lisp || die
167 +
168 + find . -type f -name .cvsignore -delete
169 +}
170 +
171 +src_configure() {
172 + # customizing SBCL version as per
173 + # http://sbcl.cvs.sourceforge.net/sbcl/sbcl/doc/PACKAGING-SBCL.txt?view=markup
174 + echo -e ";;; Auto-generated by Gentoo\n\"gentoo-${PR}\"" > branch-version.lisp-expr
175 +
176 + # applying customizations
177 + sbcl_apply_features
178 +}
179 +
180 +src_compile() {
181 + local bindir="${WORKDIR}"/sbcl-binary
182 +
183 + strip-unsupported-flags ; filter-flags -fomit-frame-pointer
184 +
185 + if use pax_kernel ; then
186 + # To disable PaX on hardened systems
187 + pax-mark -mr "${bindir}"/src/runtime/sbcl
188 +
189 + # Hack to disable PaX on second GENESIS stage
190 + sed -i -e '/^[ \t]*echo \/\/doing warm init - compilation phase$/a\ paxmark.sh -mr \.\/src\/runtime\/sbcl' \
191 + "${S}"/make-target-2.sh || die "Cannot disable PaX on second GENESIS runtime"
192 + fi
193 +
194 + # clear the environment to get rid of non-ASCII strings, see bug 174702
195 + # set HOME for paludis
196 + env - HOME="${T}" PATH="${PATH}" \
197 + CC="$(tc-getCC)" AS="$(tc-getAS)" LD="$(tc-getLD)" \
198 + CPPFLAGS="${CPPFLAGS}" CFLAGS="${CFLAGS}" ASFLAGS="${ASFLAGS}" LDFLAGS="${LDFLAGS}" \
199 + GNUMAKE=make ./make.sh \
200 + "sh ${bindir}/run-sbcl.sh --no-sysinit --no-userinit --disable-debugger" \
201 + || die "make failed"
202 +
203 + # need to set HOME because libpango(used by graphviz) complains about it
204 + if use doc; then
205 + env - HOME="${T}" PATH="${PATH}" \
206 + CL_SOURCE_REGISTRY="(:source-registry :ignore-inherited-configuration)" \
207 + ASDF_OUTPUT_TRANSLATIONS="(:output-translations :ignore-inherited-configuration)" \
208 + make -C doc/manual info html || die "Cannot build manual"
209 + env - HOME="${T}" PATH="${PATH}" \
210 + CL_SOURCE_REGISTRY="(:source-registry :ignore-inherited-configuration)" \
211 + ASDF_OUTPUT_TRANSLATIONS="(:output-translations :ignore-inherited-configuration)" \
212 + make -C doc/internals info html || die "Cannot build internal docs"
213 + fi
214 +}
215 +
216 +src_test() {
217 + ewarn "Unfortunately, it is known that some tests fail eg."
218 + ewarn "run-program.impure.lisp. This is an issue of the upstream's"
219 + ewarn "development and not of Gentoo's side. Please, before filing"
220 + ewarn "any bug(s) search for older submissions. Thank you."
221 + time ( cd tests && sh run-tests.sh )
222 +}
223 +
224 +src_install() {
225 + # install system-wide initfile
226 + dodir /etc/
227 + sed 's/^X//' > "${ED}"/etc/sbclrc <<-EOF
228 + ;;; The following is required if you want source location functions to
229 + ;;; work in SLIME, for example.
230 + X
231 + (setf (logical-pathname-translations "SYS")
232 + X '(("SYS:SRC;**;*.*.*" #p"${EPREFIX}/usr/$(get_libdir)/sbcl/src/**/*.*")
233 + X ("SYS:CONTRIB;**;*.*.*" #p"${EPREFIX}/usr/$(get_libdir)/sbcl/**/*.*")))
234 + X
235 + ;;; Setup ASDF2
236 + (load "${EPREFIX}/etc/common-lisp/gentoo-init.lisp")
237 + EOF
238 +
239 + # Install documentation
240 + unset SBCL_HOME
241 + INSTALL_ROOT="${ED}/usr" LIB_DIR="${EPREFIX}/usr/$(get_libdir)" DOC_DIR="${ED}/usr/share/doc/${PF}" \
242 + sh install.sh || die "install.sh failed"
243 +
244 + # bug #517008
245 + pax-mark -mr "${D}"/usr/bin/sbcl
246 +
247 + # rm empty directories lest paludis complain about this
248 + find "${ED}" -empty -type d -exec rmdir -v {} +
249 +
250 + if use doc; then
251 + dodoc -r doc/internals/sbcl-internals
252 +
253 + doinfo doc/manual/*.info*
254 + doinfo doc/internals/sbcl-internals.info
255 +
256 + docinto internals-notes
257 + dodoc doc/internals-notes/*
258 + else
259 + rm -Rv "${ED}/usr/share/doc/${PF}" || die
260 + fi
261 +
262 + # install the SBCL source
263 + if use source; then
264 + ./clean.sh
265 + cp -av src "${ED}/usr/$(get_libdir)/sbcl/" || die
266 + fi
267 +
268 + # necessary for running newly-saved images
269 + echo "SBCL_HOME=${EPREFIX}/usr/$(get_libdir)/${PN}" > "${ENVD}"
270 + echo "SBCL_SOURCE_ROOT=${EPREFIX}/usr/$(get_libdir)/${PN}/src" >> "${ENVD}"
271 + doenvd "${ENVD}"
272 +}