merge bitcoin#23862: Hardcode last modified timestamp in Qt RCC

This commit is contained in:
Kittywhiskers Van Gogh 2021-12-24 23:14:34 +02:00 committed by PastaPastaPasta
parent de72a04582
commit 52e0dc4919
2 changed files with 26 additions and 0 deletions

View File

@ -13,6 +13,7 @@ $(package)_patches += dont_hardcode_x86_64.patch fix_montery_include.patch
$(package)_patches += fix_android_jni_static.patch dont_hardcode_pwd.patch $(package)_patches += fix_android_jni_static.patch dont_hardcode_pwd.patch
$(package)_patches += qtbase-moc-ignore-gcc-macro.patch fix_limits_header.patch $(package)_patches += qtbase-moc-ignore-gcc-macro.patch fix_limits_header.patch
$(package)_patches += fix_bigsur_style.patch use_android_ndk23.patch $(package)_patches += fix_bigsur_style.patch use_android_ndk23.patch
$(package)_patches += rcc_hardcode_timestamp.patch
$(package)_patches += fast_fixed_dtoa_no_optimize.patch $(package)_patches += fast_fixed_dtoa_no_optimize.patch
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
@ -239,6 +240,7 @@ define $(package)_preprocess_cmds
patch -p1 -i $($(package)_patch_dir)/fix_montery_include.patch && \ patch -p1 -i $($(package)_patch_dir)/fix_montery_include.patch && \
patch -p1 -i $($(package)_patch_dir)/fix_bigsur_style.patch && \ patch -p1 -i $($(package)_patch_dir)/fix_bigsur_style.patch && \
patch -p1 -i $($(package)_patch_dir)/use_android_ndk23.patch && \ patch -p1 -i $($(package)_patch_dir)/use_android_ndk23.patch && \
patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch && \
patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \ patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \
patch -p1 -i $($(package)_patch_dir)/fast_fixed_dtoa_no_optimize.patch && \ patch -p1 -i $($(package)_patch_dir)/fast_fixed_dtoa_no_optimize.patch && \
mkdir -p qtbase/mkspecs/macx-clang-linux &&\ mkdir -p qtbase/mkspecs/macx-clang-linux &&\

View File

@ -0,0 +1,24 @@
Hardcode last modified timestamp in Qt RCC
This change allows the already built qt package to be reused even with
the SOURCE_DATE_EPOCH variable set, e.g., for Guix builds.
--- old/qtbase/src/tools/rcc/rcc.cpp
+++ new/qtbase/src/tools/rcc/rcc.cpp
@@ -227,14 +227,7 @@ void RCCFileInfo::writeDataInfo(RCCResourceLibrary &lib)
if (lib.formatVersion() >= 2) {
// last modified time stamp
- const QDateTime lastModified = m_fileInfo.lastModified();
- quint64 lastmod = quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0);
- static const quint64 sourceDate = 1000 * qgetenv("QT_RCC_SOURCE_DATE_OVERRIDE").toULongLong();
- if (sourceDate != 0)
- lastmod = sourceDate;
- static const quint64 sourceDate2 = 1000 * qgetenv("SOURCE_DATE_EPOCH").toULongLong();
- if (sourceDate2 != 0)
- lastmod = sourceDate2;
+ quint64 lastmod = quint64(1);
lib.writeNumber8(lastmod);
if (text || pass1)
lib.writeChar('\n');