mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-18 19:03:28 +00:00
nghttp2: remove useless nulls and make python3 support build
This commit is contained in:
parent
abbb726a8a
commit
8e3e02b015
@ -6,15 +6,15 @@
|
|||||||
|
|
||||||
# Optional dependencies
|
# Optional dependencies
|
||||||
, enableApp ? with stdenv.hostPlatform; !isWindows && !isStatic
|
, enableApp ? with stdenv.hostPlatform; !isWindows && !isStatic
|
||||||
, c-ares ? null, libev ? null, openssl ? null, zlib ? null
|
, c-ares, libev, openssl, zlib
|
||||||
, enableAsioLib ? false, boost ? null
|
, enableAsioLib ? false, boost
|
||||||
, enableGetAssets ? false, libxml2 ? null
|
, enableGetAssets ? false, libxml2
|
||||||
, enableHpack ? false, jansson ? null
|
, enableHpack ? false, jansson
|
||||||
, enableJemalloc ? false, jemalloc ? null
|
, enableJemalloc ? false, jemalloc
|
||||||
, enablePython ? false, python ? null, cython ? null, ncurses ? null, setuptools ? null
|
, enablePython ? false, python3Packages, ncurses
|
||||||
|
|
||||||
# Unit tests ; we have to set TZDIR, which is a GNUism.
|
# Unit tests ; we have to set TZDIR, which is a GNUism.
|
||||||
, enableTests ? stdenv.hostPlatform.isGnu, cunit ? null, tzdata ? null
|
, enableTests ? stdenv.hostPlatform.isGnu, cunit, tzdata
|
||||||
|
|
||||||
# downstream dependencies, for testing
|
# downstream dependencies, for testing
|
||||||
, curl
|
, curl
|
||||||
@ -25,13 +25,9 @@
|
|||||||
# All mutable patches (generated by GitHub or cgit) that are needed here
|
# All mutable patches (generated by GitHub or cgit) that are needed here
|
||||||
# should be included directly in Nixpkgs as files.
|
# should be included directly in Nixpkgs as files.
|
||||||
|
|
||||||
assert enableApp -> c-ares != null && libev != null && openssl != null && zlib != null;
|
assert enableGetAssets -> enableApp;
|
||||||
assert enableAsioLib -> boost != null;
|
assert enableHpack -> enableApp;
|
||||||
assert enableGetAssets -> enableApp == true && libxml2 != null;
|
assert enableJemalloc -> enableApp;
|
||||||
assert enableHpack -> enableApp == true && jansson != null;
|
|
||||||
assert enableJemalloc -> enableApp == true && jemalloc != null;
|
|
||||||
assert enablePython -> python != null && cython != null && ncurses != null && setuptools != null;
|
|
||||||
assert enableTests -> cunit != null && tzdata != null;
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "nghttp2";
|
pname = "nghttp2";
|
||||||
@ -47,14 +43,14 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
nativeBuildInputs = [ pkg-config ]
|
nativeBuildInputs = [ pkg-config ]
|
||||||
++ lib.optionals (enableApp) [ installShellFiles ]
|
++ lib.optionals (enableApp) [ installShellFiles ]
|
||||||
++ lib.optionals (enablePython) [ cython ];
|
++ lib.optionals (enablePython) [ python3Packages.cython ];
|
||||||
|
|
||||||
buildInputs = lib.optionals enableApp [ c-ares libev openssl zlib ]
|
buildInputs = lib.optionals enableApp [ c-ares libev openssl zlib ]
|
||||||
++ lib.optionals (enableAsioLib) [ boost ]
|
++ lib.optionals (enableAsioLib) [ boost ]
|
||||||
++ lib.optionals (enableGetAssets) [ libxml2 ]
|
++ lib.optionals (enableGetAssets) [ libxml2 ]
|
||||||
++ lib.optionals (enableHpack) [ jansson ]
|
++ lib.optionals (enableHpack) [ jansson ]
|
||||||
++ lib.optionals (enableJemalloc) [ jemalloc ]
|
++ lib.optionals (enableJemalloc) [ jemalloc ]
|
||||||
++ lib.optionals (enablePython) [ python ncurses setuptools ];
|
++ lib.optionals (enablePython) [ python3Packages.python ncurses python3Packages.setuptools ];
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
@ -62,7 +58,7 @@ stdenv.mkDerivation rec {
|
|||||||
"--disable-examples"
|
"--disable-examples"
|
||||||
(lib.enableFeature enableApp "app")
|
(lib.enableFeature enableApp "app")
|
||||||
] ++ lib.optionals (enableAsioLib) [ "--enable-asio-lib" "--with-boost-libdir=${boost}/lib" ]
|
] ++ lib.optionals (enableAsioLib) [ "--enable-asio-lib" "--with-boost-libdir=${boost}/lib" ]
|
||||||
++ lib.optionals (enablePython) [ "--with-cython=${cython}/bin/cython" ];
|
++ lib.optionals (enablePython) [ "--with-cython=${python3Packages.cython}/bin/cython" ];
|
||||||
|
|
||||||
# Unit tests require CUnit and setting TZDIR environment variable
|
# Unit tests require CUnit and setting TZDIR environment variable
|
||||||
doCheck = enableTests;
|
doCheck = enableTests;
|
||||||
@ -72,13 +68,13 @@ stdenv.mkDerivation rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
preInstall = lib.optionalString (enablePython) ''
|
preInstall = lib.optionalString (enablePython) ''
|
||||||
mkdir -p $out/${python.sitePackages}
|
mkdir -p $out/${python3Packages.python.sitePackages}
|
||||||
# convince installer it's ok to install here
|
# convince installer it's ok to install here
|
||||||
export PYTHONPATH="$PYTHONPATH:$out/${python.sitePackages}"
|
export PYTHONPATH="$PYTHONPATH:$out/${python3Packages.python.sitePackages}"
|
||||||
'';
|
'';
|
||||||
postInstall = lib.optionalString (enablePython) ''
|
postInstall = lib.optionalString (enablePython) ''
|
||||||
mkdir -p $python/${python.sitePackages}
|
mkdir -p $python/${python3Packages.python.sitePackages}
|
||||||
mv $out/${python.sitePackages}/* $python/${python.sitePackages}
|
mv $out/${python3Packages.python.sitePackages}/* $python/${python3Packages.python.sitePackages}
|
||||||
rm -r $out/lib
|
rm -r $out/lib
|
||||||
'' + lib.optionalString (enableApp) ''
|
'' + lib.optionalString (enableApp) ''
|
||||||
installShellCompletion --bash doc/bash_completion/{h2load,nghttp,nghttpd,nghttpx}
|
installShellCompletion --bash doc/bash_completion/{h2load,nghttp,nghttpd,nghttpx}
|
||||||
|
@ -5645,7 +5645,7 @@ in {
|
|||||||
});
|
});
|
||||||
|
|
||||||
nghttp2 = (toPythonModule (pkgs.nghttp2.override {
|
nghttp2 = (toPythonModule (pkgs.nghttp2.override {
|
||||||
inherit (self) python cython setuptools;
|
python3Packages = self;
|
||||||
inherit (pkgs) ncurses;
|
inherit (pkgs) ncurses;
|
||||||
enableApp = false; # build only libnghttp2 ...
|
enableApp = false; # build only libnghttp2 ...
|
||||||
enablePython = true; # ... and its Python bindings
|
enablePython = true; # ... and its Python bindings
|
||||||
|
Loading…
Reference in New Issue
Block a user