1 |
commit: d53dcd68eacc7a874c574c842ec649ea30cdf145 |
2 |
Author: Stelian Ionescu <sionescu <AT> cddr <DOT> org> |
3 |
AuthorDate: Sat Feb 4 20:05:22 2012 +0000 |
4 |
Commit: Stelian Ionescu <sionescu <AT> cddr <DOT> org> |
5 |
CommitDate: Sat Feb 4 20:05:22 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/lisp.git;a=commit;h=d53dcd68 |
7 |
|
8 |
dev-lisp/sbcl: disable hardened features, bump to -r1 |
9 |
|
10 |
--- |
11 |
.../gentoo-fix_nopie_for_hardened_toolchain.patch | 24 +++ |
12 |
dev-lisp/sbcl/sbcl-1.0.55-r1.ebuild | 196 ++++++++++++++++++++ |
13 |
2 files changed, 220 insertions(+), 0 deletions(-) |
14 |
|
15 |
diff --git a/dev-lisp/sbcl/files/gentoo-fix_nopie_for_hardened_toolchain.patch b/dev-lisp/sbcl/files/gentoo-fix_nopie_for_hardened_toolchain.patch |
16 |
new file mode 100644 |
17 |
index 0000000..d4f94ca |
18 |
--- /dev/null |
19 |
+++ b/dev-lisp/sbcl/files/gentoo-fix_nopie_for_hardened_toolchain.patch |
20 |
@@ -0,0 +1,24 @@ |
21 |
+diff -ur b/src/runtime/Config.x86-linux a/src/runtime/Config.x86-linux |
22 |
+--- b/src/runtime/Config.x86-linux 2012-01-09 02:08:10.000000000 +0000 |
23 |
++++ a/src/runtime/Config.x86-linux 2012-02-02 14:32:56.000000000 +0000 |
24 |
+@@ -27,7 +27,7 @@ |
25 |
+ # (You *are* encouraged to design and implement a coherent stable |
26 |
+ # interface, though.:-| As far as I (WHN 2002-05-19) know, no one is |
27 |
+ # working on one and it would be a nice thing to have.) |
28 |
+-LINKFLAGS += -Wl,--export-dynamic -m32 |
29 |
++LINKFLAGS += -Wl,--export-dynamic -m32 -nopie |
30 |
+ OS_LIBS = -ldl |
31 |
+ |
32 |
+ ifdef LISP_FEATURE_LARGEFILE |
33 |
+diff -ur b/src/runtime/Config.x86_64-linux a/src/runtime/Config.x86_64-linux |
34 |
+--- b/src/runtime/Config.x86_64-linux 2012-01-09 02:08:10.000000000 +0000 |
35 |
++++ a/src/runtime/Config.x86_64-linux 2012-02-02 14:32:44.000000000 +0000 |
36 |
+@@ -27,7 +27,7 @@ |
37 |
+ # (You *are* encouraged to design and implement a coherent stable |
38 |
+ # interface, though.:-| As far as I (WHN 2002-05-19) know, no one is |
39 |
+ # working on one and it would be a nice thing to have.) |
40 |
+-LINKFLAGS += -Wl,--export-dynamic |
41 |
++LINKFLAGS += -Wl,--export-dynamic -nopie |
42 |
+ OS_LIBS = -ldl |
43 |
+ |
44 |
+ ifdef LISP_FEATURE_LARGEFILE |
45 |
|
46 |
diff --git a/dev-lisp/sbcl/sbcl-1.0.55-r1.ebuild b/dev-lisp/sbcl/sbcl-1.0.55-r1.ebuild |
47 |
new file mode 100644 |
48 |
index 0000000..aaa8c8d |
49 |
--- /dev/null |
50 |
+++ b/dev-lisp/sbcl/sbcl-1.0.55-r1.ebuild |
51 |
@@ -0,0 +1,196 @@ |
52 |
+# Copyright 1999-2012 Gentoo Foundation |
53 |
+# Distributed under the terms of the GNU General Public License v2 |
54 |
+# $Header: $ |
55 |
+ |
56 |
+EAPI=3 |
57 |
+inherit multilib eutils flag-o-matic pax-utils |
58 |
+ |
59 |
+#same order as http://www.sbcl.org/platform-table.html |
60 |
+BV_X86=1.0.37 |
61 |
+BV_AMD64=1.0.37 |
62 |
+BV_PPC=1.0.28 |
63 |
+BV_SPARC=1.0.28 |
64 |
+BV_ALPHA=1.0.28 |
65 |
+BV_MIPS=1.0.23 |
66 |
+BV_MIPSEL=1.0.28 |
67 |
+ |
68 |
+DESCRIPTION="Steel Bank Common Lisp (SBCL) is an implementation of ANSI Common Lisp." |
69 |
+HOMEPAGE="http://sbcl.sourceforge.net/" |
70 |
+SRC_URI="mirror://sourceforge/sbcl/${P}-source.tar.bz2 |
71 |
+ x86? ( mirror://sourceforge/sbcl/${PN}-${BV_X86}-x86-linux-binary.tar.bz2 ) |
72 |
+ amd64? ( mirror://sourceforge/sbcl/${PN}-${BV_AMD64}-x86-64-linux-binary.tar.bz2 ) |
73 |
+ ppc? ( mirror://sourceforge/sbcl/${PN}-${BV_PPC}-powerpc-linux-binary.tar.bz2 ) |
74 |
+ sparc? ( mirror://sourceforge/sbcl/${PN}-${BV_SPARC}-sparc-linux-binary.tar.bz2 ) |
75 |
+ alpha? ( mirror://sourceforge/sbcl/${PN}-${BV_ALPHA}-alpha-linux-binary.tar.bz2 ) |
76 |
+ mips? ( !cobalt? ( mirror://sourceforge/sbcl/${PN}-${BV_MIPS}-mips-linux-binary.tar.bz2 ) ) |
77 |
+ mips? ( cobalt? ( mirror://sourceforge/sbcl/${PN}-${BV_MIPSEL}-mipsel-linux-binary.tar.bz2 ) )" |
78 |
+RESTRICT="mirror" |
79 |
+ |
80 |
+LICENSE="MIT" |
81 |
+SLOT="0" |
82 |
+KEYWORDS="~amd64 ~ppc ~sparc ~x86" |
83 |
+IUSE="+asdf ldb source +threads +unicode debug doc cobalt" |
84 |
+ |
85 |
+DEPEND="doc? ( sys-apps/texinfo >=media-gfx/graphviz-2.26.0 )" |
86 |
+RDEPEND="elibc_glibc? ( >=sys-libs/glibc-2.3 || ( <sys-libs/glibc-2.6[nptl] >=sys-libs/glibc-2.6 ) ) |
87 |
+ asdf? ( >=dev-lisp/gentoo-init-1.0 )" |
88 |
+ |
89 |
+# Disable warnings about executable stacks, as this won't be fixed soon by upstream |
90 |
+QA_EXECSTACK="usr/bin/sbcl" |
91 |
+ |
92 |
+CONFIG="${S}/customize-target-features.lisp" |
93 |
+ENVD="${T}/50sbcl" |
94 |
+ |
95 |
+usep() { |
96 |
+ use ${1} && echo "true" || echo "false" |
97 |
+} |
98 |
+ |
99 |
+sbcl_feature() { |
100 |
+ echo "$( [[ ${1} == "true" ]] && echo "(enable ${2})" || echo "(disable ${2})")" >> "${CONFIG}" |
101 |
+} |
102 |
+ |
103 |
+sbcl_apply_features() { |
104 |
+ cat > "${CONFIG}" <<'EOF' |
105 |
+(lambda (list) |
106 |
+ (flet ((enable (x) (pushnew x list)) |
107 |
+ (disable (x) (setf list (remove x list)))) |
108 |
+EOF |
109 |
+ if use x86 || use amd64; then |
110 |
+ sbcl_feature "$(usep threads)" ":sb-thread" |
111 |
+ fi |
112 |
+ sbcl_feature "$(usep ldb)" ":sb-ldb" |
113 |
+ sbcl_feature "false" ":sb-test" |
114 |
+ sbcl_feature "$(usep unicode)" ":sb-unicode" |
115 |
+ sbcl_feature "$(usep debug)" ":sb-xref-for-internals" |
116 |
+ cat >> "${CONFIG}" <<'EOF' |
117 |
+ ) |
118 |
+ list) |
119 |
+EOF |
120 |
+ cat "${CONFIG}" |
121 |
+} |
122 |
+ |
123 |
+src_unpack() { |
124 |
+ unpack ${A} |
125 |
+ mv sbcl-*-linux sbcl-binary |
126 |
+ cd "${S}" |
127 |
+} |
128 |
+ |
129 |
+src_prepare() { |
130 |
+ epatch "${FILESDIR}"/gentoo-fix_install_man.patch |
131 |
+ epatch "${FILESDIR}"/gentoo-fix_linux-os-c.patch |
132 |
+ |
133 |
+ # To make the hardened compiler NOT compile with -fPIE -pie |
134 |
+ if gcc-specs-pie ; then |
135 |
+ einfo "Disabling PIE..." |
136 |
+ epatch "${FILESDIR}"/gentoo-fix_nopie_for_hardened_toolchain.patch |
137 |
+ fi |
138 |
+ |
139 |
+ use source && sed 's%"$(BUILD_ROOT)%$(MODULE).lisp "$(BUILD_ROOT)%' -i contrib/vanilla-module.mk |
140 |
+ |
141 |
+ # Some shells(such as dash) don't have "time" as builtin |
142 |
+ # and we don't want to DEPEND on sys-process/time |
143 |
+ sed "s,^time ,," -i make.sh |
144 |
+ sed "s,/lib,/$(get_libdir),g" -i install.sh |
145 |
+ sed "s,/usr/local/lib,/usr/$(get_libdir),g" -i src/runtime/runtime.c # #define SBCL_HOME ... |
146 |
+ |
147 |
+ find . -type f -name .cvsignore -delete |
148 |
+} |
149 |
+ |
150 |
+src_configure() { |
151 |
+ # customizing SBCL version as per |
152 |
+ # http://sbcl.cvs.sourceforge.net/sbcl/sbcl/doc/PACKAGING-SBCL.txt?view=markup |
153 |
+ echo -e ";;; Auto-generated by Gentoo\n\"gentoo-${PR}\"" > branch-version.lisp-expr |
154 |
+ |
155 |
+ # applying customizations |
156 |
+ sbcl_apply_features |
157 |
+} |
158 |
+ |
159 |
+src_compile() { |
160 |
+ local bindir="${WORKDIR}"/sbcl-binary |
161 |
+ |
162 |
+ strip-unsupported-flags ; filter-flags -fomit-frame-pointer |
163 |
+ |
164 |
+ if host-is-pax ; then |
165 |
+ # To disable PaX on hardened systems |
166 |
+ pax-mark -C "${bindir}"/src/runtime/sbcl |
167 |
+ pax-mark -mr "${bindir}"/src/runtime/sbcl |
168 |
+ |
169 |
+ # Hack to disable PaX on second GENESIS stage |
170 |
+ sed -i -e '/load/!s/^echo \/\/doing warm.*$/&\npaxctl -C \.\/src\/runtime\/sbcl\npaxctl -mprexs \.\/src\/runtime\/sbcl/' \ |
171 |
+ "${S}"/make-target-2.sh || die "Cannot disable PaX on second GENESIS runtime" |
172 |
+ fi |
173 |
+ |
174 |
+ # clear the environment to get rid of non-ASCII strings, see bug 174702 |
175 |
+ # set HOME for paludis |
176 |
+ env - HOME="${T}" \ |
177 |
+ CC="$(tc-getCC)" AS="$(tc-getAS)" LD="$(tc-getLD)" \ |
178 |
+ CPPFLAGS="${CPPFLAGS}" CFLAGS="${CFLAGS}" ASFLAGS="${ASFLAGS}" LDFLAGS="${LDFLAGS}" \ |
179 |
+ GNUMAKE=make ./make.sh \ |
180 |
+ "sh ${bindir}/run-sbcl.sh --no-sysinit --no-userinit --disable-debugger" \ |
181 |
+ || die "make failed" |
182 |
+ |
183 |
+ # need to set HOME because libpango(used by graphviz) complains about it |
184 |
+ if use doc; then |
185 |
+ env - HOME="${T}" make -C doc/manual info html || die "Cannot build manual" |
186 |
+ env - HOME="${T}" make -C doc/internals info html || die "Cannot build internal docs" |
187 |
+ fi |
188 |
+} |
189 |
+ |
190 |
+src_test() { |
191 |
+ ewarn "Unfortunately, it is known that some tests fail eg." |
192 |
+ ewarn "run-program.impure.lisp. This is an issue of the upstream's" |
193 |
+ ewarn "development and not of Gentoo's side. Please, before filing" |
194 |
+ ewarn "any bug(s) search for older submissions. Thank you." |
195 |
+ time ( cd tests && sh run-tests.sh ) |
196 |
+} |
197 |
+ |
198 |
+src_install() { |
199 |
+ # install system-wide initfile |
200 |
+ dodir /etc/ |
201 |
+ cat > "${D}"/etc/sbclrc <<EOF |
202 |
+;;; The following is required if you want source location functions to |
203 |
+;;; work in SLIME, for example. |
204 |
+ |
205 |
+(setf (logical-pathname-translations "SYS") |
206 |
+ '(("SYS:SRC;**;*.*.*" #p"/usr/$(get_libdir)/sbcl/src/**/*.*") |
207 |
+ ("SYS:CONTRIB;**;*.*.*" #p"/usr/$(get_libdir)/sbcl/**/*.*"))) |
208 |
+EOF |
209 |
+ if use asdf; then |
210 |
+ cat >> "${D}"/etc/sbclrc <<EOF |
211 |
+ |
212 |
+;;; Setup ASDF2 |
213 |
+(load "/etc/common-lisp/gentoo-init.lisp") |
214 |
+EOF |
215 |
+ fi |
216 |
+ |
217 |
+ # Install documentation |
218 |
+ unset SBCL_HOME |
219 |
+ INSTALL_ROOT="${D}/usr" LIB_DIR="/usr/$(get_libdir)" DOC_DIR="${D}/usr/share/doc/${PF}" \ |
220 |
+ sh install.sh || die "install.sh failed" |
221 |
+ |
222 |
+ # rm empty directories lest paludis complain about this |
223 |
+ find "${D}" -empty -type d -exec rmdir -v {} + |
224 |
+ |
225 |
+ if use doc; then |
226 |
+ dohtml -r doc/manual/ |
227 |
+ doinfo doc/manual/*.info* |
228 |
+ dohtml -r doc/internals/sbcl-internals |
229 |
+ doinfo doc/internals/sbcl-internals.info |
230 |
+ docinto internals-notes && dodoc doc/internals-notes/* |
231 |
+ else |
232 |
+ rm -Rv "${D}/usr/share/doc/${PF}" |
233 |
+ fi |
234 |
+ |
235 |
+ dodoc BUGS CREDITS INSTALL NEWS OPTIMIZATIONS PRINCIPLES README STYLE TLA TODO |
236 |
+ |
237 |
+ # install the SBCL source |
238 |
+ if use source; then |
239 |
+ ./clean.sh |
240 |
+ cp -av src "${D}/usr/$(get_libdir)/sbcl/" |
241 |
+ fi |
242 |
+ |
243 |
+ # necessary for running newly-saved images |
244 |
+ echo "SBCL_HOME=/usr/$(get_libdir)/${PN}" > "${ENVD}" |
245 |
+ echo "SBCL_SOURCE_ROOT=/usr/$(get_libdir)/${PN}/src" >> "${ENVD}" |
246 |
+ doenvd "${ENVD}" |
247 |
+} |