arandr: make reproducible by setting mtime=0

This commit is contained in:
TessyJames28 2025-04-01 18:09:35 +00:00
parent b7ba7f9f45
commit 0059372ab2
2 changed files with 25 additions and 3 deletions

View File

@ -0,0 +1,15 @@
--- setup.py 2025-04-01 11:24:54.530984662 +0000
+++ setup.py 2025-04-01 13:54:46.961341548 +0000
@@ -111,9 +111,11 @@
info('compressing man page to %s', gzfile)
if not self.dry_run:
- compressed = gzip.open(gzfile, 'w', 9)
- compressed.write(manpage)
- compressed.close()
+ with open(gzfile, 'wb') as file:
+ with gzip.GzipFile(fileobj=file, mode='wb', filename='', mtime=0, compresslevel=9) as compressed:
+ compressed.write(manpage)
+ compressed.close()
+ file.close()

View File

@ -1,6 +1,7 @@
{
lib,
fetchurl,
fetchFromGitLab,
python3Packages,
gobject-introspection,
gsettings-desktop-schemas,
@ -16,11 +17,17 @@ buildPythonApplication rec {
pname = "arandr";
version = "0.1.11";
src = fetchurl {
url = "https://christian.amsuess.com/tools/arandr/files/${pname}-${version}.tar.gz";
hash = "sha256-5Mu+Npi7gSs5V3CHAXS+AJS7rrOREFqBH5X0LrGCrgI=";
src = fetchFromGitLab {
owner = "arandr";
repo = "arandr";
tag = version;
hash = "sha256-nQtfOKAnWKsy2DmvtRGJa4+Y9uGgX41BeHpd9m4d9YA=";
};
# patch to set mtime=0 on setup.py
patches = [ ./gzip-timestamp-fix.patch ];
patchFlags = [ "-p0" ];
preBuild = ''
rm -rf data/po/*
'';