Skip to content

Commit

Permalink
update docs and makefiles for luastatic build
Browse files Browse the repository at this point in the history
fix #4
  • Loading branch information
jaromil committed Oct 16, 2021
1 parent dd9e5dc commit a9466f9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ luastatic:
CC=$(CC) AR=$(AR) INCLUDE="$(INCLUDE)" LDADD="$(LDADD)" CFLAGS="$(CFLAGS)" make -C src

devuan-luajit-shared: luastatic
$(CC) -o harvest $(CFLAGS) $(INCLUDE) src/harvest.lua.c src/lfs.a $(LDADD)
$(CC) -o harvest $(CFLAGS) $(INCLUDE) src/harvest.luastatic.c src/lfs.a $(LDADD)

devuan-luajit-static: LDADD = src/luajit/src/libluajit.a /usr/lib/${ARCH}-linux-musl/libc.a
devuan-luajit-static: INCLUDE = -I luajit/src
devuan-luajit-static: CC = musl-gcc
devuan-luajit-static: CFLAGS = -Os -static
devuan-luajit-static: luastatic luajit
$(CC) -static -o harvest $(CFLAGS) -I src/luajit/src src/harvest.lua.c src/lfs.a $(LDADD) -lm
$(CC) -static -o harvest $(CFLAGS) -I src/luajit/src src/harvest.luastatic.c src/lfs.a $(LDADD) -lm

mingw32-luajit-static: CC=x86_64-w64-mingw32-gcc
mingw32-luajit-static: AR=x86_64-w64-mingw32-ar
mingw32-luajit-static: INCLUDE = -I luajit/src
mingw32-luajit-static: LDADD = src/luajit/src/libluajit.a
mingw32-luajit-static: LDLIBS=-lm
mingw32-luajit-static: luastatic luajit-win
$(CC) -static -o harvest.exe $(CFLAGS) $(INCLUDE) src/harvest.lua.o src/lfs.a $(LDADD)
$(CC) -static -o harvest.exe $(CFLAGS) $(INCLUDE) src/harvest.luastatic.c src/lfs.a $(LDADD)

win32: mingw32-luajit-static

Expand All @@ -51,7 +51,7 @@ clean-luajit:

clean:
rm -f src/*.o src/*.a
rm -f src/harvest.lua.c
rm -f src/harvest.luastatic.c

# install:
# install -d $(PREFIX)/share/harvest/file-extension-list/render/
Expand Down
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@ Harvest is designed to operate on folders containing files without exploding the

## :floppy_disk: Installation

Harvest requires `zsh` to be installed and works on all desktop platforms supported by it (GNU/Linux, Apple/OSX and MS/Windows).
Harvest works on all desktop platforms supported by it (GNU/Linux, Apple/OSX and MS/Windows).

To be built from source, Harvest requires the following packages to be installed in your system:
- pkg-config
- luarocks
- libluajit-5.1-dev

Then inside the luarocks package manager it should be installed luastatic and inspect:
```
sudo luarocks install luastatic
sudo luarocks install inspect
```

From inside the source, just type:

Expand All @@ -22,13 +33,8 @@ sudo make install
```
to install into `/usr/local/share/harvest`.


The environmental variable `HARVEST_PREFIX` can be set when running harvest to indicate different installation directories. Using harvest on different operating systems than GNU/Linux/BSD may require tweaking of this variable.

Other required applications are likely to be already found on your system:
```
zsh awk grep xclip
```
Extended functionalities can be attained by installing [TMSU](https://tmsu.org/) (see below "Advanced Usage").

## :video_game: Usage
Expand Down
4 changes: 3 additions & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
CFLAGS += $(shell pkg-config luajit --cflags)

SOURCES = harvest.lua \
cliargs.lua cliargs/*.lua cliargs/utils/*.lua \
align.lua
Expand All @@ -6,4 +8,4 @@ all:
$(CC) -c $(INCLUDE) $(CFLAGS) lfs.c -o lfs.o
$(AR) rcs lfs.a lfs.o
CC="" luastatic $(SOURCES) lfs.a
$(CC) -c $(INCLUDE) $(CFLAGS) harvest.lua.c
$(CC) -c $(INCLUDE) $(CFLAGS) harvest.luastatic.c

0 comments on commit a9466f9

Please sign in to comment.