lol

Merge pull request #194734 from SuperSandro2000/python310Packages.protobuf

authored by

Sandro and committed by
GitHub
fd3f8a2f 89465420

+16 -36
+16 -34
pkgs/development/python-modules/protobuf/default.nix
··· 1 1 { buildPackages 2 2 , lib 3 - , fetchpatch 4 - , python 5 3 , buildPythonPackage 6 - , isPy37 7 4 , protobuf 8 - , google-apputils ? null 9 - , six 10 5 , pyext 11 - , isPy27 12 - , disabled 13 - , doCheck ? true 6 + , isPyPy 14 7 }: 15 8 16 9 buildPythonPackage { 17 10 inherit (protobuf) pname src version; 18 - inherit disabled; 19 - doCheck = doCheck && !isPy27; # setuptools>=41.4 no longer collects correctly on python2 20 - 21 - propagatedBuildInputs = [ six ] ++ lib.optionals isPy27 [ google-apputils ]; 22 - propagatedNativeBuildInputs = let 23 - protobufVersion = "${lib.versions.major protobuf.version}_${lib.versions.minor protobuf.version}"; 24 - in [ 25 - buildPackages."protobuf${protobufVersion}" # For protoc of the same version. 26 - ]; 27 - 28 - nativeBuildInputs = [ pyext ] ++ lib.optionals isPy27 [ google-apputils ]; 29 - buildInputs = [ protobuf ]; 30 - 31 - patches = lib.optional (isPy37 && (lib.versionOlder protobuf.version "3.6.1.2")) 32 - # Python 3.7 compatibility (not needed for protobuf >= 3.6.1.2) 33 - (fetchpatch { 34 - url = "https://github.com/protocolbuffers/protobuf/commit/0a59054c30e4f0ba10f10acfc1d7f3814c63e1a7.patch"; 35 - sha256 = "09hw22y3423v8bbmc9xm07znwdxfbya6rp78d4zqw6fisdvjkqf1"; 36 - stripLen = 1; 37 - }) 38 - ; 11 + disabled = isPyPy; 39 12 40 13 prePatch = '' 41 14 while [ ! -d python ]; do ··· 44 17 cd python 45 18 ''; 46 19 47 - setupPyGlobalFlags = lib.optional (lib.versionAtLeast protobuf.version "2.6.0") 48 - "--cpp_implementation"; 20 + nativeBuildInputs = [ pyext ]; 21 + 22 + buildInputs = [ protobuf ]; 23 + 24 + propagatedNativeBuildInputs = [ 25 + # For protoc of the same version. 26 + buildPackages."protobuf${lib.versions.major protobuf.version}_${lib.versions.minor protobuf.version}" 27 + ]; 28 + 29 + setupPyGlobalFlags = "--cpp_implementation"; 49 30 50 31 pythonImportsCheck = [ 51 32 "google.protobuf" 52 - ] ++ lib.optionals (lib.versionAtLeast protobuf.version "2.6.0") [ 53 33 "google.protobuf.internal._api_implementation" # Verify that --cpp_implementation worked 54 34 ]; 55 35 36 + passthru = { 37 + inherit protobuf; 38 + }; 39 + 56 40 meta = with lib; { 57 41 description = "Protocol Buffers are Google's data interchange format"; 58 42 homepage = "https://developers.google.com/protocol-buffers/"; 59 43 license = licenses.bsd3; 60 44 maintainers = with maintainers; [ knedlsepp ]; 61 45 }; 62 - 63 - passthru.protobuf = protobuf; 64 46 }
-2
pkgs/top-level/python-packages.nix
··· 7382 7382 proto-plus = callPackage ../development/python-modules/proto-plus { }; 7383 7383 7384 7384 protobuf = callPackage ../development/python-modules/protobuf { 7385 - disabled = isPyPy; 7386 7385 # If a protobuf upgrade causes many Python packages to fail, please pin it here to the previous version. 7387 - doCheck = !isPy3k; 7388 7386 inherit (pkgs) protobuf; 7389 7387 }; 7390 7388