39 lines
1.1 KiB
Diff
39 lines
1.1 KiB
Diff
From 5345e8b57d300b14c36b8519e18f67096e4b8d78 Mon Sep 17 00:00:00 2001
|
|
From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
|
|
Date: Thu, 11 Jul 2019 10:33:52 +0200
|
|
Subject: [PATCH 1/3] Allow to override build date with SOURCE_DATE_EPOCH
|
|
|
|
in order to make builds reproducible.
|
|
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.
|
|
|
|
Also use UTC/gmtime to be independent of timezone.
|
|
---
|
|
SConstruct | 5 ++---
|
|
1 file changed, 2 insertions(+), 3 deletions(-)
|
|
|
|
diff --git SConstruct SConstruct
|
|
index 950a5289..763f2e36 100644
|
|
--- a/SConstruct
|
|
+++ b/SConstruct
|
|
@@ -1,5 +1,4 @@
|
|
-import os, sys, errno, SCons
|
|
-from time import gmtime, strftime
|
|
+import os, sys, time, errno, SCons
|
|
|
|
#---------------#
|
|
# Build Options #
|
|
@@ -395,7 +394,7 @@ else:
|
|
#------------------------#
|
|
# Version, debug/release #
|
|
#------------------------#
|
|
-version = strftime("%Y-%m-%d")
|
|
+version = time.strftime("%Y-%m-%d", time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))))
|
|
build_dir = 'build'
|
|
if env['release']:
|
|
# release build, debugging off, optimizations on
|
|
--
|
|
2.29.0.rc1
|
|
|