diff options
author | Chris Lamb <[email protected]> | 2020-02-15 09:32:59 +0000 |
---|---|---|
committer | Robert Antoni Buj Gelonch <[email protected]> | 2020-02-16 09:07:03 +0100 |
commit | 5abf684dc853caa629c92d2600c3c7f3d4264a66 (patch) | |
tree | 2bf2cb7971fa6a42b768a7059f7b117c8addb8af /mate-about | |
parent | 10c192c904f9889153e2788bef9b2520b3068864 (diff) | |
download | mate-desktop-5abf684dc853caa629c92d2600c3c7f3d4264a66.tar.bz2 mate-desktop-5abf684dc853caa629c92d2600c3c7f3d4264a66.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')
-rw-r--r-- | mate-about/meson.build | 9 |
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() |