Source: pyqt5 Version: 5.3.2+dfsg-3 Severity: wishlist Tags: patch User: reproducible-bui...@lists.alioth.debian.org Usertags: timestamps toolchain
Hi, the uic python module and the pyrcc tool are currently embedding timestamps into the comments of generated files. This results in packages that can't be built reproducibly, because the timestamp will be a different one on each build (see Qt4 exmaple in [1]). The attached patch removes the timestamp writing in those tools, as this is no useful information anyway. Regards, Reiner [1]: https://reproducible.debian.net/userContent/issues/timestamps_in_source_generated_by_pyqt4_ui_issue.html
diff --git a/debian/changelog b/debian/changelog index 4a86a73..f541d79 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +pyqt5 (5.3.2+dfsg-3.0~reproducible1) UNRELEASED; urgency=low + + * Added patch which removes embedding of timestamps in generated + files, to enable reproducible builds in packages build-depending + on pyqt5. + + -- Reiner Herrmann <rei...@reiner-h.de> Sat, 03 Jan 2015 17:54:54 +0100 + pyqt5 (5.3.2+dfsg-3) unstable; urgency=medium * Fix a typo in debian/tests/control. diff --git a/debian/patches/remove_timestamps.diff b/debian/patches/remove_timestamps.diff new file mode 100644 index 0000000..41f6234 --- /dev/null +++ b/debian/patches/remove_timestamps.diff @@ -0,0 +1,59 @@ +Description: prevent embedding of timestamps in files generated by rcc and uic + Timestamps in generated files will make packages using those tools no longer + build reproducibly, because the files will differ in each build. + As those timestamps are no useful information, they can be left out. +Author: Reiner Herrmann <rei...@reiner-h.de> + +Index: pyqt5-5.3.2+dfsg/pyrcc/rcc.cpp +=================================================================== +--- pyqt5-5.3.2+dfsg.orig/pyrcc/rcc.cpp ++++ pyqt5-5.3.2+dfsg/pyrcc/rcc.cpp +@@ -45,7 +45,6 @@ + #include <qfile.h> + #include <qfileinfo.h> + #include <qlocale.h> +-#include <qdatetime.h> + #include <qtextstream.h> + #include <qbytearray.h> + #include <qhash.h> +@@ -421,8 +420,7 @@ RCCResourceLibrary::writeHeader(FILE *ou + fprintf(out, "# -*- coding: utf-8 -*-\n\n"); + fprintf(out, "# Resource object code\n"); + fprintf(out, "#\n"); +- fprintf(out, "# Created: %s\n", QDateTime::currentDateTime().toString().toUtf8().constData()); +- fprintf(out, "# by: The Resource Compiler for PyQt (Qt v%s)\n", QT_VERSION_STR); ++ fprintf(out, "# Created by: The Resource Compiler for PyQt (Qt v%s)\n", QT_VERSION_STR); + fprintf(out, "#\n"); + fprintf(out, "# WARNING! All changes made in this file will be lost!\n"); + fprintf(out, "\n"); +Index: pyqt5-5.3.2+dfsg/pyuic/uic/__init__.py +=================================================================== +--- pyqt5-5.3.2+dfsg.orig/pyuic/uic/__init__.py ++++ pyqt5-5.3.2+dfsg/pyuic/uic/__init__.py +@@ -47,8 +47,7 @@ _header = """# -*- coding: utf-8 -*- + + # Form implementation generated from reading ui file '%s' + # +-# Created: %s +-# by: PyQt5 UI code generator %s ++# Created by: PyQt5 UI code generator %s + # + # WARNING! All changes made in this file will be lost! + +@@ -149,7 +148,6 @@ def compileUi(uifile, pyfile, execute=Fa + module is foo_rc. + """ + +- from time import ctime + from PyQt5.QtCore import PYQT_VERSION_STR + + try: +@@ -159,7 +157,7 @@ def compileUi(uifile, pyfile, execute=Fa + + indenter.indentwidth = indent + +- pyfile.write(_header % (uifname, ctime(), PYQT_VERSION_STR)) ++ pyfile.write(_header % (uifname, PYQT_VERSION_STR)) + + winfo = compiler.UICompiler().compileUi(uifile, pyfile, from_imports, resource_suffix) + diff --git a/debian/patches/series b/debian/patches/series index 422cb22..7ca589c 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ +remove_timestamps.diff add_dependency.diff
signature.asc
Description: OpenPGP digital signature