diff --git a/Makefile b/Makefile index 31d30f4..a61ff38 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/build.lisp b/build.lisp index b6cc875..bbf5102 100644 --- a/build.lisp +++ b/build.lisp @@ -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) diff --git a/default.nix b/default.nix index a78c991..c0a6e49 100644 --- a/default.nix +++ b/default.nix @@ -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' ]; diff --git a/flake.nix b/flake.nix index 9dd2d34..6b069ea 100644 --- a/flake.nix +++ b/flake.nix @@ -16,7 +16,7 @@ in { devShell = import ./shell.nix { inherit pkgs; }; - defaultPackage = pkgs.callPackage ./default.nix { }; + packages.default = pkgs.callPackage ./default.nix { }; } ); } diff --git a/shell.nix b/shell.nix index 16401a2..d591c45 100644 --- a/shell.nix +++ b/shell.nix @@ -41,6 +41,15 @@ in mkShell rec { rustfmt rust-analyzer just + openssl + openssl.out + openssl.dev + ]; + + nativeLibs = [ + openssl + openssl.out + openssl.dev ]; shellHook = ''