From 6ad1a9739fe685e2ed9ca2c515b15e772f3f12b2 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 1 Jun 2017 19:45:15 +0200 Subject: [PATCH] build: produce reproducible self contained executable 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 --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 0712cada7..990913dad 100644 --- a/Makefile +++ b/Makefile @@ -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