diff --git a/pkgs/development/libraries/libxml2/default.nix b/pkgs/development/libraries/libxml2/default.nix index 1907a470b68d..fe3b6bd6487e 100644 --- a/pkgs/development/libraries/libxml2/default.nix +++ b/pkgs/development/libraries/libxml2/default.nix @@ -1,4 +1,6 @@ -{ stdenv, fetchurl, libiconvOrLibc, zlib }: +{stdenv, fetchurl, zlib, python ? null, pythonSupport ? true }: + +assert pythonSupport -> python != null; stdenv.mkDerivation { name = "libxml2-2.7.7"; @@ -8,11 +10,15 @@ stdenv.mkDerivation { sha256 = "03kkknm7xl77qfdig8mzalsi8ljsyblzin18gy3h8zranffrpyzs"; }; - propagatedBuildInputs = [ libiconvOrLibc zlib ]; + configureFlags = '' + ${if pythonSupport then "--with-python=${python}" else ""} + ''; + + propagatedBuildInputs = [zlib]; setupHook = ./setup-hook.sh; - passthru = { libiconv = libiconvOrLibc; }; + passthru = {inherit pythonSupport;}; meta = { homepage = http://xmlsoft.org/; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 685372487102..30f2532abdd3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4234,9 +4234,13 @@ let libxmi = callPackage ../development/libraries/libxmi { }; - libxml2 = callPackage ../development/libraries/libxml2 { }; + libxml2 = callPackage ../development/libraries/libxml2 { + pythonSupport = false; + }; - libxml2Python = pythonPackages.libxml2; + libxml2Python = libxml2.override { + pythonSupport = true; + }; libxmlxx = callPackage ../development/libraries/libxmlxx { inherit (gtkLibs) glibmm; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 49e3901aa7be..b8d26e94a9a2 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -665,35 +665,6 @@ let pythonPackages = python.modules // rec { }); - libxml2 = buildPythonPackage (rec { - name = pkgs.libxml2.name; - src = pkgs.libxml2.src; - - buildInputs = [ python ]; - propagatedBuildInputs = [ pkgs.libxml2 ]; - - configureFlags = "--with-python=${python}"; - - postConfigure = '' - cd python - sed -i setup.py \ - -e "s:^ROOT.*:ROOT = r'${pkgs.libxml2}':" \ - -e "s:^iconv_includes.*:iconv_includes= r'${pkgs.libxml2.libiconv}':" - ''; - - # has no tests - doCheck = false; - - passthru = { lib = pkgs.libxml2; }; - - meta = { - homepage = http://xmlsoft.org/; - description = "Python bindings for libxml2"; - license = "bsd"; - }; - }); - - lockfile = buildPythonPackage rec { name = "lockfile-0.9.1";