Implement Precedence
[clnl] / bin / buildosxexec.sh
1 #!/bin/bash
2
3 # This sciprt builds a version of sbcl pre loaded with libraries that can run on osx.
4 # You can use ./osxsbcl --script bin/run.lisp to run it
5
6 mkdir -p tmp/sbcl
7 mkdir -p tmp/sbcl-binary
8
9 cwd=$PWD
10 ( cd tmp &&
11   tar jxf ../deps/osx/sbcl-1.2.11-x86-64-darwin-binary.tar.bz2 &&
12   tar jxf ../deps/osx/sbcl-1.2.13-source.tar.bz2 &&
13   cd sbcl-1.2.11-x86-64-darwin/ &&
14   SBCL_HOME="" INSTALL_ROOT=$cwd/tmp/sbcl-binary/ bash install.sh &&
15   cd ../sbcl-1.2.13/ &&
16   PATH="$cwd/tmp/sbcl-binary/bin/:$PATH" SBCL_HOME="$cwd/tmp/sbcl-binary/lib/sbcl/" bash make.sh --with-sb-thread &&
17   SBCL_HOME="" INSTALL_ROOT=$cwd/tmp/sbcl/ bash install.sh )
18
19 mkdir -p tmp/deps/
20
21 ( cd tmp/deps &&
22   tar zxf ../../deps/common-lisp/3b-cl-opengl-993d627.tar.gz &&
23   tar zxf ../../deps/common-lisp/alexandria-b1c6ee0.tar.gz &&
24   tar zxf ../../deps/common-lisp/babel_0.5.0.tar.gz &&
25   tar zxf ../../deps/common-lisp/cffi_0.15.0.tar.gz &&
26   tar zxf ../../deps/common-lisp/cl-ppcre.tar.gz &&
27   tar zxf ../../deps/common-lisp/ironclad.tar.gz &&
28   tar zxf ../../deps/common-lisp/mt19937-latest.tar.gz &&
29   tar zxf ../../deps/common-lisp/nibbles-v0.12.tar.gz &&
30   tar zxf ../../deps/common-lisp/trivial-features_0.8.tar.gz &&
31   tar zxf ../../deps/common-lisp/cl-charms-9bb94ef.tar.gz &&
32   tar zxf ../../deps/common-lisp/ieee-floats-92e481a.tar.gz &&
33   tar zxf ../../deps/common-lisp/strictmath_0.1.tar.gz
34 )
35
36 SBCL_HOME="" tmp/sbcl/bin/sbcl --core tmp/sbcl/lib/sbcl/sbcl.core --no-sysinit --no-userinit \
37   --eval "(require 'asdf)" \
38   --eval "(asdf:initialize-source-registry '(:source-registry (:tree \"${PWD}/tmp/deps\") (:directory \"${PWD}/src/main\") :IGNORE-INHERITED-CONFIGURATION))" \
39   --eval "(asdf:load-system :clnl)" \
40   --eval "(asdf:clear-output-translations)" \
41   --eval '(sb-ext:save-lisp-and-die "osxsbcl" :executable t :toplevel (function clnl:run))' \
42
43 chmod +x osxsbcl
44
45 rm -rf tmp