From c92c834cf6243d842f3fe2bb1129f2dfe63bd714 Mon Sep 17 00:00:00 2001 From: XeroOl Date: Sat, 8 Jun 2024 00:35:28 -0500 Subject: [PATCH] More tools changes --- Makefile | 16 +++++++++------- tools/unvendor.fnl | 11 +++++++---- tools/vendor.fnl | 6 +++--- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 362beb3..36cf08d 100644 --- a/Makefile +++ b/Makefile @@ -12,8 +12,10 @@ DESTDIR ?= PREFIX ?= /usr/local BINDIR ?= $(PREFIX)/bin -OPTS=--add-package-path "src/?.lua" --add-fennel-path "src/?.fnl" -OPTS+=--skip-include fennel.compiler +FENNELFLAGS=--add-package-path "src/?.lua" --add-fennel-path "src/?.fnl" +FENNELFLAGS+=--skip-include fennel.compiler +EXTRA_FENNELFLAGS ?= +FENNELFLAGS+= $(EXTRA_FENNELFLAGS) .PHONY: all clean test install ci selfcheck @@ -21,7 +23,7 @@ all: $(EXE) $(EXE): $(SRC) echo "#!/usr/bin/env $(LUA)" > $@ - $(FENNEL) $(OPTS) --require-as-include --compile src/fennel-ls.fnl >> $@ + $(FENNEL) $(FENNELFLAGS) --require-as-include --compile src/fennel-ls.fnl >> $@ chmod 755 $@ clean: @@ -29,10 +31,10 @@ clean: rm -rf $(BUILD_DIR) test: - TESTING=1 $(FENNEL) $(OPTS) --add-fennel-path "test/faith/?.fnl" test/init.fnl + TESTING=1 $(FENNEL) $(FENNELFLAGS) --add-fennel-path "test/faith/?.fnl" test/init.fnl repl: - $(FENNEL) $(OPTS) --add-fennel-path "test/faith/?.fnl" + $(FENNEL) $(FENNELFLAGS) --add-fennel-path "test/faith/?.fnl" testall: $(MAKE) test LUA=lua5.1 @@ -42,7 +44,7 @@ testall: $(MAKE) test LUA=luajit docs: - $(FENNEL) $(OPTS) --add-fennel-path "tools/?.fnl" tools/gen-docs.fnl + $(FENNEL) $(FENNELFLAGS) --add-fennel-path "tools/?.fnl" tools/gen-docs.fnl install: $(EXE) mkdir -p $(DESTDIR)$(BINDIR) && cp $< $(DESTDIR)$(BINDIR)/ @@ -50,4 +52,4 @@ install: $(EXE) ci: testall $(EXE) selfcheck: - $(FENNEL) $(OPTS) src/fennel-ls.fnl --check $(SRC) + $(FENNEL) $(FENNELFLAGS) src/fennel-ls.fnl --check $(SRC) diff --git a/tools/unvendor.fnl b/tools/unvendor.fnl index b68dfde..a24cfba 100644 --- a/tools/unvendor.fnl +++ b/tools/unvendor.fnl @@ -5,12 +5,15 @@ "src/fennel.lua" ;; delete vendored "fennel" (build dependency) "fennel" - ;; delete vendored "faith" (build dependency) + ;; delete vendored "faith" (test dependency) "test/faith/faith.fnl" - ;; delete vendored "penlight" (build dependency) + ;; delete vendored "penlight" (test dependency) "test/pl/stringio.lua") -;; write a dummy file to forward to the installation of penlight on LUA_PATH -(doto (io.open "test/pl/stringio.lua") + ;; I can't delete rxi/json because fennel-ls has a forked version with custom patches. + ;; I'm working to address this. fennel-ls' forked version will not interfere with the normal version because its statically linked. + +;; write a dummy file so that the tests search for penlight on LUA_PATH +(doto (io.open "test/pl/stringio.lua" :w) (: :write "(require :pl.stringio)") (: :close)) diff --git a/tools/vendor.fnl b/tools/vendor.fnl index ff04c8a..147de65 100644 --- a/tools/vendor.fnl +++ b/tools/vendor.fnl @@ -16,15 +16,15 @@ "https://git.sr.ht/~technomancy/fennel" fennel-version) (sh :make :-C "build/fennel")) -sh :cp "build/fennel/fennel" "." +(sh :cp "build/fennel/fennel" ".") (sh :cp "build/fennel/fennel.lua" "src") ;; get faith -(when (not (io.open "build/fennel/faith.fnl")) +(when (not (io.open "build/faith/faith.fnl")) (git-clone "build/faith" "https://git.sr.ht/~technomancy/faith" faith-version)) (sh :cp "build/faith/faith.fnl" "test/faith/faith.fnl") ;; get penlight.stringio -(when (not (io.open "build/pl/stringio.lua")) +(when (not (io.open "build/penlight/lua/pl/stringio.lua")) (git-clone "build/penlight" "https://github.com/lunarmodules/Penlight" penlight-version)) (sh :cp "build/penlight/lua/pl/stringio.lua" "test/pl/stringio.lua")