Package: freefem++ / 3.47+dfsg1-1

build_date_from_SOURCE_DATE_EPOCH.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Get build date from SOURCE_DATE_EPOCH (if set), to make the build reproducible
--- a/configure.ac
+++ b/configure.ac
@@ -128,8 +128,12 @@
     TOOL_PARAMETERS($1,$2,$3)
 ])
 
+SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}"
+FF_DATE=$(date -u -d "@$SOURCE_DATE_EPOCH" "+%Y-%m-%d" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+%Y-%m-%d" 2>/dev/null || date -u "+%Y-%m-%d")
+AC_SUBST(FF_DATE,$FF_DATE)
+
 ff_HOSTARCH_pastix=
-echo "#  Build with freefem++ with ./configure " `date`  >$ff_where_lib_conf
+echo "#  Build with freefem++ with ./configure $FF_DATE"  >$ff_where_lib_conf
 # To allow anonymous CVS version to contain a "./configure" and
 # Makefiles
 
@@ -601,7 +605,6 @@
 AC_MSG_CHECKING(prefix dir freefem++  )
 AC_MSG_RESULT($ff_prefix_dir)
 
-FF_DATE=`date`
 AC_DEFINE_UNQUOTED(VersionFreeFemDate,"$FF_DATE",FreeFem++ build date)
 AC_DEFINE_UNQUOTED(FF_PREFIX_DIR,"${ff_prefix_dir}",FreeFem prefix  dir)
 AC_SUBST(ff_prefix_dir,$ff_prefix_dir)
--- a/src/fflib/Makefile.am
+++ b/src/fflib/Makefile.am
@@ -64,5 +64,5 @@
 EXTRA_DIST=strversionnumber.m4
 BUILT_SOURCES=strversionnumber.cpp
 strversionnumber.cpp: $(libff_a_SOURCES2) ../../configure
-	m4 -DVersionFreeFemDate="`date`" strversionnumber.m4 > $@
+	m4 -DVersionFreeFemDate="@FF_DATE@" strversionnumber.m4 > $@
 FORCE:
--- a/src/medit/Makefile.am
+++ b/src/medit/Makefile.am
@@ -17,7 +17,7 @@
 AM_CPPFLAGS=-I$(srcdir)/../libMesh
 BUILT_SOURCES=compil.date
 compil.date: $(ffmedit_SOURCES)
-	echo "#define COMPIL " '"' `date` '(with ff++ $(VERSION))''"' > compil.date
+	echo "#define COMPIL " '" @FF_DATE@ (with ff++ $(VERSION))"' > compil.date
 #.PHONY: compil.date
 
 # ALH - during a parallel make, we should make sure that picking.o is not used before being made by a different