Skip to content

Commit

Permalink
Add Electron dependency handling in the build logic.
Browse files Browse the repository at this point in the history
Optional.  Typically there's no network access during build (e.g. Flatpak) but
it's useful for local dev builds.
  • Loading branch information
aadcg committed Dec 16, 2024
1 parent 789ea5e commit 1ac3446
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion engineer.atlas.Nyxt-Electron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ modules:
- sed -i "s|(asdf:system-source-directory :cl-electron)|#P\"$FLATPAK_DEST\"|" _build/cl-electron/source/core.lisp

# Compile Nyxt
- make install NYXT_RENDERER=electron DESTDIR=${FLATPAK_DEST} PREFIX=
- make install NYXT_RENDERER=electron NODE_SETUP=false DESTDIR=${FLATPAK_DEST} PREFIX=

# Fix sandbox
- sed -i "s|\"electron\",|\"zypak-wrapper /app/node_modules/electron/dist/electron\",|" ${FLATPAK_DEST}/package.json
Expand Down
7 changes: 7 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ LISP_FLAGS ?= $(SBCL_FLAGS) --no-userinit --non-interactive
NYXT_SUBMODULES ?= true
NYXT_RENDERER ?= gi-gtk
NASDF_USE_LOGICAL_PATHS ?= true
NODE_SETUP ?= true

export NYXT_SUBMODULES
export NYXT_RENDERER
export NASDF_USE_LOGICAL_PATHS
export NODE_SETUP

.PHONY: help
help:
Expand All @@ -44,6 +46,11 @@ lisp_quit:=--eval '(uiop:quit 0 \#+bsd nil)'
## keep a Make dependency on the Lisp files.
lisp_files := nyxt.asd $(shell find . -type f -name '*.lisp')
nyxt: $(lisp_files)
if [ "$(NYXT_RENDERER)" = "electron" ] && \
[ "$(NODE_SETUP)" = "true" ] && \
[ "$(NYXT_SUBMODULES)" = "true" ]; then \
npm install --verbose $(makefile_dir)_build/cl-electron; \
fi
$(lisp_eval) '(asdf:load-system :nyxt/$(NYXT_RENDERER)-application)' \
--eval '(asdf:make :nyxt/$(NYXT_RENDERER)-application)' \
$(lisp_quit) || (printf "\n%s\n%s\n" "Compilation failed, see the above stacktrace." && exit 1)
Expand Down

0 comments on commit 1ac3446

Please sign in to comment.