about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/nghttp2
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-04-27 21:04:56 +0000
committerAlyssa Ross <hi@alyssa.is>2020-04-27 21:04:56 +0000
commita4e6c7d26af697f4346cacb7ab18dcd7fcfc056e (patch)
tree47950e79183035018882419c4eff5047d1537b99 /nixpkgs/pkgs/development/libraries/nghttp2
parent5b00523fb58512232b819a301c4309f579c7f09c (diff)
parent22a3bf9fb9edad917fb6cd1066d58b5e426ee975 (diff)
downloadnixlib-a4e6c7d26af697f4346cacb7ab18dcd7fcfc056e.tar
nixlib-a4e6c7d26af697f4346cacb7ab18dcd7fcfc056e.tar.gz
nixlib-a4e6c7d26af697f4346cacb7ab18dcd7fcfc056e.tar.bz2
nixlib-a4e6c7d26af697f4346cacb7ab18dcd7fcfc056e.tar.lz
nixlib-a4e6c7d26af697f4346cacb7ab18dcd7fcfc056e.tar.xz
nixlib-a4e6c7d26af697f4346cacb7ab18dcd7fcfc056e.tar.zst
nixlib-a4e6c7d26af697f4346cacb7ab18dcd7fcfc056e.zip
Merge commit '22a3bf9fb9edad917fb6cd1066d58b5e426ee975'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/nghttp2')
-rw-r--r--nixpkgs/pkgs/development/libraries/nghttp2/default.nix30
1 files changed, 24 insertions, 6 deletions
diff --git a/nixpkgs/pkgs/development/libraries/nghttp2/default.nix b/nixpkgs/pkgs/development/libraries/nghttp2/default.nix
index 57ed58912751..939f137ac3e9 100644
--- a/nixpkgs/pkgs/development/libraries/nghttp2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nghttp2/default.nix
@@ -9,14 +9,16 @@
 , enableGetAssets ? false, libxml2 ? null
 , enableJemalloc ? false, jemalloc ? null
 , enableApp ? !stdenv.hostPlatform.isWindows
+, enablePython ? false, python ? null, cython ? null, ncurses ? null, setuptools ? null
 }:
 
 assert enableHpack -> jansson != null;
 assert enableAsioLib -> boost != null;
 assert enableGetAssets -> libxml2 != 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 {
   pname = "nghttp2";
@@ -27,7 +29,8 @@ stdenv.mkDerivation rec {
     sha256 = "0kyrgd4s2pq51ps5z385kw1hn62m8qp7c4h6im0g4ibrf89qwxc2";
   };
 
-  outputs = [ "bin" "out" "dev" "lib" ];
+  outputs = [ "bin" "out" "dev" "lib" ]
+    ++ optional enablePython "python";
 
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ openssl ]
@@ -37,21 +40,36 @@ stdenv.mkDerivation rec {
     ++ optional enableHpack jansson
     ++ optional enableAsioLib boost
     ++ optional enableGetAssets libxml2
-    ++ optional enableJemalloc jemalloc;
+    ++ optional enableJemalloc jemalloc
+    ++ optionals enablePython [ python ncurses setuptools ];
 
   enableParallelBuilding = true;
 
   configureFlags = [
     "--with-spdylay=no"
     "--disable-examples"
-    "--disable-python-bindings"
     (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
 
   meta = with stdenv.lib; {
-    homepage = https://nghttp2.org/;
+    homepage = "https://nghttp2.org/";
     description = "A C implementation of HTTP/2";
     license = licenses.mit;
     platforms = platforms.all;