From b530aab00f72dad23d646d1119ee5059a2e1ac08 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Tue, 11 Aug 2026 12:28:39 -0700 Subject: [PATCH] Redistributable builds --- .gitea/workflows/build.yaml | 4 ++-- clash/.gitignore | 1 + clash/Makefile | 24 +++++++++++++++++++++--- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 4a99eb2..47dd003 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -28,13 +28,13 @@ jobs: EOF - name: Build run: | - make -C "${{ gitea.workspace }}/clash" + make -C "${{ gitea.workspace }}/clash" deploy-build - name: Prepare archive run: | mkdir usr/ target="${PWD}/usr" cd "${{ gitea.workspace }}/clash" - make PREFIX="${target}" install + make PREFIX="${target}" deploy-install - name: Make artifact name id: name run: | diff --git a/clash/.gitignore b/clash/.gitignore index 7acaae4..ba255eb 100644 --- a/clash/.gitignore +++ b/clash/.gitignore @@ -1,3 +1,4 @@ clash clash.md clash.1 +bin/ diff --git a/clash/Makefile b/clash/Makefile index 9200edf..a9304d4 100644 --- a/clash/Makefile +++ b/clash/Makefile @@ -2,14 +2,16 @@ LISP=sbcl PREFIX=~/.local +override SRCS=clash.asd format.lisp parse-date.lisp clash.lisp + all: clash clash.1 -clash: clash.asd format.lisp parse-date.lisp clash.lisp +clash: $(SRCS) $(LISP) --eval '(ql:quickload :clash)' \ --eval '(asdf:make :clash)' \ --eval '(uiop:quit)' -clash.md: clash.asd format.lisp parse-date.lisp clash.lisp +clash.md: $(SRCS) $(LISP) --eval '(ql:quickload :clash)' \ --eval '(clash:make-markdown-doc)' \ --eval '(uiop:quit)' \ @@ -22,7 +24,23 @@ install: clash clash.1 install -D clash $(PREFIX)/bin/clash install -m0644 -D clash.1 $(PREFIX)/share/man/man1/clash.1 +override DEPLOY_OUTPUT=bin/clash bin/libosicat.so bin/librt.so.1 + +deploy-build: $(DEPLOY_OUTPUT) + +$(DEPLOY_OUTPUT): $(SRCS) + $(LISP) --eval '(push :deploy-console *features*)' \ + --eval "(ql:quickload '(:clash :deploy))" \ + --eval "(asdf:operate 'deploy:deploy-op :clash)" \ + --eval '(uiop:quit)' + +deploy-install: deploy-build + mkdir -m 0755 -p $(PREFIX)/bin $(PREFIX)/lib + cp -R bin $(PREFIX)/lib/clash + ln -s ../lib/clash/clash $(PREFIX)/bin/clash + clean: rm -f clash clash.md clash.1 + rm -rf bin/ -.PHONY: all clean +.PHONY: all deploy-build deploy-install clean