fork
Configure Feed
Select the types of activity you want to include in your feed.
lol
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{ stdenv, fetchurl, sbclBootstrap, clisp, which}:
2
3stdenv.mkDerivation rec {
4 name = "sbcl-${version}";
5 version = "1.2.14";
6
7 src = fetchurl {
8 url = "mirror://sourceforge/project/sbcl/sbcl/${version}/${name}-source.tar.bz2";
9 sha256 = "01jw1w5siv6q16y1vmgd7s1i22aq0cqaipgn12jvq18c8vb6s55r";
10 };
11
12 buildInputs = [ which ]
13 ++ (stdenv.lib.optional stdenv.isDarwin sbclBootstrap)
14 ++ (stdenv.lib.optional stdenv.isLinux clisp)
15 ;
16
17 patchPhase = ''
18 echo '"${version}.nixos"' > version.lisp-expr
19 echo "
20 (lambda (features)
21 (flet ((enable (x)
22 (pushnew x features))
23 (disable (x)
24 (setf features (remove x features))))
25 (enable :sb-thread))) " > customize-target-features.lisp
26
27 pwd
28
29 # SBCL checks whether files are up-to-date in many places..
30 # Unfortunately, same timestamp is not good enough
31 sed -e 's@> x y@>= x y@' -i contrib/sb-aclrepl/repl.lisp
32 sed -e '/(date)/i((= date 2208988801) 2208988800)' -i contrib/asdf/asdf.lisp
33 sed -i src/cold/slam.lisp -e \
34 '/file-write-date input/a)'
35 sed -i src/cold/slam.lisp -e \
36 '/file-write-date output/i(or (and (= 2208988801 (file-write-date output)) (= 2208988801 (file-write-date input)))'
37 sed -i src/code/target-load.lisp -e \
38 '/date defaulted-fasl/a)'
39 sed -i src/code/target-load.lisp -e \
40 '/date defaulted-source/i(or (and (= 2208988801 (file-write-date defaulted-source-truename)) (= 2208988801 (file-write-date defaulted-fasl-truename)))'
41
42 # Fix software version retrieval
43 sed -e "s@/bin/uname@$(which uname)@g" -i src/code/*-os.lisp
44
45 # Fix the tests
46 sed -e '/deftest pwent/inil' -i contrib/sb-posix/posix-tests.lisp
47 sed -e '/deftest grent/inil' -i contrib/sb-posix/posix-tests.lisp
48 sed -e '/deftest .*ent.non-existing/,+5d' -i contrib/sb-posix/posix-tests.lisp
49 sed -e '/deftest \(pw\|gr\)ent/,+3d' -i contrib/sb-posix/posix-tests.lisp
50
51 sed -e '5,$d' -i contrib/sb-bsd-sockets/tests.lisp
52 sed -e '5,$d' -i contrib/sb-simple-streams/*test*.lisp
53
54 # Use whatever `cc` the stdenv provides
55 substituteInPlace src/runtime/Config.x86-64-darwin --replace gcc cc
56
57 substituteInPlace src/runtime/Config.x86-64-darwin \
58 --replace mmacosx-version-min=10.4 mmacosx-version-min=10.5
59 '';
60
61 preBuild = ''
62 export INSTALL_ROOT=$out
63 mkdir -p test-home
64 export HOME=$PWD/test-home
65 '';
66
67 buildPhase = if stdenv.isLinux
68 then ''
69 sh make.sh clisp --prefix=$out
70 ''
71 else ''
72 sh make.sh --prefix=$out --xc-host='${sbclBootstrap}/bin/sbcl --core ${sbclBootstrap}/share/sbcl/sbcl.core --disable-debugger --no-userinit --no-sysinit'
73 '';
74
75 installPhase = ''
76 INSTALL_ROOT=$out sh install.sh
77 '';
78
79 meta = {
80 description = "Lisp compiler";
81 homepage = http://www.sbcl.org;
82 license = stdenv.lib.licenses.bsd3;
83 maintainers = [stdenv.lib.maintainers.raskin];
84 platforms = stdenv.lib.platforms.all;
85 inherit version;
86 updateWalker = true;
87 };
88}