Source: pan
Version: 0.159-1
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: uname
X-Debbugs-Cc: [email protected]

Hi,

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

This is because the /usr/bin/pan binary embedded the kernel version
name and version number:

│ │ │ ├── ./usr/bin/pan
[…]
│ │ │ │ ├── strings --all --bytes=8 {}
│ │ │ │ │ @@ -5307,15 +5307,15 @@
│ │ │ │ │  Heinrich M
│ │ │ │ │  ller <[email protected]> - Developer
│ │ │ │ │  Kenneth Haley <[email protected]> - Developer
│ │ │ │ │  Petr Kovar <[email protected]> - Contributor
│ │ │ │ │  Calin Culianu <[email protected]> - Threaded Decoding
│ │ │ │ │  Christophe Lambin <[email protected]> - Original Developer
│ │ │ │ │  Matt Eagleson <[email protected]> - Original Developer
│ │ │ │ │ -Vovchansk (; Linux-6.9.7+bpo-amd64)
│ │ │ │ │ +Vovchansk (; Linux-6.1.0-23-amd64)
│ │ │ │ │  Copyright 
│ │ │ │ │   2002-2021 Charles Kerr and others
│ │ │ │ │  GNU GENERAL PUBLIC LICENSE


A patch is attached that has the effect that, if SOURCE_DATE_EPOCH
exists, we assume that a reproducible build is intended and the
"Linux-6.1.0-23-amd64" string is replaced with "-" (hyphen).

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      [email protected] / chris-lamb.co.uk
       `-
--- a/debian/patches/reproducible-build 1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/reproducible-build 2024-08-07 13:54:54.710051195 +0100
@@ -0,0 +1,20 @@
+Description: Make the build reproducible
+Author: Chris Lamb <[email protected]>
+Last-Update: 2024-08-07
+
+--- pan-0.159.orig/CMakeLists.txt
++++ pan-0.159/CMakeLists.txt
+@@ -190,7 +190,12 @@ if(NOT COMPILED_LKSTRFTIME_TEST)
+   message(WARNING "failed to compile test-strftime.c")
+ endif()
+ 
+-set(PLATFORM_INFO ${CMAKE_HOST_SYSTEM})
++# Don't embed uname -sr in PLATFORM_INFO for a reproducible build.
++if (DEFINED ENV{SOURCE_DATE_EPOCH})
++  set(PLATFORM_INFO "-")
++else ()
++  set(PLATFORM_INFO ${CMAKE_HOST_SYSTEM})
++endif ()
+ message(STATUS "platform: ${PLATFORM_INFO}")
+ 
+ # https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html
--- a/debian/patches/series     2024-08-07 13:49:15.464412610 +0100
--- b/debian/patches/series     2024-08-07 13:54:53.838047062 +0100
@@ -1,2 +1,3 @@
 use-x-www-browser
 rm-windows-mac-entries
+reproducible-build

Reply via email to