trying to build the lisp server in nix

This commit is contained in:
Chris Cochrun 2024-04-03 10:10:18 -05:00
parent c204bd8d96
commit 54dab680d6
5 changed files with 38 additions and 8 deletions

View file

@ -12,5 +12,8 @@ css:
build-site:
rm -rf public && NODE_ENV=production ./themes/blowfish/node_modules/tailwindcss/lib/cli.js -c ./themes/blowfish/tailwind.config.js -i ./themes/blowfish/assets/css/main.css -o ./assets/css/compiled/main.css --jit && hugo --gc --minify
api:
sbcl --load build.lisp
clean:
rm -rf public

View file

@ -1,7 +1,24 @@
(when (find-package :ql) (funcall (read-from-string "ql:quickload") :deploy))
(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)

View file

@ -31,6 +31,7 @@ let
lass
cl-smtp
log4cl
cffi
pkgs.openssl
pkgs.openssl.out
pkgs.openssl.dev
@ -54,18 +55,18 @@ stdenv.mkDerivation {
gnumake
pkg-config
makeWrapper
# openssl
# openssl.out
# openssl.dev
openssl
openssl.out
openssl.dev
];
buildInputs = [
# rustPlatform
# clippy
# rustfmt
# openssl
# openssl.out
# openssl.dev
openssl
openssl.out
openssl.dev
sbcl'
];

View file

@ -16,7 +16,7 @@
in
{
devShell = import ./shell.nix { inherit pkgs; };
defaultPackage = pkgs.callPackage ./default.nix { };
packages.default = pkgs.callPackage ./default.nix { };
}
);
}

View file

@ -41,6 +41,15 @@ in mkShell rec {
rustfmt
rust-analyzer
just
openssl
openssl.out
openssl.dev
];
nativeLibs = [
openssl
openssl.out
openssl.dev
];
shellHook = ''