aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/mm-common-reproducible-tarball.patch
diff options
context:
space:
mode:
authorVagrant Cascadian <vagrant@reproducible-builds.org>2022-08-19 19:32:08 -0700
committerVagrant Cascadian <vagrant@debian.org>2022-08-30 17:39:26 -0700
commit5ce7178eb8375716625de14f59e227fdd9b8d9f0 (patch)
treeee379f67042a0dd6667a539cb787db62e930c92d /gnu/packages/patches/mm-common-reproducible-tarball.patch
parentc5d62ec323b1dfc66d42488efe4399d6af8473ac (diff)
downloadguix-5ce7178eb8375716625de14f59e227fdd9b8d9f0.tar.gz
guix-5ce7178eb8375716625de14f59e227fdd9b8d9f0.zip
gnu: mm-common: Build reproducibly.
* gnu/packages/patches/mm-common-reproducible-tarball.patch: New file. * gnu/local.mk (dist_patch_DATA): Add patch. * gnu/packages/gnome.scm (mm-common)[source]: Add patch.
Diffstat (limited to 'gnu/packages/patches/mm-common-reproducible-tarball.patch')
-rw-r--r--gnu/packages/patches/mm-common-reproducible-tarball.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/gnu/packages/patches/mm-common-reproducible-tarball.patch b/gnu/packages/patches/mm-common-reproducible-tarball.patch
new file mode 100644
index 0000000000..f0890aaf57
--- /dev/null
+++ b/gnu/packages/patches/mm-common-reproducible-tarball.patch
@@ -0,0 +1,40 @@
+From 024c121c844a4ec920133eb3f7e6b6ee8044c0b6 Mon Sep 17 00:00:00 2001
+From: Vagrant Cascadian <vagrant@reproducible-builds.org>
+Date: Sat, 12 Dec 2020 04:05:56 +0000
+Original-Patch: https://bugs.debian.org/977177
+Subject: [PATCH] Set uid, username, gid, and group name on files in
+ generated tarball.
+
+The user and group may otherwise vary between builds on different systems.
+
+---
+ util/meson_aux/skeletonmm-tarball.py | 16 +++++++++++++++-
+ 1 file changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/util/meson_aux/skeletonmm-tarball.py b/util/meson_aux/skeletonmm-tarball.py
+index db9e650..89049b6 100755
+--- a/util/meson_aux/skeletonmm-tarball.py
++++ b/util/meson_aux/skeletonmm-tarball.py
+@@ -39,10 +39,18 @@ elif output_file.endswith('.gz'):
+ else:
+ mode = 'w'
+
++def reproducible(tarinfo):
++ # Set consistent user and group on files in the tar archive
++ tarinfo.uid = 0
++ tarinfo.uname = 'root'
++ tarinfo.gid = 0
++ tarinfo.gname = 'root'
++ return tarinfo
++
+ with tarfile.open(output_file, mode=mode) as tar_file:
+ os.chdir(source_dir) # Input filenames are relative to source_dir.
+ for file in sys.argv[3:]:
+- tar_file.add(file)
++ tar_file.add(file, filter=reproducible)
+ # Errors raise exceptions. If an exception is raised, Meson+ninja will notice
+ # that the command failed, despite exit(0).
+ sys.exit(0)
+--
+2.29.2
+