tangled
alpha
login
or
join now
tjh.dev
/
nixpkgs
0
fork
atom
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
0
fork
atom
overview
issues
pulls
pipelines
python3Packages.protobuf: fix derivation version
oxalica
3 years ago
16b4c7f0
46cbaad4
+19
-5
1 changed file
expand all
collapse all
unified
split
pkgs
development
python-modules
protobuf
default.nix
+19
-5
pkgs/development/python-modules/protobuf/default.nix
reviewed
···
6
6
, isPyPy
7
7
}:
8
8
9
9
+
let
10
10
+
versionMajor = lib.versions.major protobuf.version;
11
11
+
versionMinor = lib.versions.minor protobuf.version;
12
12
+
versionPatch = lib.versions.patch protobuf.version;
13
13
+
in
9
14
buildPythonPackage {
10
10
-
inherit (protobuf) pname src version;
15
15
+
inherit (protobuf) pname src;
16
16
+
17
17
+
# protobuf 3.21 coresponds with its python library 4.21
18
18
+
version =
19
19
+
if lib.versionAtLeast protobuf.version "3.21"
20
20
+
then "${toString (lib.toInt versionMajor + 1)}.${versionMinor}.${versionPatch}"
21
21
+
else protobuf.version;
22
22
+
11
23
disabled = isPyPy;
12
24
25
25
+
sourceRoot = "source/python";
26
26
+
13
27
prePatch = ''
14
14
-
while [ ! -d python ]; do
15
15
-
cd *
16
16
-
done
17
17
-
cd python
28
28
+
if [[ "$(<../version.json)" != *'"python": "'"$version"'"'* ]]; then
29
29
+
echo "Python library version mismatch. Derivation version: $version, actual: $(<../version.json)"
30
30
+
exit 1
31
31
+
fi
18
32
'';
19
33
20
34
nativeBuildInputs = [ pyext ];