Skip to content

Commit cf82b0b

Browse files
hacklschorschbtlogy
authored andcommitted
Patch _version.py
Courtesy of the ZKAPAuthorizer nix expressions
1 parent af8e84f commit cf82b0b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

nix/tahoe-lafs.nix

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,24 @@ buildPythonPackage rec {
7070
};
7171
};
7272

73+
postPatch =
74+
let
75+
versionFileContents = version: ''
76+
# This _version.py is generated by tahoe-lafs.nix.
77+
# TODO: We can have more metadata after we switch to flakes.
78+
# Then the `self` input will have a `sourceInfo` attribute telling
79+
__pkgname__ = "tahoe-lafs"
80+
real_version = "${version}"
81+
full_version = "${version}"
82+
branch = ""
83+
verstr = "${version}"
84+
__version__ = verstr
85+
'';
86+
in
87+
''
88+
cp ${builtins.toFile "_version.py" (versionFileContents version)} src/allmydata/_version.py
89+
'';
90+
7391
meta = with lib; {
7492
homepage = "https://tahoe-lafs.org/";
7593
description = "secure, decentralized, fault-tolerant file store";

0 commit comments

Comments
 (0)