shell.nix and default.nix work right now

This commit is contained in:
Chris Cochrun 2024-04-21 13:17:26 -05:00
parent 54dab680d6
commit aee6d10404
5 changed files with 32 additions and 80 deletions

View file

@ -1,25 +1,11 @@
(load (sb-ext:posix-getenv "ASDF"))
(asdf:load-asd (pathname (truename "tfcserver.asd")))
(asdf:load-system "tfcserver")
(require "cffi")
(when (find-package :ql) (funcall (read-from-string "ql:quickload") :cffi))
(when (find-package :ql) (funcall (read-from-string "ql:quickload") :deploy))
(defun pkg-config-add-lib (libname)
(let ((process (sb-ext:run-program "pkg-config"
(list libname "--libs-only-L")
:input t :output :stream :wait t)))
(let ((stream (sb-ext:process-output process)))
(loop for line = (read-line stream nil nil)
while line do
;; Drop "-L" part, and add '/' to the end. '/' IS necessary!
(pushnew (pathname (concatenate 'string (subseq line 2) "/"))
cffi:*foreign-library-directories*))
(sb-ext:process-close process))))
;; Get libssl
(pkg-config-add-lib "libssl")
(when (find-package :ql) (funcall (read-from-string "ql:quickload") :tfcserver))
(push :deploy-console *features*)
(asdf:make :tfcserver)
(quit)
(asdf:load-system 'tfcserver)
;; (asdf:make :tfcserver)
;; (asdf:operate :program-op :tfcserver)
(asdf:disable-output-translations)
(sb-ext:save-lisp-and-die
#p"tfcserver"
:compression t
:toplevel #'tfcserver::main
:executable t)