MT#55283 make the build reproducible

Whilst working on the Reproducible Builds effort [0], we noticed that
rtpengine could not be built reproducibly.

This is because the manpages generated by pandoc contained the current
build date.

An (upstreamable) patch is attached that uses the value from the
SOURCE_DATE_EPOCH environment variable if available.

 [0] https://reproducible-builds.org/

Change-Id: I2eb22dc5f57af69d217fb06c1c126e7e40dbd451
pull/1747/head
Chris Lamb 2 years ago committed by Richard Fuchs
parent c06f73fcc9
commit ea6cc29e83

@ -38,7 +38,7 @@ $(DAEMONSRCS) $(HASHSRCS): $(patsubst %,../daemon/%,$(DAEMONSRCS)) $(patsubst %,
cat "$<" | sed '/^# /d; s/^##/#/' | \
pandoc -s -t man \
-M "footer:$(RTPENGINE_VERSION)" \
-M "date:$(shell date -I)" \
-M "date:$(BUILD_DATE)" \
-o "$@"
resample.c codeclib.strhash.c mix.c packet.c: fix_frame_channel_layout.h

@ -64,3 +64,11 @@ ifneq ($(DBG),yes)
endif
endif
endif
DATE_FMT = +%Y-%m-%d
ifdef SOURCE_DATE_EPOCH
BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u "$(DATE_FMT)")
else
BUILD_DATE ?= $(shell date "$(DATE_FMT)")
endif

Loading…
Cancel
Save