Browse Source

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
(cherry picked from commit ea6cc29e83)
pull/1887/head
Chris Lamb 2 years ago
committed by Richard Fuchs
parent
commit
f4b3d815bf
2 changed files with 9 additions and 1 deletions
  1. +1
    -1
      lib/common.Makefile
  2. +8
    -0
      lib/lib.Makefile

+ 1
- 1
lib/common.Makefile View File

@ -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


+ 8
- 0
lib/lib.Makefile View File

@ -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