Skip to content

Commit

Permalink
Make package release dates reproducible
Browse files Browse the repository at this point in the history
Using `string(TIMESTAMP ...)` respects `SOURCE_DATE_EPOCH` since CMake 3.8, which makes it possible to fix the date used as release date in AppStream metadata and Fedora packaging.
  • Loading branch information
Philip Rinn authored and manisandro committed Feb 20, 2024
1 parent 4ab74d5 commit deabedb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ SET(INTERFACE_TYPE "qt5" CACHE STRING "Select interface type: qt5/qt6/gtk")
MESSAGE(STATUS "${INTERFACE_TYPE} interface will be built")
SET(MANUAL_DIR "share/doc/gimagereader" CACHE PATH "Path where manual will be installed")
SET(ENABLE_VERSIONCHECK 1 CACHE BOOL "Enable version check")
EXECUTE_PROCESS(COMMAND date +%a\ %b\ %d\ %Y OUTPUT_VARIABLE PACKAGE_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
EXECUTE_PROCESS(COMMAND date +%Y-%m-%d OUTPUT_VARIABLE PACKAGE_ISO_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
string(TIMESTAMP PACKAGE_DATE "%a\ %b\ %d\ %Y" UTC)
string(TIMESTAMP PACKAGE_ISO_DATE "%Y-%m-%d" UTC)
EXECUTE_PROCESS(COMMAND date -R OUTPUT_VARIABLE PACKAGE_RFC_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
EXECUTE_PROCESS(COMMAND git rev-parse HEAD OUTPUT_VARIABLE PACKAGE_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE)

Expand Down

0 comments on commit deabedb

Please sign in to comment.