From 8b5fd510641778c8769b25110bef4a6945c2d4ec Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 9 Dec 2017 10:10:05 +0100 Subject: [PATCH] python.pkgs.libvirt: move to separate file --- .../development/libraries/libvirt/default.nix | 2 +- .../python-modules/libvirt/default.nix | 26 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 25 ++---------------- 3 files changed, 29 insertions(+), 24 deletions(-) create mode 100644 pkgs/development/python-modules/libvirt/default.nix diff --git a/pkgs/development/libraries/libvirt/default.nix b/pkgs/development/libraries/libvirt/default.nix index 00dfc23908c8..f2710435c00c 100644 --- a/pkgs/development/libraries/libvirt/default.nix +++ b/pkgs/development/libraries/libvirt/default.nix @@ -9,7 +9,7 @@ with stdenv.lib; -# if you update, also bump pythonPackages.libvirt or it will break +# if you update, also bump or it will break stdenv.mkDerivation rec { name = "libvirt-${version}"; version = "3.10.0"; diff --git a/pkgs/development/python-modules/libvirt/default.nix b/pkgs/development/python-modules/libvirt/default.nix new file mode 100644 index 000000000000..5dc33d2d93e1 --- /dev/null +++ b/pkgs/development/python-modules/libvirt/default.nix @@ -0,0 +1,26 @@ +{ stdenv, buildPythonPackage, fetchurl, python, pkgconfig, lxml, libvirt, nose }: + +buildPythonPackage rec { + pname = "libvirt"; + version = "3.10.0"; + + src = assert version == libvirt.version; fetchurl { + url = "http://libvirt.org/sources/python/${pname}-python-${version}.tar.gz"; + sha256 = "1l0fgqjnx76pzkhq540x9sf5fgzlrn0dpay90j2m4iq8nkclcbpw"; + }; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ libvirt lxml ]; + + checkInputs = [ nose ]; + checkPhase = '' + nosetests + ''; + + meta = with stdenv.lib; { + homepage = http://www.libvirt.org/; + description = "libvirt Python bindings"; + license = licenses.lgpl2; + maintainers = [ maintainers.fpletz ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a2bb7b5f8e9a..48bcd849fa1f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -21942,29 +21942,8 @@ EOF }; }; - libvirt = let - version = "3.10.0"; - in assert version == pkgs.libvirt.version; pkgs.stdenv.mkDerivation rec { - name = "libvirt-python-${version}"; - - src = pkgs.fetchurl { - url = "http://libvirt.org/sources/python/${name}.tar.gz"; - sha256 = "1l0fgqjnx76pzkhq540x9sf5fgzlrn0dpay90j2m4iq8nkclcbpw"; - }; - - nativeBuildInputs = [ pkgs.pkgconfig ]; - buildInputs = with self; [ python pkgs.libvirt lxml ]; - - buildPhase = "${python.interpreter} setup.py build"; - - installPhase = "${python.interpreter} setup.py install --prefix=$out"; - - meta = { - homepage = http://www.libvirt.org/; - description = "libvirt Python bindings"; - license = licenses.lgpl2; - maintainers = [ maintainers.fpletz ]; - }; + libvirt = callPackage ../development/python-modules/libvirt { + inherit (pkgs) libvirt; }; rpdb = buildPythonPackage rec {