1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
From 337d2242cfa3b168ce998f1d3747cc5e4c18ce65 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Fri, 20 Jan 2023 01:19:06 +0000
Subject: [PATCH 2/2] Pass BUILD_TIMESTAMP via CMakeLists.txt and use in
ectrans.in for the build timestamp.
The CMake TIMESTAMP function respects SOURCE_DATE_EPOCH when
specifying UTC timezone.
https://reproducible-builds.org/docs/timestamps/
---
src/programs/CMakeLists.txt | 1 +
src/programs/ectrans.in | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
Index: ectrans-1.5.0/src/programs/CMakeLists.txt
===================================================================
--- ectrans-1.5.0.orig/src/programs/CMakeLists.txt
+++ ectrans-1.5.0/src/programs/CMakeLists.txt
@@ -59,6 +59,7 @@ foreach( lang ${langs} )
set( EC_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} ${CMAKE_${lang}_FLAGS_${CMAKE_BUILD_TYPE_CAPS}}" )
endforeach()
+string(TIMESTAMP BUILD_TIMESTAMP "%Y%m%d%H%M%S" UTC)
configure_file( ectrans.in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/ectrans @ONLY )
file(COPY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/ectrans
Index: ectrans-1.5.0/src/programs/ectrans.in
===================================================================
--- ectrans-1.5.0.orig/src/programs/ectrans.in
+++ ectrans-1.5.0/src/programs/ectrans.in
@@ -41,7 +41,7 @@ info()
echo ""
echo "Build:"
echo " build type : @CMAKE_BUILD_TYPE@"
- echo " timestamp : @EC_BUILD_TIMESTAMP@"
+ echo " timestamp : @BUILD_TIMESTAMP@"
echo " op. system : @CMAKE_SYSTEM_NAME@ (@EC_OS_NAME@.@EC_OS_BITS@)"
echo " processor : @CMAKE_SYSTEM_PROCESSOR@"
echo " c compiler : @CMAKE_C_COMPILER_ID@ @CMAKE_C_COMPILER_VERSION@"
|