Source: readsb
Version: 3.14.1630-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
readsb could not be built reproducibly.

This is because it embeds a "compiled on" timestamp into the binary.

A patch is attached that seeds this timestamp from SOURCE_DATE_EPOCH [0]
if available.

 [0] https://reproducible-builds.org/
 [1] https://reproducible-builds.org/docs/source-date-epoch/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
--- a/debian/patches/reproducible-build.patch   1969-12-31 16:00:00.000000000 
-0800
--- b/debian/patches/reproducible-build.patch   2024-10-17 09:21:07.003630825 
-0700
@@ -0,0 +1,19 @@
+Description: Make the build reproducible
+Author: Chris Lamb <la...@debian.org>
+Last-Update: 2024-10-17
+
+--- readsb-3.14.1630.orig/Makefile
++++ readsb-3.14.1630/Makefile
+@@ -1,5 +1,11 @@
+ PROGNAME=readsb
+-READSB_VERSION := "$(shell echo -n `cat version`; { git show -s 
--format=format: && echo -n ' wiedehopf git: ' && git describe --abbrev --dirty 
--always && git show -s --format=format:"(committed: %cd)" | tr -cd 
'[a-z],[A-Z],[0-9],:, ,\-,_,(,)';} || echo -n ' compiled on '`date +%y%m%d` )"
++DATE_FMT = +%y%m%d
++ifdef SOURCE_DATE_EPOCH
++    BUILD_DATE ?= $(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
++    BUILD_DATE ?= $(shell date "$(DATE_FMT)")
++endif
++READSB_VERSION := "$(shell echo -n `cat version`; { git show -s 
--format=format: && echo -n ' wiedehopf git: ' && git describe --abbrev --dirty 
--always && git show -s --format=format:"(committed: %cd)" | tr -cd 
'[a-z],[A-Z],[0-9],:, ,\-,_,(,)';} || echo -n ' compiled on '$(BUILD_DATE) )"
+ 
+ RTLSDR ?= no
+ BLADERF ?= no
--- a/debian/patches/series     1969-12-31 16:00:00.000000000 -0800
--- b/debian/patches/series     2024-10-17 09:21:06.091649089 -0700
@@ -0,0 +1 @@
+reproducible-build.patch

Reply via email to