Source: miro
Version: 6.0-1
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-bui...@lists.alioth.debian.org

Hi,

While working on the "reproducible builds" effort [1], we have noticed
that miro could not be built reproducibly.

The attached patch removes timestamps from the build system. Once
applied, miro can be built reproducibly in our current reproducible
toolchain.

 [1]: https://wiki.debian.org/ReproducibleBuilds


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
diff -urNad miro.orig/miro-6.0/debian/patches/180_reproducible_build 
miro/miro-6.0/debian/patches/180_reproducible_build
--- miro.orig/miro-6.0/debian/patches/180_reproducible_build    1970-01-01 
01:00:00.000000000 +0100
+++ miro/miro-6.0/debian/patches/180_reproducible_build 2015-02-12 
23:59:27.917458326 +0000
@@ -0,0 +1,37 @@
+--- miro-6.0.orig/linux/setup.py
++++ miro-6.0/linux/setup.py
+@@ -62,6 +62,7 @@ import platform
+ import pwd
+ import subprocess
+ import time
++import email.utils
+ import shutil
+ 
+ from Pyrex.Distutils import build_ext
+@@ -360,7 +361,7 @@ data_files += [
+ # of things that have file-related side-effects
+ if not "clean" in sys.argv:
+     # gzip the man page
+-    os.system("gzip -9 < %s > %s" % (
++    os.system("gzip -9n < %s > %s" % (
+             os.path.join(platform_dir, 'miro.1'),
+             os.path.join(platform_dir, 'miro.1.gz')))
+     # copy miro.1.gz to miro.real.1.gz so that lintian complains less
+@@ -403,13 +404,16 @@ class miro_install_data(install_data):
+         # We don't use the dist utils copy_file() because it only copies
+         # the file if the timestamp is newer
+         shutil.copyfile(source, dest)
++        changelog = subprocess.check_output(('dpkg-parsechangelog',
++                                             '--show-field', 'Date'))
++        buildtime = str(time.mktime(email.utils.parsedate(changelog)))
+         expand_file_contents(dest, APP_REVISION=revision,
+                              APP_REVISION_NUM=revisionnum,
+                              APP_REVISION_URL=revisionurl,
+                              APP_PLATFORM='linux',
+                              BUILD_MACHINE="%s@%s" % (getlogin(),
+                                                       os.uname()[1]),
+-                             BUILD_TIME=str(time.time()),
++                             BUILD_TIME=buildtime,
+                              MOZILLA_LIB_PATH="")
+         self.outfiles.append(dest)
+ 
diff -urNad miro.orig/miro-6.0/debian/patches/series 
miro/miro-6.0/debian/patches/series
--- miro.orig/miro-6.0/debian/patches/series    2015-02-12 22:30:21.383101937 
+0000
+++ miro/miro-6.0/debian/patches/series 2015-02-12 23:58:15.154246077 +0000
@@ -5,3 +5,4 @@
 150_codec_id.patch
 160_fixyoutubedl.patch
 170_no_enfmp.patch
+180_reproducible_build

Reply via email to