Bug#1114950: g2o: please make the build reproducible

Chris Lamb lamby at debian.org
Fri Sep 12 00:31:42 BST 2025


Source: g2o
Version: 0~20230806-4.1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps buildpath
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

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

This is because the generated PDF contained the current date which
can be fixed by exporting FORCE_SOURCE_DATE. I've also included a
fix to ensure that the build is reproducible regardless of the build
path by ensuring the value G2O_SRC_DIR is not set to the current
build path.

Patch attached.

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


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
--- a/debian/rules	2025-09-10 16:04:08.957673230 -0700
--- b/debian/rules	2025-09-11 16:30:24.891847217 -0700
@@ -11,6 +11,8 @@
     MAKEFLAGS += -j$(NUMJOBS)
 endif
 
+export FORCE_SOURCE_DATE = 1
+
 %:
 	dh $@ --buildsystem=cmake
 
@@ -77,6 +79,7 @@
 override_dh_auto_install-arch:
 	dh_auto_install
 	rm debian/tmp/usr/include/g2o/autodiff/LICENSE
+	sed -i -e 's@^\(#define G2O_SRC_DIR\).*@\1 "/nonexistent"@' debian/tmp/usr/include/g2o/config.h
 
 override_dh_auto_install-indep:
 	true


More information about the debian-science-maintainers mailing list