From 5abf684dc853caa629c92d2600c3c7f3d4264a66 Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Sat, 15 Feb 2020 09:32:59 +0000 Subject: 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 --- mate-about/meson.build | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'mate-about') 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() -- cgit v1.2.1