summaryrefslogtreecommitdiff
path: root/mate-about/meson.build
diff options
context:
space:
mode:
authorChris Lamb <[email protected]>2020-02-15 09:32:59 +0000
committerMartin Wimpress <[email protected]>2020-02-20 10:28:46 +0000
commit64ae7db88a9b22470d31d032a87fddd5fb4a2ab7 (patch)
treeaafed53321dc1a8cbcf02e6d6642817dd7d8997b /mate-about/meson.build
parent378db5b5244fc195a91993d50e4a5d1d86e430a9 (diff)
downloadmate-desktop-64ae7db88a9b22470d31d032a87fddd5fb4a2ab7.tar.bz2
mate-desktop-64ae7db88a9b22470d31d032a87fddd5fb4a2ab7.tar.xz
Make the build reproducible
Whilst working on the Reproducible Builds effort [0] we noticed that mate-desktop could not be built reproducibly. This is is because it generated a "release year" etc. based on the current build date which was embedded in the binary and possibly other files. A patch attached that uses SOURCE_DATE_EPOCH [1] instead. As a side-effect, this fixes the (accidental) reset of MATE_DATE in the Autotools build system in inherited from mate-desktop-environment.git. This was originally filed in Debian as #951357 [2]. [0] https://reproducible-builds.org/ [1] https://reproducible-builds.org/specs/source-date-epoch/ [2] https://bugs.debian.org/951357
Diffstat (limited to 'mate-about/meson.build')
-rw-r--r--mate-about/meson.build9
1 files changed, 7 insertions, 2 deletions
diff --git a/mate-about/meson.build b/mate-about/meson.build
index 3d25310..9f7a998 100644
--- a/mate-about/meson.build
+++ b/mate-about/meson.build
@@ -1,6 +1,11 @@
date_exe = find_program('date')
-mate_date = run_command(date_exe, '+%Y-%m-%d').stdout().strip()
-mate_year = run_command(date_exe, '+%Y').stdout().strip()
+cmd = run_command('sh', '-c', 'echo $SOURCE_DATE_EPOCH')
+source_date_epoch = cmd.stdout().strip()
+if source_date_epoch == ''
+ source_date_epoch = run_command(date_exe, '+%s').stdout().strip()
+endif
+mate_date = run_command(date_exe, '-u', '-d', '@' + source_date_epoch, '+%Y-%m-%d').stdout().strip()
+mate_year = run_command(date_exe, '-u', '-d', '@' + source_date_epoch, '+%Y').stdout().strip()
mate_data = configuration_data()