Merge pull request #83795 from risicle/ris-nghttp2-python

nghttp2: add python bindings as pythonPackages.nghttp2
This commit is contained in:
Timo Kaufmann 2020-03-31 14:27:04 +00:00 committed by GitHub
commit aa304bb398
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 5 deletions

View file

@ -9,14 +9,16 @@
, enableGetAssets ? false, libxml2 ? null , enableGetAssets ? false, libxml2 ? null
, enableJemalloc ? false, jemalloc ? null , enableJemalloc ? false, jemalloc ? null
, enableApp ? !stdenv.hostPlatform.isWindows , enableApp ? !stdenv.hostPlatform.isWindows
, enablePython ? false, python ? null, cython ? null, ncurses ? null, setuptools ? null
}: }:
assert enableHpack -> jansson != null; assert enableHpack -> jansson != null;
assert enableAsioLib -> boost != null; assert enableAsioLib -> boost != null;
assert enableGetAssets -> libxml2 != null; assert enableGetAssets -> libxml2 != null;
assert enableJemalloc -> jemalloc != null; assert enableJemalloc -> jemalloc != null;
assert enablePython -> python != null && cython != null && ncurses != null && setuptools != null;
let inherit (stdenv.lib) optional; in let inherit (stdenv.lib) optional optionals optionalString; in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "nghttp2"; pname = "nghttp2";
@ -27,7 +29,8 @@ stdenv.mkDerivation rec {
sha256 = "0kyrgd4s2pq51ps5z385kw1hn62m8qp7c4h6im0g4ibrf89qwxc2"; sha256 = "0kyrgd4s2pq51ps5z385kw1hn62m8qp7c4h6im0g4ibrf89qwxc2";
}; };
outputs = [ "bin" "out" "dev" "lib" ]; outputs = [ "bin" "out" "dev" "lib" ]
++ optional enablePython "python";
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig ];
buildInputs = [ openssl ] buildInputs = [ openssl ]
@ -37,16 +40,31 @@ stdenv.mkDerivation rec {
++ optional enableHpack jansson ++ optional enableHpack jansson
++ optional enableAsioLib boost ++ optional enableAsioLib boost
++ optional enableGetAssets libxml2 ++ optional enableGetAssets libxml2
++ optional enableJemalloc jemalloc; ++ optional enableJemalloc jemalloc
++ optionals enablePython [ python ncurses setuptools ];
enableParallelBuilding = true; enableParallelBuilding = true;
configureFlags = [ configureFlags = [
"--with-spdylay=no" "--with-spdylay=no"
"--disable-examples" "--disable-examples"
"--disable-python-bindings"
(stdenv.lib.enableFeature enableApp "app") (stdenv.lib.enableFeature enableApp "app")
] ++ optional enableAsioLib "--enable-asio-lib --with-boost-libdir=${boost}/lib"; ] ++ optional enableAsioLib "--enable-asio-lib --with-boost-libdir=${boost}/lib"
++ (if enablePython then [
"--with-cython=${cython}/bin/cython"
] else [
"--disable-python-bindings"
]);
preInstall = optionalString enablePython ''
mkdir -p $out/${python.sitePackages}
# convince installer it's ok to install here
export PYTHONPATH="$PYTHONPATH:$out/${python.sitePackages}"
'';
postInstall = optionalString enablePython ''
mkdir -p $python/${python.sitePackages}
mv $out/${python.sitePackages}/* $python/${python.sitePackages}
'';
#doCheck = true; # requires CUnit ; currently failing at test_util_localtime_date in util_test.cc #doCheck = true; # requires CUnit ; currently failing at test_util_localtime_date in util_test.cc

View file

@ -4533,6 +4533,12 @@ in {
nevow = callPackage ../development/python-modules/nevow { }; nevow = callPackage ../development/python-modules/nevow { };
nghttp2 = (toPythonModule (pkgs.nghttp2.override {
inherit (self) python cython setuptools;
inherit (pkgs) ncurses;
enablePython = true;
})).python;
nibabel = callPackage ../development/python-modules/nibabel {}; nibabel = callPackage ../development/python-modules/nibabel {};
nidaqmx = callPackage ../development/python-modules/nidaqmx { }; nidaqmx = callPackage ../development/python-modules/nidaqmx { };