From 4d73ca7b48053a6c1cacfb49b2a47d97017fba85 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sun, 25 Oct 2020 01:30:44 +0200 Subject: [PATCH] lispPackages.nyxt: build a binary --- .../lisp-modules/clwrapper/cl-wrapper.sh | 8 ++++++-- pkgs/development/lisp-modules/lisp-packages.nix | 13 +++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh b/pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh index 9836bbe56428..828920c5accc 100755 --- a/pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh +++ b/pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh @@ -95,8 +95,8 @@ nix_lisp_run_single_form(){ nix_lisp_build_system(){ NIX_LISP_FINAL_PARAMETERS=( "$NIX_LISP_EXEC_CODE" "(progn - (asdf:make :$1) - (loop for s in (list $(for i in $3; do echo ":$i"; done)) do (asdf:make s)))" + (asdf:load-system :$1) + (loop for s in (list $(for i in $3; do echo ":$i"; done)) do (asdf:load-system s)))" "$NIX_LISP_EXEC_CODE" "(progn (setf (asdf/system:component-entry-point (asdf:find-system :$1)) ${2:-nil}) #+cffi(setf cffi:*foreign-library-directories* @@ -106,15 +106,19 @@ nix_lisp_build_system(){ :separator \":\") for l in sb-alien::*shared-objects* for ns := (sb-alien::shared-object-namestring l) + do (format *error-output* \"Searching alien object ~s in ~s~%\" + ns libpath) do (and (> (length ns) 0) (not (equal (elt ns 0) \"/\")) (let* ((prefix (find-if (lambda (s) (probe-file (format nil \"~a/~a\" s ns))) libpath)) (fullpath (and prefix (format nil \"~a/~a\" prefix ns)))) (when fullpath + (format *error-output* \"Found: ~s~%\" fullpath) (setf (sb-alien::shared-object-namestring l) fullpath (sb-alien::shared-object-pathname l) (probe-file fullpath))))) ) + $4 (asdf:perform (quote asdf:program-op) :$1) )") } diff --git a/pkgs/development/lisp-modules/lisp-packages.nix b/pkgs/development/lisp-modules/lisp-packages.nix index 35ea301b510e..f8338e48e19a 100644 --- a/pkgs/development/lisp-modules/lisp-packages.nix +++ b/pkgs/development/lisp-modules/lisp-packages.nix @@ -129,6 +129,19 @@ let lispPackages = rec { buildSystems = [ "nyxt" "nyxt-ext" ]; description = "Browser"; + + overrides = x: { + postInstall = '' + echo "Building nyxt binary" + NIX_LISP_PRELAUNCH_HOOK=' + nix_lisp_build_system nyxt/gtk-application \ + "(asdf/system:component-entry-point (asdf:find-system :nyxt/gtk-application))" \ + "" "(format *error-output* \"Alien objects:~%~s~%\" sb-alien::*shared-objects*)" + ' "$out/bin/nyxt-lisp-launcher.sh" + cp "$out/lib/common-lisp/nyxt/nyxt" "$out/bin/" + ''; + }; + deps = with pkgs.lispPackages; [ alexandria bordeaux-threads