Merge pull request #99141 from lopsided98/protobuf-cross
pythonPackages.protobuf: fix cross-compilation
This commit is contained in:
commit
50277ebdd2
@ -1,11 +1,11 @@
|
|||||||
{ stdenv, fetchpatch, python, buildPythonPackage, isPy37
|
{ buildPackages, stdenv, fetchpatch, python, buildPythonPackage, isPy37
|
||||||
, protobuf, google_apputils, pyext, libcxx, isPy27
|
, protobuf, google_apputils, pyext, libcxx, isPy27
|
||||||
, disabled, doCheck ? true }:
|
, disabled, doCheck ? true }:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
|
|
||||||
buildPythonPackage {
|
buildPythonPackage {
|
||||||
inherit (protobuf) name src version;
|
inherit (protobuf) pname src version;
|
||||||
inherit disabled;
|
inherit disabled;
|
||||||
doCheck = doCheck && !isPy27; # setuptools>=41.4 no longer collects correctly on python2
|
doCheck = doCheck && !isPy27; # setuptools>=41.4 no longer collects correctly on python2
|
||||||
|
|
||||||
@ -15,8 +15,10 @@ buildPythonPackage {
|
|||||||
++ optional (versionOlder protobuf.version "2.7.0") "-std=c++98"
|
++ optional (versionOlder protobuf.version "2.7.0") "-std=c++98"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
outputs = [ "out" "dev" ];
|
||||||
|
|
||||||
propagatedBuildInputs = [ google_apputils ];
|
propagatedBuildInputs = [ google_apputils ];
|
||||||
propagatedNativeBuildInputs = [ protobuf ]; # For protoc.
|
propagatedNativeBuildInputs = [ buildPackages.protobuf ]; # For protoc.
|
||||||
nativeBuildInputs = [ google_apputils pyext ];
|
nativeBuildInputs = [ google_apputils pyext ];
|
||||||
buildInputs = [ protobuf ];
|
buildInputs = [ protobuf ];
|
||||||
|
|
||||||
@ -43,9 +45,9 @@ buildPythonPackage {
|
|||||||
|
|
||||||
preBuild = ''
|
preBuild = ''
|
||||||
# Workaround for https://github.com/google/protobuf/issues/2895
|
# Workaround for https://github.com/google/protobuf/issues/2895
|
||||||
${python.interpreter} setup.py build
|
${python.pythonForBuild.interpreter} setup.py build
|
||||||
'' + optionalString (versionAtLeast protobuf.version "2.6.0") ''
|
'' + optionalString (versionAtLeast protobuf.version "2.6.0") ''
|
||||||
${python.interpreter} setup.py build_ext --cpp_implementation
|
${python.pythonForBuild.interpreter} setup.py build_ext --cpp_implementation
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installFlags = optional (versionAtLeast protobuf.version "2.6.0")
|
installFlags = optional (versionAtLeast protobuf.version "2.6.0")
|
||||||
|
Loading…
Reference in New Issue
Block a user