From: Frank Duncan Date: Fri, 14 Aug 2015 17:45:51 +0000 (-0500) Subject: Get working on OSX X-Git-Tag: v0.0.0~3 X-Git-Url: https://code.consxy.com/gitweb/?a=commitdiff_plain;h=e4737223ae0336868aecd6af14ac09947655fde6;p=clnl Get working on OSX --- diff --git a/README.md b/README.md index 5d79c7d..002a7b6 100644 --- a/README.md +++ b/README.md @@ -44,13 +44,9 @@ If you'd like to run using your own sbcl instance, you can attach the clnl.asd f (clnl:run) ``` -To view the opengl view, you'll want to open up the interface: +## Running on OSX -```lisp -(sb-thread:make-thread #'clnl-interface:run) -``` - -(On OSX, the interface should be the main thread) +In order to run on OSX, you may have to build your own sbcl instance with threads enabled. # Testing diff --git a/bin/all.lisp b/bin/all.lisp new file mode 100644 index 0000000..441810a --- /dev/null +++ b/bin/all.lisp @@ -0,0 +1,26 @@ +(when (not (find-package :clnl)) (asdf:load-system :clnl)) +(when (not (find-package :clnl-test)) (asdf:load-system :clnl-test)) + +(format t "~%~c[1;33mRunning Tests~c[0m~%" #\Esc #\Esc) +(when (not (clnl-test:run-all-tests)) + (format t "~c[1;31mFailed tests!~c[0m~%" #\Esc #\Esc) + (sb-ext:exit :code 1)) + +(when (not (find-package :syntax-checker)) (asdf:load-system :style-checker)) +(format t "~%~c[1;33mChecking Style~c[0m~%" #\Esc #\Esc) +(when (not (syntax-checker:pretty-print-check-directory "src")) + (format t "~c[1;31mFailed style check!~c[0m~%" #\Esc #\Esc) + (sb-ext:exit :code 1)) +(format t "~c[1;32m- Style Passed!~c[0m~%" #\Esc #\Esc) + +(when (not (find-package :docgen)) (asdf:load-system :docgen)) +(format t "~%~c[1;33mChecking Docs~c[0m~%" #\Esc #\Esc) +(when (not (docgen:pretty-print-validate-packages + :clnl :clnl-parser :clnl-random :clnl-transpiler :clnl-nvm :clnl-lexer :clnl-interface :clnl-cli)) + (format t "~c[1;31mFailed doc check!~c[0m~%" #\Esc #\Esc) + (sb-ext:exit :code 1)) +(format t "~c[1;32m- Doc Check Passed!~c[0m~%" #\Esc #\Esc) + +(format t "~c[1;30m--------------~c[0m~%" #\Esc #\Esc) +(format t "~c[1;32mBuild Success!~c[0m~%" #\Esc #\Esc) +(sb-ext:exit :code 0) diff --git a/bin/buildosxexec.sh b/bin/buildosxexec.sh new file mode 100755 index 0000000..1e07356 --- /dev/null +++ b/bin/buildosxexec.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +# This sciprt builds a version of sbcl pre loaded with libraries that can run on osx. +# You can use ./osxsbcl --script bin/run.lisp to run it + +mkdir -p tmp/sbcl +mkdir -p tmp/sbcl-binary + +cwd=$PWD +( cd tmp && + tar jxf ../deps/tarpit/sbcl-1.2.11-x86-64-darwin-binary.tar.bz2 && + tar jxf ../deps/tarpit/sbcl-1.2.13-source.tar.bz2 && + cd sbcl-1.2.11-x86-64-darwin/ && + SBCL_HOME="" INSTALL_ROOT=$cwd/tmp/sbcl-binary/ bash install.sh && + cd ../sbcl-1.2.13/ && + PATH="$cwd/tmp/sbcl-binary/bin/:$PATH" SBCL_HOME="$cwd/tmp/sbcl-binary/lib/sbcl/" bash make.sh --with-sb-thread && + SBCL_HOME="" INSTALL_ROOT=$cwd/tmp/sbcl/ bash install.sh ) + +mkdir -p tmp/deps/ + +( cd tmp/deps && + tar zxf ../../deps/tarpit/3b-cl-opengl-993d627.tar.gz && + tar zxf ../../deps/tarpit/alexandria-b1c6ee0.tar.gz && + tar zxf ../../deps/tarpit/babel_0.5.0.tar.gz && + tar zxf ../../deps/tarpit/cffi_0.15.0.tar.gz && + tar zxf ../../deps/tarpit/cl-ppcre.tar.gz && + tar zxf ../../deps/tarpit/ironclad.tar.gz && + tar zxf ../../deps/tarpit/mt19937-latest.tar.gz && + tar zxf ../../deps/tarpit/nibbles-v0.12.tar.gz && + tar zxf ../../deps/tarpit/trivial-features_0.8.tar.gz && + tar zxf ../../deps/tarpit/cl-charms-9bb94ef.tar.gz # && + ln -s 3b-cl-opengl-993d627/cl-glut.asd . && + ln -s 3b-cl-opengl-993d627/cl-opengl.asd . && + ln -s alexandria-b1c6ee0/alexandria.asd . && + ln -s babel_0.5.0/babel-streams.asd . && + ln -s babel_0.5.0/babel.asd . && + ln -s cffi_0.15.0/cffi-examples.asd . && + ln -s cffi_0.15.0/cffi-grovel.asd . && + ln -s cffi_0.15.0/cffi-libffi.asd . && + ln -s cffi_0.15.0/cffi-uffi-compat.asd . && + ln -s cffi_0.15.0/cffi.asd . && + ln -s cl-charms/cl-charms.asd . && + ln -s cl-ppcre-2.0.10/cl-ppcre.asd . && + ln -s mt19937-1.1.1/mt19937.asd . && + ln -s nibbles-0.12/nibbles.asd . && + ln -s trivial-features_0.8/trivial-features.asd . && + ln -s ../../src/main/clnl.asd . +) + +SBCL_HOME="" tmp/sbcl/bin/sbcl --core tmp/sbcl/lib/sbcl/sbcl.core --no-sysinit --no-userinit \ + --eval "(require 'asdf)" \ + --eval '(setf asdf:*central-registry* (list #p"tmp/deps/"))' \ + --eval "(asdf:load-system :clnl)" \ + --eval "(asdf:clear-output-translations)" \ + --eval '(sb-ext:save-lisp-and-die "osxsbcl" :executable t :toplevel (function clnl:run))' \ + +chmod +x osxsbcl + +rm -rf tmp diff --git a/bin/buildtravisexec.sh b/bin/buildtravisexec.sh index f61938a..b06a9c5 100755 --- a/bin/buildtravisexec.sh +++ b/bin/buildtravisexec.sh @@ -1,5 +1,9 @@ #!/bin/bash +# This script builds a verion of sbcl with the libraries pre loaded +# for ease of travis. Remember to update bin/buildosxsbcl when you +# update this. + mkdir -p tmp/sbcl cwd=$PWD @@ -43,7 +47,6 @@ mkdir -p tmp/deps/ ln -s docgen_0.1/docgen.asd . ) - SBCL_HOME="" tmp/sbcl/bin/sbcl --core tmp/sbcl/lib/sbcl/sbcl.core \ --eval "(require 'asdf)" \ --eval '(setf asdf:*central-registry* (list #p"tmp/deps/"))' \ diff --git a/bin/run.lisp b/bin/run.lisp index 4aa55dd..481cbbe 100644 --- a/bin/run.lisp +++ b/bin/run.lisp @@ -2,5 +2,4 @@ (require 'asdf) (push #p"deps/" asdf:*central-registry*) (asdf:load-system :clnl) -(sb-thread:make-thread #'clnl-interface:run) -(clnl-cli:run) +(clnl:run) diff --git a/bin/travis.lisp b/bin/travis.lisp index 511cbc7..f17910b 100644 --- a/bin/travis.lisp +++ b/bin/travis.lisp @@ -4,24 +4,4 @@ (asdf:load-system :clnl.internal) (asdf:load-system :clnl-test.internal) -(format t "~%~c[1;33mRunning Tests~c[0m~%" #\Esc #\Esc) -(when (not (clnl-test:run-all-tests)) - (format t "~c[1;31mFailed tests!~c[0m~%" #\Esc #\Esc) - (sb-ext:exit :code 1)) - -(format t "~%~c[1;33mChecking Style~c[0m~%" #\Esc #\Esc) -(when (not (syntax-checker:pretty-print-check-directory "src")) - (format t "~c[1;31mFailed style check!~c[0m~%" #\Esc #\Esc) - (sb-ext:exit :code 1)) -(format t "~c[1;32m- Style Passed!~c[0m~%" #\Esc #\Esc) - -(format t "~%~c[1;33mChecking Docs~c[0m~%" #\Esc #\Esc) -(when (not (docgen:pretty-print-validate-packages - :clnl :clnl-parser :clnl-random :clnl-transpiler :clnl-nvm :clnl-lexer :clnl-interface :clnl-cli)) - (format t "~c[1;31mFailed doc check!~c[0m~%" #\Esc #\Esc) - (sb-ext:exit :code 1)) -(format t "~c[1;32m- Doc Check Passed!~c[0m~%" #\Esc #\Esc) - -(format t "~c[1;30m--------------~c[0m~%" #\Esc #\Esc) -(format t "~c[1;32mBuild Success!~c[0m~%" #\Esc #\Esc) -(sb-ext:exit :code 0) +(load "bin/all.lisp") diff --git a/deps/tarpit/sbcl-1.2.11-x86-64-darwin-binary.tar.bz2 b/deps/tarpit/sbcl-1.2.11-x86-64-darwin-binary.tar.bz2 new file mode 100644 index 0000000..8dccbee Binary files /dev/null and b/deps/tarpit/sbcl-1.2.11-x86-64-darwin-binary.tar.bz2 differ diff --git a/deps/tarpit/sbcl-1.2.13-source.tar.bz2 b/deps/tarpit/sbcl-1.2.13-source.tar.bz2 new file mode 100644 index 0000000..f6d6014 Binary files /dev/null and b/deps/tarpit/sbcl-1.2.13-source.tar.bz2 differ diff --git a/src/main/interface.lisp b/src/main/interface.lisp index b2c359e..27d5eed 100644 --- a/src/main/interface.lisp +++ b/src/main/interface.lisp @@ -102,13 +102,13 @@ DESCRIPTION: ; want to investigate until simply ignoring them becomes a problem. (sb-int:with-float-traps-masked (:invalid) (cl-glut:init) - (gl:clear-color 0 0 0 1) (cl-glut:init-window-size (floor (* *patch-size* (1+ (- (getf *world-dims* :xmax) (getf *world-dims* :xmin))))) (floor (* *patch-size* (1+ (- (getf *world-dims* :ymax) (getf *world-dims* :ymin)))))) - (setf *glut-window-opened* t) - (cl-glut:create-window "CLNL Test Window") (cl-glut:init-display-mode :double :rgba) + (cl-glut:create-window "CLNL Test Window") + (setf *glut-window-opened* t) + (gl:clear-color 0 0 0 1) (cl-glut:display-func (cffi:get-callback 'display)) (glut:reshape-func (cffi:callback reshape)) (cl-glut:idle-func (cffi:get-callback 'idle)) @@ -136,9 +136,9 @@ DESCRIPTION: (sb-int:with-float-traps-masked (:invalid) (when (not *glut-window-opened*) (cl-glut:init) - (gl:clear-color 0 0 0 1) (cl-glut:init-window-size 1 1) (cl-glut:create-window "CLNL Test Window") + (gl:clear-color 0 0 0 1) (set-turtle-list) (setf *glut-window-opened* t)) (let diff --git a/src/main/main.lisp b/src/main/main.lisp index 749c765..dcc7ca0 100644 --- a/src/main/main.lisp +++ b/src/main/main.lisp @@ -23,12 +23,10 @@ ARGUMENTS AND VALUES: DESCRIPTION: - RUN implements a very simple REPL." - (loop - :for str := (progn (format t "> ") (force-output) (read-line)) - :while str - :do (p (e (r str)))) - (sb-ext:exit)) + RUN starts up the CLNL system." + + (sb-thread:make-thread #'clnl-cli:run) + (clnl-interface:run)) (defun boot () "BOOT => RESULT diff --git a/src/test/viewtests.lisp b/src/test/viewtests.lisp index 0eca5ab..587eb25 100644 --- a/src/test/viewtests.lisp +++ b/src/test/viewtests.lisp @@ -1,7 +1,7 @@ (in-package #:clnl-test) (defviewtest "Basic 1" "crt 1" - "FE38C1C9873FD97451A41EB89CE47E60DAB0DD03") + "A41D8146DD81EF27AF2B97955C66E982CFA0A465") (defviewtest "Basic 2" "crt 10 ask turtles [ fd 1 ]" - '("99673570760F0A2E3B49B858AFC8CCDAE16C78D5" "9A7CB6E13203687AB09CBA4CEFF7912534D69542")) + '("DEC2ED793C08A1680DD601BD3E9B81927994C123" "788EAE5B41CE031672672C372EDBCDFD9B309E64"))