26 lines
1.1 KiB
Common Lisp
26 lines
1.1 KiB
Common Lisp
(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)
|