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
|
From 19839bbb88cb080ed6644cba7fd8b9ed01537c6a Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Thu, 17 Nov 2022 03:43:17 +0000
Subject: [PATCH] meson.build: Fix reproducible builds by using
SOURCE_DATE_EPOCH to set timestamp and set 'author' and 'hostname' to fixed
values.
https://reproducible-builds.org/docs/source-date-epoch/
---
meson.build | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/meson.build b/meson.build
index d6e6432..5caeb21 100644
--- a/meson.build
+++ b/meson.build
@@ -57,9 +57,9 @@ config = configuration_data({
'description': 'Semiempirical Extended Tight-Binding Program Package',
'version': meson.project_version(),
'commit': commit,
- 'date': run_command(python, '-c', 'import datetime; print(datetime.date.today().strftime("%Y-%m-%d"))').stdout().strip(),
- 'author': run_command(python, '-c', 'import getpass; print(getpass.getuser())').stdout().strip(),
- 'origin': run_command(python, '-c', 'import socket; print(socket.gethostname())').stdout().strip(),
+ 'date': run_command(python, '-c', 'import os; import time; import datetime; print(datetime.datetime.utcfromtimestamp(int(os.environ.get("SOURCE_DATE_EPOCH", time.time()))).strftime("%Y-%m-%d"))').stdout().strip(),
+ 'author': 'builduser',
+ 'origin': 'buildhost',
'prefix': get_option('prefix'),
'mandir': get_option('mandir'),
'bindir': get_option('bindir'),
--
2.30.2
|