protobuf: Fix python build

This commit is contained in:
William A. Kennington III 2015-02-20 10:36:16 -08:00
parent 263a49be20
commit f58c96149d
2 changed files with 32 additions and 4 deletions

View File

@ -31,4 +31,6 @@ stdenv.mkDerivation rec {
homepage = http://code.google.com/p/protobuf/; homepage = http://code.google.com/p/protobuf/;
}; };
passthru.version = version;
} }

View File

@ -7512,16 +7512,42 @@ let
}; };
}; };
protobuf = buildPythonPackage rec { protobuf = self.protobuf2_6;
inherit (pkgs.protobuf) name src; protobuf2_6 = self.protobufBuild pkgs.protobuf2_6;
protobuf2_5 = self.protobufBuild pkgs.protobuf2_5;
protobufBuild = protobuf: buildPythonPackage rec {
inherit (protobuf) name src;
propagatedBuildInputs = with self; [ pkgs.protobuf google_apputils ]; propagatedBuildInputs = with self; [ protobuf google_apputils ];
sourceRoot = "${name}-src/python";
prePatch = ''
while [ ! -d python ]; do
cd *
done
cd python
'';
preConfigure = optionalString (versionAtLeast protobuf.version "2.6.0") ''
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION=2
'';
checkPhase = if versionAtLeast protobuf.version "2.6.0" then ''
python setup.py google_test --cpp_implementation
'' else ''
python setup.py test
'';
installFlags = optional (versionAtLeast protobuf.version "2.6.0") "--cpp_implementation";
doCheck = true;
meta = { meta = {
description = "Protocol Buffers are Google's data interchange format"; description = "Protocol Buffers are Google's data interchange format";
homepage = http://code.google.com/p/protobuf/; homepage = http://code.google.com/p/protobuf/;
}; };
passthru.protobuf = protobuf;
}; };