forked from mirrors/nixpkgs
protobuf: Fix python build
This commit is contained in:
parent
263a49be20
commit
f58c96149d
|
@ -31,4 +31,6 @@ stdenv.mkDerivation rec {
|
|||
|
||||
homepage = http://code.google.com/p/protobuf/;
|
||||
};
|
||||
|
||||
passthru.version = version;
|
||||
}
|
||||
|
|
|
@ -7512,16 +7512,42 @@ let
|
|||
};
|
||||
};
|
||||
|
||||
protobuf = buildPythonPackage rec {
|
||||
inherit (pkgs.protobuf) name src;
|
||||
protobuf = self.protobuf2_6;
|
||||
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 ];
|
||||
sourceRoot = "${name}-src/python";
|
||||
propagatedBuildInputs = with self; [ protobuf google_apputils ];
|
||||
|
||||
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 = {
|
||||
description = "Protocol Buffers are Google's data interchange format";
|
||||
homepage = http://code.google.com/p/protobuf/;
|
||||
};
|
||||
|
||||
passthru.protobuf = protobuf;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue