Source: seabios Version: 1.9.3-2 Severity: wishlist Tags: patch User: reproducible-bui...@lists.alioth.debian.org Usertags: timestamps hostname X-Debbugs-Cc: reproducible-bui...@lists.alioth.debian.org
Hi, Whilst working on the Reproducible Builds effort [0], we noticed that seabios could not be built reproducibly. Patch attached. [0] https://reproducible-builds.org/ Regards, -- ,''`. : :' : Chris Lamb `. `'` la...@debian.org / chris-lamb.co.uk `-
--- a/debian/patches/reproducible_build.patch 1970-01-01 01:00:00.000000000 +0100 --- b/debian/patches/reproducible_build.patch 2016-10-26 21:53:14.214327793 +0100 @@ -0,0 +1,29 @@ +Description: Make the build reproducible +Author: Chris Lamb <la...@debian.org> +Last-Update: 2016-10-26 + +--- seabios-1.9.3.orig/scripts/buildversion.py ++++ seabios-1.9.3/scripts/buildversion.py +@@ -4,7 +4,7 @@ + # Copyright (C) 2015 Kevin O'Connor <ke...@koconnor.net> + # + # This file may be distributed under the terms of the GNU GPLv3 license. +-import sys, os, subprocess, shlex, time, socket, optparse, logging, traceback ++import sys, os, subprocess, shlex, time, socket, optparse, logging, traceback, datetime + + VERSION_FORMAT = """ + /* DO NOT EDIT! This is an autogenerated file. See scripts/buildversion.py. */ +@@ -127,6 +127,13 @@ def main(): + if not cleanbuild: + btime = time.strftime("%Y%m%d_%H%M%S") + hostname = socket.gethostname() ++ try: ++ btime = datetime.datetime.utcfromtimestamp( ++ int(os.environ['SOURCE_DATE_EPOCH']), ++ ).strftime("%Y%m%d_%H%M%S") ++ hostname = 'generic' ++ except KeyError: ++ pass + ver = "%s-%s-%s" % (ver, btime, hostname) + write_version(outfile, ver + options.extra, toolstr) + --- a/debian/patches/series 2016-10-26 21:43:46.718654197 +0100 --- b/debian/patches/series 2016-10-26 21:52:27.932775431 +0100 @@ -1 +1,2 @@ build-add-fno-pie-to-the-gcc-flags-when-available.patch +reproducible_build.patch