Skip to content

Commit

Permalink
build: produce reproducible self contained executable
Browse files Browse the repository at this point in the history
Giving tar the parameter '--sort=name' sorts direcory entries, but keeps
single files as-is. So instead sort the list retrieved by find.

Also set the file mode...

Works for me. [TM] :D
  • Loading branch information
eworm-de committed Jun 1, 2017
1 parent 7f5cb5e commit 6ad1a97
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ vis-single-payload.inc: $(EXECUTABLES) lua/*
echo '#ifndef VIS_SINGLE_PAYLOAD_H' > $@
echo '#define VIS_SINGLE_PAYLOAD_H' >> $@
echo 'static unsigned char vis_single_payload[] = {' >> $@
tar --sort=name --mtime='2014-07-15 01:23Z' --owner=0 --group=0 --numeric-owner -c \
$(EXECUTABLES) $$(find lua -name '*.lua') | xz -T 1 | od -t x1 -A none -v | \
sed 's/\([0-9a-f]\+\)/0x\1,/g;$$s/,$$/ };/' >> $@
tar --mtime='2014-07-15 01:23Z' --owner=0 --group=0 --numeric-owner --mode='a+rX-w' -c \
$(EXECUTABLES) $$(find lua -name '*.lua' | LC_ALL=C sort) | xz -T 1 | \
od -t x1 -A none -v | sed 's/\([0-9a-f]\+\)/0x\1,/g;$$s/,$$/ };/' >> $@
echo '#endif' >> $@

vis-single: vis-single.c vis-single-payload.inc
Expand Down

0 comments on commit 6ad1a97

Please sign in to comment.