Bug#886105: klystrack: please make the build reproducible with respect to timestamps

2018-03-22 Thread James Cowgill
Hi Gürkan,

On 02/01/18 10:30, Chris Lamb wrote:
> Source: klystrack
> Version: 0.20171212-1
> Severity: wishlist
> Tags: patch
> User: reproducible-bui...@lists.alioth.debian.org
> Usertags: timestamps
> X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org
> 
> Hi,
> 
> Whilst working on the Reproducible Builds effort [0], we noticed
> that klystrack could not be built reproducibly.
> 
> Patch attached, although the resource files are still not reproducible
> as they iterate over the filesystem in a non-determistic order. This
> will require a match to makebundle.c.

You marked this bug with the "help" tag. What help do you need?

James



signature.asc
Description: OpenPGP digital signature
___
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-multimedia-maintainers

Bug#886105: klystrack: please make the build reproducible with respect to timestamps

2018-01-02 Thread Chris Lamb
Source: klystrack
Version: 0.20171212-1
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed
that klystrack could not be built reproducibly.

Patch attached, although the resource files are still not reproducible
as they iterate over the filesystem in a non-determistic order. This
will require a match to makebundle.c.

 [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.0 
+0100
--- b/debian/patches/reproducible-build.patch   2018-01-02 10:18:43.133544155 
+
@@ -0,0 +1,58 @@
+Description: Make the build reproducible
+Author: Chris Lamb 
+Last-Update: 2018-01-02
+
+--- klystrack-0.20171212.orig/klystron/Makefile
 klystrack-0.20171212/klystron/Makefile
+@@ -28,6 +28,13 @@ lib_OBJ = $(patsubst %.c, objs.$(CFG)/li
+ CC = gcc -shared -std=gnu99 --no-strict-aliasing
+ CDEP = gcc -E -std=gnu99
+ 
++DATE_FMT = %Y%m%d
++ifdef SOURCE_DATE_EPOCH
++  KLYSTRON_REVISION ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" 
"+$(DATE_FMT)"  2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 
2>/dev/null || date -u "+$(DATE_FMT)")
++else
++  KLYSTRON_REVISION ?= $(shell date "+$(DATE_FMT)")
++endif
++
+ ifndef CFLAGS
+ CFLAGS = $(MACHINE) -ftree-vectorize
+ endif
+@@ -73,9 +80,7 @@ LDFLAGS =
+ build: Makefile
+   @echo '#ifndef KLYSTRON_VERSION_H' > ./src/version.h
+   @echo '#define KLYSTRON_VERSION_H' >> ./src/version.h
+-  @echo -n '#define KLYSTRON_REVISION "' >> ./src/version.h
+-  @date +"%Y%m%d" | tr -d '\n' >> ./src/version.h
+-  @echo '"' >> ./src/version.h
++  @echo '#define KLYSTRON_REVISION "$(KLYSTRON_REVISION)"' >> 
./src/version.h
+   @echo '#define KLYSTRON_VERSION_STRING "klystron " KLYSTRON_REVISION' 
>> ./src/version.h
+   @echo '#endif' >> ./src/version.h
+   make all CFG=$(CFG)
+--- klystrack-0.20171212.orig/klystrack/Makefile
 klystrack-0.20171212/klystrack/Makefile
+@@ -21,6 +21,13 @@ REV := cp -f
+ 
+ CFLAGS := $(MACHINE) -ftree-vectorize -std=gnu99 --no-strict-aliasing
+ 
++DATE_FMT = %Y%m%d
++ifdef SOURCE_DATE_EPOCH
++  REVISION ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)"  
2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || 
date -u "+$(DATE_FMT)")
++else
++  REVISION ?= $(shell date "+$(DATE_FMT)")
++endif
++
+ ifdef COMSPEC
+   TARGET := $(TARGET).exe
+   ARCHIVE := $(ARCHIVE).zip
+@@ -133,9 +140,7 @@ src/version.h: src/version
+   @echo '#ifndef VERSION_H' > ./src/version.h
+   @echo '#define VERSION_H' >> ./src/version.h
+   @echo '#include "version_number.h"' >> ./src/version.h
+-  @echo -n '#define REVISION "' >> ./src/version.h
+-  @date +"%Y%m%d" | tr -d '\n' >> ./src/version.h
+-  @echo '"' >> ./src/version.h
++  @echo '#define REVISION "$(REVISION)"' >> ./src/version.h
+   @echo '#define VERSION_STRING "klystrack " VERSION " " REVISION' >> 
./src/version.h
+   @echo '#endif' >> ./src/version.h
+   
--- a/debian/patches/series 1970-01-01 01:00:00.0 +0100
--- b/debian/patches/series 2018-01-02 09:50:15.745957164 +
@@ -0,0 +1 @@
+reproducible-build.patch
___
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-multimedia-maintainers