pkgs/development/python-modules: stdenv.lib -> lib
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
{ buildPackages
|
||||
, lib
|
||||
, stdenv
|
||||
, fetchpatch
|
||||
, python
|
||||
@@ -14,8 +15,6 @@
|
||||
, doCheck ? true
|
||||
}:
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
buildPythonPackage {
|
||||
inherit (protobuf) pname src version;
|
||||
inherit disabled;
|
||||
@@ -23,18 +22,18 @@ buildPythonPackage {
|
||||
|
||||
NIX_CFLAGS_COMPILE = toString (
|
||||
# work around python distutils compiling C++ with $CC
|
||||
optional stdenv.isDarwin "-I${libcxx}/include/c++/v1"
|
||||
++ optional (versionOlder protobuf.version "2.7.0") "-std=c++98"
|
||||
lib.optional stdenv.isDarwin "-I${libcxx}/include/c++/v1"
|
||||
++ lib.optional (lib.versionOlder protobuf.version "2.7.0") "-std=c++98"
|
||||
);
|
||||
|
||||
outputs = [ "out" "dev" ];
|
||||
|
||||
propagatedBuildInputs = [ six ] ++ optionals isPy27 [ google-apputils ];
|
||||
propagatedBuildInputs = [ six ] ++ lib.optionals isPy27 [ google-apputils ];
|
||||
propagatedNativeBuildInputs = [ buildPackages.protobuf ]; # For protoc.
|
||||
nativeBuildInputs = [ pyext ] ++ optionals isPy27 [ google-apputils ];
|
||||
nativeBuildInputs = [ pyext ] ++ lib.optionals isPy27 [ google-apputils ];
|
||||
buildInputs = [ protobuf ];
|
||||
|
||||
patches = optional (isPy37 && (versionOlder protobuf.version "3.6.1.2"))
|
||||
patches = lib.optional (isPy37 && (lib.versionOlder protobuf.version "3.6.1.2"))
|
||||
# Python 3.7 compatibility (not needed for protobuf >= 3.6.1.2)
|
||||
(fetchpatch {
|
||||
url = "https://github.com/protocolbuffers/protobuf/commit/0a59054c30e4f0ba10f10acfc1d7f3814c63e1a7.patch";
|
||||
@@ -50,7 +49,7 @@ buildPythonPackage {
|
||||
cd python
|
||||
'';
|
||||
|
||||
preConfigure = optionalString (versionAtLeast protobuf.version "2.6.0") ''
|
||||
preConfigure = lib.optionalString (lib.versionAtLeast protobuf.version "2.6.0") ''
|
||||
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp
|
||||
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION=2
|
||||
'';
|
||||
@@ -58,21 +57,21 @@ buildPythonPackage {
|
||||
preBuild = ''
|
||||
# Workaround for https://github.com/google/protobuf/issues/2895
|
||||
${python.pythonForBuild.interpreter} setup.py build
|
||||
'' + optionalString (versionAtLeast protobuf.version "2.6.0") ''
|
||||
'' + lib.optionalString (lib.versionAtLeast protobuf.version "2.6.0") ''
|
||||
${python.pythonForBuild.interpreter} setup.py build_ext --cpp_implementation
|
||||
'';
|
||||
|
||||
installFlags = optional (versionAtLeast protobuf.version "2.6.0")
|
||||
installFlags = lib.optional (lib.versionAtLeast protobuf.version "2.6.0")
|
||||
"--install-option='--cpp_implementation'";
|
||||
|
||||
# the _message.so isn't installed, so we'll do that manually.
|
||||
# if someone can figure out a less hacky way to get the _message.so to
|
||||
# install, please do replace this.
|
||||
postInstall = optionalString (versionAtLeast protobuf.version "2.6.0") ''
|
||||
postInstall = lib.optionalString (lib.versionAtLeast protobuf.version "2.6.0") ''
|
||||
cp -v $(find build -name "_message*") $out/${python.sitePackages}/google/protobuf/pyext
|
||||
'';
|
||||
|
||||
meta = {
|
||||
meta = with lib; {
|
||||
description = "Protocol Buffers are Google's data interchange format";
|
||||
homepage = "https://developers.google.com/protocol-buffers/";
|
||||
license = licenses.bsd3;
|
||||
|
||||
Reference in New Issue
Block a user