]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
build: support `SOURCE_DATE_EPOCH` for build time-stamp master
authorJeremy Sowden <jeremy@azazel.net>
Wed, 28 Jan 2026 18:31:07 +0000 (18:31 +0000)
committerPhil Sutter <phil@nwl.cc>
Wed, 28 Jan 2026 19:00:49 +0000 (20:00 +0100)
In order to support reproducible builds, set the build time-stamp to the value
of the environment variable, `SOURCE_DATE_EPOCH`, if set, and fall back to
calling `date`, otherwise.

Link: https://reproducible-builds.org/docs/source-date-epoch/
Fixes: 64c07e38f049 ("table: Embed creating nft version into userdata")
Reported-by: Arnout Engelen <arnout@bzzt.net>
Closes: https://github.com/NixOS/nixpkgs/issues/478048
Suggested-by: Philipp Bartsch <phil@grmr.de>
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Phil Sutter <phil@nwl.cc>
configure.ac

index 9859072e9ae5c7bbe6490ab957e2502792ca5649..022608627908a4f16e84d0998487a3d637469562 100644 (file)
@@ -149,7 +149,7 @@ AC_ARG_WITH([stable-release], [AS_HELP_STRING([--with-stable-release],
             [], [with_stable_release=0])
 AC_SUBST([STABLE_RELEASE],[$with_stable_release])
 AC_SUBST([NFT_VERSION], [$(echo "${VERSION}" | tr '.' ',')])
-AC_SUBST([BUILD_STAMP], [$(date +%s)])
+AC_SUBST([BUILD_STAMP], [${SOURCE_DATE_EPOCH:-$(date +%s)}])
 
 AC_ARG_ENABLE([distcheck],
              AS_HELP_STRING([--enable-distcheck], [Build for distcheck]),