summaryrefslogtreecommitdiff
path: root/debian/patches/03-reproducible-build.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/03-reproducible-build.patch')
-rw-r--r--debian/patches/03-reproducible-build.patch17
1 files changed, 17 insertions, 0 deletions
diff --git a/debian/patches/03-reproducible-build.patch b/debian/patches/03-reproducible-build.patch
new file mode 100644
index 0000000..2800959
--- /dev/null
+++ b/debian/patches/03-reproducible-build.patch
@@ -0,0 +1,17 @@
+Index: libdigidoc-3.10.1.1208/cmake/modules/VersionInfo.cmake
+===================================================================
+--- libdigidoc-3.10.1.1208.orig/cmake/modules/VersionInfo.cmake
++++ libdigidoc-3.10.1.1208/cmake/modules/VersionInfo.cmake
+@@ -10,7 +10,11 @@ if( WIN32 )
+ execute_process( COMMAND "cmd.exe" "/C date /T" OUTPUT_VARIABLE BUILD_DATE )
+ string( REGEX REPLACE ".*([0-3][0-9]).([0-1][0-9]).([0-9][0-9][0-9][0-9]).*" "\\1.\\2.\\3" BUILD_DATE ${BUILD_DATE} )
+ elseif( UNIX )
+- execute_process( COMMAND "date" "+%d.%m.%Y" OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE )
++ if (DEFINED ENV{SOURCE_DATE_EPOCH})
++ execute_process( COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}" "+%d.%m.%Y" OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE )
++ else()
++ execute_process( COMMAND "date" "+%d.%m.%Y" OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE )
++ endif()
+ else()
+ message( SEND_ERROR "date not implemented")
+ set( BUILD_DATE "00.00.0000" )