Flavien Bridault pushed to branch master at Debian Med / sight


Commits:
09e8551e by Flavien Bridault at 2026-06-17T16:49:15+02:00
Attempt to get a reproducible build

- - - - -


2 changed files:

- + debian/patches/reproducible-glob-order.patch
- debian/patches/series


Changes:

=====================================
debian/patches/reproducible-glob-order.patch
=====================================
@@ -0,0 +1,53 @@
+Author: Flavien Bridault <[email protected]>
+Description: Make CMake glob expansion order deterministic for reproducible 
builds.
+Forwarded: not-needed
+diff --git i/cmake/build/macros.cmake w/cmake/build/macros.cmake
+index 1d1fc7296..7a0c032a0 100644
+--- i/cmake/build/macros.cmake
++++ w/cmake/build/macros.cmake
+@@ -87,6 +87,7 @@ endmacro()
+ # Create the target sources group
+ macro(group_maker SIGHT_TARGET)
+     file(GLOB_RECURSE PRJ_SOURCES "${${SIGHT_TARGET}_DIR}/*")
++    list(SORT PRJ_SOURCES)
+     foreach(SRC ${PRJ_SOURCES})
+         string(REGEX REPLACE ${${SIGHT_TARGET}_DIR} "" REL_DIR "${SRC}")
+         string(REGEX REPLACE "[\\\\/][^\\\\/]*$" "" REL_DIR "${REL_DIR}")
+@@ -96,6 +97,7 @@ macro(group_maker SIGHT_TARGET)
+     endforeach()
+ 
+     file(GLOB_RECURSE PRJ_BUILD_SOURCES "${${SIGHT_TARGET}_BUILD_DIR}/*.cpp" 
"${${SIGHT_TARGET}_BUILD_DIR}/*.hpp")
++    list(SORT PRJ_BUILD_SOURCES)
+     foreach(SRC ${PRJ_BUILD_SOURCES})
+         source_group("genFiles" FILES ${SRC})
+     endforeach()
+@@ -171,6 +173,8 @@ macro(init_project PRJ_NAME PRJ_TYPE)
+     file(GLOB_RECURSE SOURCES "${PRJ_SOURCE_DIR}/*.cpp" 
"${PRJ_SOURCE_DIR}/*.c" "${PRJ_SOURCE_DIR}/*.cxx"
+          "${PRJ_SOURCE_DIR}/*.cu"
+     )
++    list(SORT HEADERS)
++    list(SORT SOURCES)
+ 
+     if(NOT "${PRJ_TYPE}" STREQUAL "TEST" AND NOT "${PRJ_TYPE}" STREQUAL 
"DOCTEST" AND NOT "${PRJ_TYPE}" STREQUAL
+                                                                               
        "GUI_TEST"
+@@ -198,10 +202,12 @@ macro(init_project PRJ_NAME PRJ_TYPE)
+     file(GLOB_RECURSE ${SIGHT_TARGET}_RC_FILES "${PRJ_SOURCE_DIR}/rc/*" 
"${PRJ_SOURCE_DIR}/ut/rc/*"
+          "${PRJ_SOURCE_DIR}/tu/rc/*"
+     )
++    list(SORT ${SIGHT_TARGET}_RC_FILES)
+     set(${SIGHT_TARGET}_RC_FILES ${${SIGHT_TARGET}_RC_FILES} PARENT_SCOPE)
+     set_source_files_properties(${${SIGHT_TARGET}_RC_FILES} PROPERTIES 
HEADER_FILE_ONLY TRUE)
+ 
+     file(GLOB ${SIGHT_TARGET}_CMAKE_FILES "${PRJ_SOURCE_DIR}/*.txt" 
"${PRJ_SOURCE_DIR}/*.cmake")
++    list(SORT ${SIGHT_TARGET}_CMAKE_FILES)
+     set(${SIGHT_TARGET}_CMAKE_FILES ${${SIGHT_TARGET}_CMAKE_FILES} 
PARENT_SCOPE)
+     set_source_files_properties(${${SIGHT_TARGET}_CMAKE_FILES} PROPERTIES 
HEADER_FILE_ONLY TRUE)
+ 
+@@ -233,6 +239,7 @@ endmacro()
+ # Create a target for the resources
+ macro(create_resources_target TARGET TARGET_RC RES_DIR TARGET_RC_DIR)
+     file(GLOB_RECURSE RESOURCES_FILES "${RES_DIR}/*")
++    list(SORT RESOURCES_FILES)
+     set(CREATED_RESOURCES_LIST)
+     foreach(RESOURCE_FILE ${RESOURCES_FILES})
+         file(RELATIVE_PATH REL_PATH "${RES_DIR}" "${RESOURCE_FILE}")


=====================================
debian/patches/series
=====================================
@@ -5,3 +5,4 @@ lintian_warnings.patch
 remove-itk-fft.patch
 libxml.patch
 libboost1.90.patch
+reproducible-glob-order.patch



View it on GitLab: 
https://salsa.debian.org/med-team/sight/-/commit/09e8551ed54a069f506a69c5c9103b6c58790312

-- 
View it on GitLab: 
https://salsa.debian.org/med-team/sight/-/commit/09e8551ed54a069f506a69c5c9103b6c58790312
You're receiving this email because of your account on salsa.debian.org. Manage 
all notifications: https://salsa.debian.org/-/profile/notifications | Help: 
https://salsa.debian.org/help


_______________________________________________
debian-med-commit mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-commit

Reply via email to