Skip to content

Commit 605e0d2

Browse files
committed
make artifacts: remove dependency on GNU tar
Part of issue 81 Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
1 parent a7f2280 commit 605e0d2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ DEBUG ?=
66

77
export SOURCE_DATE_EPOCH ?= $(shell git log -1 --pretty=%ct)
88
SOURCE_DATE_EPOCH_ISO8601 := $(shell date -u -Iseconds -r $(SOURCE_DATE_EPOCH) | sed -e s/+00:00/Z/)
9-
# https://reproducible-builds.org/docs/archives/
10-
TAR ?= gtar --sort=name --mtime="@$(SOURCE_DATE_EPOCH)" --owner=0 --group=0 --numeric-owner --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime
9+
10+
TAR ?= tar --uid=0 --gid=0 --numeric-owner
1111
TOUCH ?= touch -d $(SOURCE_DATE_EPOCH_ISO8601)
1212
# Not necessary to use GNU's gzip
1313
GZIP ?= gzip -9 -n
@@ -131,7 +131,10 @@ define make_artifacts
131131
rm -rf _artifacts/$(1)
132132
$(MAKE) ARCH=$(1) DESTDIR=_artifacts/$(1) install.bin install.doc
133133
file -bp _artifacts/$(1)/$(PREFIX)/bin/socket_vmnet | grep -q "Mach-O 64-bit executable $(1)"
134-
$(TAR) -C _artifacts/$(1) -cf _artifacts/socket_vmnet-$(VERSION_TRIMMED)-$(1).tar ./
134+
# BSD tar does not have `--mtime=TIMESTAMP` option
135+
find _artifacts/$(1) -exec $(TOUCH) {} \;
136+
# BSD tar does not have `--sort=name` option
137+
(cd _artifacts/$(1) && find -s . -print0 | $(TAR) -cf ../socket_vmnet-$(VERSION_TRIMMED)-$(1).tar --null -n --files-from /dev/stdin)
135138
$(GZIP) _artifacts/socket_vmnet-$(VERSION_TRIMMED)-$(1).tar
136139
rm -rf _artifacts/$(1)
137140
$(MAKE) clean

0 commit comments

Comments
 (0)