Skip to content

Commit

Permalink
Merge pull request #101609 from 7c6f434c/nyxt-deps
Browse files Browse the repository at this point in the history
lispPackages.nyxt: build a binary
  • Loading branch information
7c6f434c authored Oct 24, 2020
2 parents a5061c6 + 4d73ca7 commit 61d82f0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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*
Expand All @@ -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)
)")
}
Expand Down
13 changes: 13 additions & 0 deletions pkgs/development/lisp-modules/lisp-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 61d82f0

Please sign in to comment.