1
0
libqt5-qtwebengine/reproducible.patch
Dominique Leuenberger 8b8d376cf5 Accepting request 667732 from KDE:Qt5
- Add reproducible.patch to override chromium build date
  to make package build reproducible (boo#1047218)
- Use openSUSE's ninja for the build so that we can apply fixes there
  that are used by everyone (boo#1118619)

OBS-URL: https://build.opensuse.org/request/show/667732
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqt5-qtwebengine?expand=0&rev=43
2019-01-26 21:18:05 +00:00

38 lines
1.5 KiB
Diff

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