[med-svn] [Git][med-team/mia][master] Make the build reproducible.

Yavor Doganov (@yavor-guest) gitlab at salsa.debian.org
Tue Oct 28 17:09:31 GMT 2025



Yavor Doganov pushed to branch master at Debian Med / mia


Commits:
be16c576 by Yavor Doganov at 2025-10-28T19:08:28+02:00
Make the build reproducible.

- - - - -


4 changed files:

- debian/changelog
- + debian/patches/reproducible-build.patch
- debian/patches/series
- debian/rules


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,14 @@
+mia (2.4.7-17) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * debian/patches/reproducible-build.patch: New; make the builds
+    reproducible.  Thanks Kaloian Doganov for the Python part.
+  * debian/rules (override_dh_auto_configure): Temporary add
+    -DCMAKE_BUILD_RPATH_USE_ORIGIN=ON to overcome a cmake deficiency wrt
+    reproducibility.
+
+ -- Yavor Doganov <yavor at gnu.org>  Tue, 28 Oct 2025 19:02:31 +0200
+
 mia (2.4.7-16) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/patches/reproducible-build.patch
=====================================
@@ -0,0 +1,141 @@
+Description: Fix reproducible builds.
+Author: Kaloian Doganov <kaloian at doganov.org>
+Author: Yavor Doganov <yavor at gnu.org>
+Forwarded: no
+Last-Update: 2025-10-28
+---
+
+--- mia.orig/doc/miareadxml.py
++++ mia/doc/miareadxml.py
+@@ -20,6 +20,7 @@
+ import string
+ from lxml import etree
+ import re
++import collections
+ 
+ 
+ xml_namespace = "http://docbook.org/ns/docbook"
+@@ -80,6 +81,11 @@
+     entry.append(tgroup)
+     return entry
+ 
++class ListSet(collections.UserList):
++    def add(self, elem):
++        if not (elem in self):
++            self.append(elem)
++
+ class CTextNode: 
+     def __init__(self, node, expect = None):
+         if not expect is None and node.tag != expect:
+@@ -90,7 +96,7 @@
+         self.is_output = False
+         self.no_nipype = False
+         self.entry = node.tag
+-        self.flags = set()
++        self.flags = ListSet()
+         self.text  = ""
+ 
+         if node.text is not None:
+@@ -378,7 +384,7 @@
+         self.text = node.text
+         self.required = False
+         self.no_nipype = False 
+-        self.flags = set()
++        self.flags = ListSet()
+ 
+         for child in node.iter("flags"):
+             f = child.text.split()
+--- mia.orig/miaconfig.h.cmake
++++ mia/miaconfig.h.cmake
+@@ -7,7 +7,7 @@
+ 
+ #cmakedefine ENABLE_DEBUG_MESSAGES 1
+ 
+-#define SOURCE_ROOT "@SOURCE_ROOT@"
++#define SOURCE_ROOT "."
+ #define PLUGIN_SEARCH_PATH  "@PLUGIN_SEARCH_PATH@"
+ #define PLUGIN_INSTALL_PATH  "@PLUGIN_INSTALL_PATH@"
+ 
+--- mia.orig/mia/core/plugin_base.cc
++++ mia/mia/core/plugin_base.cc
+@@ -116,7 +116,6 @@
+ 
+ PrepareTestPluginPath::PrepareTestPluginPath()
+ {
+-       g_plugin_root = MIA_BUILD_ROOT "/plugintest/";
+ }
+ 
+ PrepareTestPluginPath::~PrepareTestPluginPath()
+--- mia.orig/mia/2d/CMakeLists.txt
++++ mia/mia/2d/CMakeLists.txt
+@@ -171,6 +171,8 @@
+   ADD_EXECUTABLE(test-2d-${file} test_${file}.cc)
+   TARGET_LINK_LIBRARIES(test-2d-${file} ${libs} ${BOOST_UNITTEST} )
+   ADD_TEST(2d-${file} test-2d-${file})
++  SET_TESTS_PROPERTIES(2d-${file}
++    PROPERTIES ENVIRONMENT "MIA_PLUGIN_TESTPATH=${PLUGIN_TEST_ROOT}")
+ ENDMACRO(TEST_2DMIA file)
+ 
+ IF(MIA_ENABLE_TESTING) 
+--- mia.orig/cmake/pluginmacro.cmake
++++ mia/cmake/pluginmacro.cmake
+@@ -92,6 +92,8 @@
+     ENDIF(NOT WIN32)
+     target_link_libraries(test-${plugname} ${libs} ${BOOST_UNITTEST} "${PLUGIN_TESTLIBS}")
+     add_test(${plugname} test-${plugname})
++    set_tests_properties(${plugname}
++      PROPERTIES ENVIRONMENT "MIA_PLUGIN_TESTPATH=${PLUGIN_TEST_ROOT}")
+   ENDIF()
+ ENDMACRO(CREATE_PLUGIN_TEST plugname file)
+ 
+@@ -214,6 +216,8 @@
+     target_link_libraries(test-${plugname} ${libs})
+     target_link_libraries(test-${plugname} ${BOOST_UNITTEST} "${PLUGIN_TESTLIBS}")
+     add_test(${plugname} test-${plugname})
++    set_tests_properties(${plugname}
++      PROPERTIES ENVIRONMENT "MIA_PLUGIN_TESTPATH=${PLUGIN_TEST_ROOT}")
+   endif()
+   INSTALL(TARGETS ${plugname} LIBRARY DESTINATION ${install_path})
+ ENDMACRO(PLUGIN_WITH_TEST_MULTISOURCE) 
+--- mia.orig/cmake/macros.cmake
++++ mia/cmake/macros.cmake
+@@ -172,6 +172,8 @@
+   IF(MIA_ENABLE_TESTING)
+     NEW_TEST_BASE(${name} "${libs}")
+     ADD_TEST(${name} ${EXENAME})
++    SET_TESTS_PROPERTIES(${name}
++      PROPERTIES ENVIRONMENT "MIA_PLUGIN_TESTPATH=${PLUGIN_TEST_ROOT}")
+   ENDIF()
+ ENDMACRO(NEW_TEST)
+ 
+--- mia.orig/mia/3d/CMakeLists.txt
++++ mia/mia/3d/CMakeLists.txt
+@@ -146,6 +146,8 @@
+   ADD_EXECUTABLE(test-3d-${name} test_${name}.cc)  
+   TARGET_LINK_LIBRARIES(test-3d-${name} mia3dtest ${BOOST_UNITTEST})
+   ADD_TEST(3d-${name} test-3d-${name})
++  SET_TESTS_PROPERTIES(3d-${name}
++    PROPERTIES ENVIRONMENT "MIA_PLUGIN_TESTPATH=${PLUGIN_TEST_ROOT}")
+   IF(WIN32)
+     SET_TARGET_PROPERTIES(test-3d-${name} PROPERTIES LINKER_FLAGS "/NODEFAULTLIB:MSVCRT")
+   ENDIF(WIN32)
+@@ -187,6 +189,8 @@
+   ADD_TEST(3d "${CMAKE_CURRENT_SOURCE_DIR}/test-3d.bat")
+ ELSE (WIN32)
+   ADD_TEST(3d test-3d)
++  SET_TESTS_PROPERTIES(3d
++    PROPERTIES ENVIRONMENT "MIA_PLUGIN_TESTPATH=${PLUGIN_TEST_ROOT}")
+ ENDIF(WIN32)
+ 
+ TEST_3D(affine_matrix affine_matrix)
+--- mia.orig/addons/vistaio/CMakeLists.txt
++++ mia/addons/vistaio/CMakeLists.txt
+@@ -68,6 +68,8 @@
+       ADD_TEST(vista "${CMAKE_CURRENT_SOURCE_DIR}/test-vista4mia.bat")
+     ELSE (WIN32)
+       ADD_TEST(vista test-vista4mia)
++      SET_TESTS_PROPERTIES(vista
++        PROPERTIES ENVIRONMENT "MIA_PLUGIN_TESTPATH=${PLUGIN_TEST_ROOT}")
+     ENDIF(WIN32)
+   
+   ENDIF( VISTAIO_FOUND )


=====================================
debian/patches/series
=====================================
@@ -8,3 +8,4 @@ fix-gsl-header-install.patch
 gcc-14.patch
 groff-warnings.patch
 spelling-errors.patch
+reproducible-build.patch


=====================================
debian/rules
=====================================
@@ -23,9 +23,13 @@ endif
 %:
 	dh $@
 
+# TODO: Remove -DCMAKE_BUILD_RPATH_USE_ORIGIN=ON when switching to
+# debhelper compat level 14; it's added automatically by debhelper's
+# cmake build system.
 override_dh_auto_configure:
 	dh_auto_configure -- \
 	-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
+	-DCMAKE_BUILD_RPATH_USE_ORIGIN=ON \
 	-DALWAYS_CREATE_DOC=$(BUILDDOC)  \
 	-DSTRICT_DEPENDECIES=ON \
 	-DMIA_CREATE_MANPAGES=ON \



View it on GitLab: https://salsa.debian.org/med-team/mia/-/commit/be16c576276ba89d06e004550d8cbb8cd9361cfc

-- 
View it on GitLab: https://salsa.debian.org/med-team/mia/-/commit/be16c576276ba89d06e004550d8cbb8cd9361cfc
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20251028/6a7059f7/attachment-0001.htm>


More information about the debian-med-commit mailing list