kikit: implement a workaround for non-deterministic fetchFromGitHub

See https://github.com/NixOS/nixpkgs/issues/84312 for details.
This commit is contained in:
Jeremy Fleischman 2025-04-06 10:59:33 -07:00
parent a5f347c409
commit 24d4c5322f
No known key found for this signature in database
2 changed files with 26 additions and 1 deletions

View File

@ -35,7 +35,13 @@ buildPythonApplication rec {
owner = "yaqwsx";
repo = "KiKit";
tag = "v${version}";
hash = "sha256-mwe/CajmQD5nDNYtQXRQm4vIJJiY7P5uFrvn8Ngjqc4=";
hash = "sha256-HSAQJJqJMVh44wgOQm+0gteShLogklBFuIzWtoVTf9I=";
# Upstream uses versioneer, which relies on gitattributes substitution.
# This leads to non-reproducible archives on GitHub.
# See https://github.com/NixOS/nixpkgs/issues/84312
postFetch = ''
rm "$out/kikit/_version.py"
'';
};
build-system = [
@ -75,6 +81,11 @@ buildPythonApplication rec {
"kikit"
];
postPatch = ''
# Recreate _version.py, deleted at fetch time due to non-reproducibility.
echo 'def get_versions(): return {"version": "${version}"}' > kikit/_version.py
'';
preCheck = ''
export PATH=$PATH:$out/bin

View File

@ -0,0 +1,14 @@
diff --git a/setup.py b/setup.py
index 9351fc9..75dfb2c 100644
--- a/setup.py
+++ b/setup.py
@@ -66,9 +66,6 @@
"solidpython>=1.1.2",
"commentjson>=0.9"
],
- setup_requires=[
- "versioneer"
- ],
extras_require={
"dev": ["pytest"],
},