Allow to override build date
authorBernhard M. Wiedemann <bwiedemann@suse.de>
Mon, 7 Aug 2017 12:41:29 +0000 (14:41 +0200)
committerStefan Schmidt <stefan@osg.samsung.com>
Mon, 7 Aug 2017 12:41:29 +0000 (14:41 +0200)
Summary:
Allow to override build date
for distribution packages that use autoreconf
to recreate the configure script

See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

Note: This patch will work with GNU date. If BSD date support is
important, a more complex patch needs to be done.

http://rb.zq1.de/compare.factory-20170713/efl-compare.out
also shows other diffs in .edj files that still remain

@fix

T5495

Reviewers: cedric

Subscribers: stefan_schmidt, jayji, netstar, jpeg

Maniphest Tasks: T5495

Differential Revision: https://phab.enlightenment.org/D5023

m4/efl.m4

index 1fb49b9..a8ca427 100644 (file)
--- a/m4/efl.m4
+++ b/m4/efl.m4
@@ -26,7 +26,7 @@ m4_define([v_maj], [$1])dnl
 m4_define([v_min], [$2])dnl
 m4_define([v_mic], [$3])dnl
 m4_define([dev_version], m4_esyscmd([(git rev-list --count HEAD 2>/dev/null || echo 0) | tr -d '\n']))dnl
-m4_define([v_time], m4_esyscmd([(git log --format=%ci -1 2>/dev/null || date "+%Y-%m-%d %H:%M:%S %z") | tr -d '\n']))dnl
+m4_define([v_time], m4_esyscmd([(git log --format=%ci -1 2>/dev/null || date -u -d@${SOURCE_DATE_EPOCH:-$(date +%s)} "+%Y-%m-%d %H:%M:%S %z") | tr -d '\n']))dnl
 m4_define([v_rev], m4_if($4, dev, [dev_version], [0]))dnl
 m4_define([v_rel], [])dnl
 m4_define([def_build_profile], m4_if($4, dev, [dev], [release]))dnl