create and document build.nix

phoen
Daniel Barlow 2022-03-19 16:09:03 +00:00
parent 4ee558f906
commit 417e443ed3
5 changed files with 47 additions and 2 deletions

24
just/Makefile Normal file
View File

@ -0,0 +1,24 @@
FENNEL?=$(fennel)
PREFIX?=/usr/local
PROGRAM_NAME=just
MAIN=$(PROGRAM_NAME).fnl
SOURCES=$(MAIN) listeners.fnl viewplex.fnl webview.fnl
$(PROGRAM_NAME): $(SOURCES) Makefile
(echo -e "#!/usr/bin/env lua\n" ; \
: we reset package.path so that --require-as-include cannot find ; \
: and inline third-party modules ; \
lua -e 'package.path="./?.lua"' $(FENNEL) --require-as-include --compile $(MAIN) ) > $@
chmod +x $@
install:
mkdir -p $(PREFIX)/bin $(PREFIX)/lib/$(PROGRAM_NAME)
cp $(PROGRAM_NAME) $(PREFIX)/bin
# cp interface.xml styles.css $(PREFIX)/lib/$(PROGRAM_NAME)
test:
for i in *-test.fnl ; do lua $(fennel) $$i; done
easylist.txt:
curl https://easylist.to/easylist/easylist.txt -O

View File

@ -2,6 +2,22 @@
Touchscreen-friendly wrapper around Webkit
## Building
If you have Nix
nix-build build.nix
Otherwise, very approximately
* find and install the Lua packages described by the lua5_3.withPackages form in `default.nix`
* install [Fennel](https://fennel-lang.org/setup#downloading-fennel)
* `make`
This *should* result in an executable called `just`, but
YMMV. Consider Nix?
## TO DO
* functional

2
just/build.nix Normal file
View File

@ -0,0 +1,2 @@
with import <nixpkgs> {} ;
callPackage ./. {}

View File

@ -41,5 +41,7 @@ in stdenv.mkDerivation {
nativeBuildInputs = [ lua makeWrapper ];
makeFlags = [ "PREFIX=${placeholder "out"}" ];
postInstall = ''
wrapProgram $out/bin/just --set GI_TYPELIB_PATH "$GI_TYPELIB_PATH"
'';
}

View File

@ -3,7 +3,8 @@
(local { : Gtk : Gdk : WebKit2 : cairo } lgi)
(local {: view} (require :fennel))
(if (os.getenv "JUST_HACKING")
(local {: view} (require :fennel)))
(local Listeners (require :listeners))
(local Webview (require :webview))