File reproducible.patch of Package libqt5-qtwebengine

Author:     Bernhard M. Wiedemann <bwiedemann@suse.de>
AuthorDate: 2017-08-10 21:41:38 +0200

Allow to override build date

in order to allow for reproducible builds.
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.

simple fix for https://bugs.chromium.org/p/chromium/issues/detail?id=740363
that was fixed upstream in a more complicated way

See also https://bugzilla.opensuse.org/show_bug.cgi?id=1047218 packages do not build reproducibly from including build time

Index: qtwebengine-everywhere-src-5.11.2/src/3rdparty/chromium/build/write_build_date_header.py
===================================================================
--- qtwebengine-everywhere-src-5.11.2.orig/src/3rdparty/chromium/build/write_build_date_header.py
+++ qtwebengine-everywhere-src-5.11.2/src/3rdparty/chromium/build/write_build_date_header.py
@@ -21,6 +21,7 @@ import datetime
 import doctest
 import os
 import sys
+import time
 
 
 def GetFirstSundayOfMonth(year, month):
@@ -88,7 +89,8 @@ def main():
     # Format is expected to be "Mmm DD YYYY HH:MM:SS".
     build_date = args.build_date_override
   else:
-    now = datetime.datetime.utcnow()
+    epoch = int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
+    now = datetime.datetime.utcfromtimestamp(epoch)
     if now.hour < 5:
       # The time is locked at 5:00 am in UTC to cause the build cache
       # invalidation to not happen exactly at midnight. Use the same calculation
openSUSE Build Service is sponsored by