projects/guix·blob python-team · refs

44 lines · 2.3 KiB

1From <https://github.com/bmwiedemann/psm/commit/98acae1a6f2c9b2e6014eac4070a817c9d0fd8a2>.
2
3From 98acae1a6f2c9b2e6014eac4070a817c9d0fd8a2 Mon Sep 17 00:00:00 2001
4From: "Bernhard M. Wiedemann" <[email protected]>
5Date: Sun, 23 Jul 2017 07:02:28 +0200
6Subject: [PATCH] Allow to override build date
7
8in order to make builds reproducible.
9See https://reproducible-builds.org/ for why this is good
10and https://reproducible-builds.org/specs/source-date-epoch/
11for the definition of this variable.
12
13Also uses UTC to be independent of timezone settings.
14---
15 Makefile | 2 +-
16 ipath/Makefile | 2 +-
17 2 files changed, 2 insertions(+), 2 deletions(-)
18
19diff --git a/Makefile b/Makefile
20index d79c4bd..99406ef 100644
21--- a/Makefile
22+++ b/Makefile
23@@ -270,7 +270,7 @@ ${TARGLIB}.so.${MAJOR}: ${TARGLIB}.so.${MAJOR}.${MINOR}
24 # file around. Generate it such that the ident command can find it
25 # and strings -a | grep InfiniPath does a reasonable job as well.
26 ${TARGLIB}.so.${MAJOR}.${MINOR}: ${${TARGLIB}-objs}
27- date +'char psmi_infinipath_revision[] ="$$""Date: %F %R ${rpm_extra_description}InfiniPath $$";' > ${lib_build_dir}/_revision.c
28+ date -u -d@$${SOURCE_DATE_EPOCH:-$$(date +%s)} +'char psmi_infinipath_revision[] ="$$""Date: %F %R ${rpm_extra_description}InfiniPath $$";' > ${lib_build_dir}/_revision.c
29 $(CC) -c $(BASECFLAGS) $(INCLUDES) _revision.c -o _revision.o
30 $(CC) $(LDFLAGS) -o $@ -Wl,-soname=${TARGLIB}.so.${MAJOR} -shared -Wl,--unique='*fastpath*' \
31 ${${TARGLIB}-objs} _revision.o -L$(build_dir)/ipath $(LDLIBS)
32diff --git a/ipath/Makefile b/ipath/Makefile
33index 8c2cc6e..73abd6f 100644
34--- a/ipath/Makefile
35+++ b/ipath/Makefile
36@@ -70,7 +70,7 @@ ${TARGLIB}.so.${MAJOR}: ${TARGLIB}.so.${MAJOR}.${MINOR}
37 # file around. Generate it such that the ident command can find it
38 # and strings -a | grep InfiniPath does a reasonable job as well.
39 ${TARGLIB}.so.${MAJOR}.${MINOR}: ${${TARGLIB}-objs}
40- date +'static __attribute__ ((unused)) char __psc_infinipath_revision[] ="$$""Date: %F %R ${rpm_extra_description}InfiniPath $$";' > _revision.c
41+ date -u -d@$${SOURCE_DATE_EPOCH:-$$(date +%s)} +'static __attribute__ ((unused)) char __psc_infinipath_revision[] ="$$""Date: %F %R ${rpm_extra_description}InfiniPath $$";' > _revision.c
42 $(CC) -c $(BASECFLAGS) $(INCLUDES) _revision.c -o _revision.o
43 $(CC) -o $@ -Wl,-soname=${TARGLIB}.so.${MAJOR} -shared \
44 -Wl,--unique='*fastpath*' \