rcc_hardcode_timestamp.patch raw

   1  Hardcode last modified timestamp in Qt RCC
   2  
   3  This change allows the already built qt package to be reused even with
   4  the SOURCE_DATE_EPOCH variable set, e.g., for Guix builds.
   5  
   6  
   7  --- old/qtbase/src/tools/rcc/rcc.cpp
   8  +++ new/qtbase/src/tools/rcc/rcc.cpp
   9  @@ -201,14 +201,7 @@ void RCCFileInfo::writeDataInfo(RCCResourceLibrary &lib)
  10   
  11       if (lib.formatVersion() >= 2) {
  12           // last modified time stamp
  13  -        const QDateTime lastModified = m_fileInfo.lastModified(QTimeZone::UTC);
  14  -        quint64 lastmod = quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0);
  15  -        static const quint64 sourceDate = 1000 * qgetenv("QT_RCC_SOURCE_DATE_OVERRIDE").toULongLong();
  16  -        if (sourceDate != 0)
  17  -            lastmod = sourceDate;
  18  -        static const quint64 sourceDate2 = 1000 * qgetenv("SOURCE_DATE_EPOCH").toULongLong();
  19  -        if (sourceDate2 != 0)
  20  -            lastmod = sourceDate2;
  21  +        quint64 lastmod = quint64(1);
  22           lib.writeNumber8(lastmod);
  23           if (text || pass1)
  24               lib.writeChar('\n');
  25