From a8d1e5c4a5d1feb3d89db012e9e0267e3570a4fa Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Mon, 15 Oct 2018 17:13:23 -0400 Subject: [PATCH] pythonPackages.magic: refactor move to python-modules --- .../python-modules/magic/default.nix | 28 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 22 +-------------- 2 files changed, 29 insertions(+), 21 deletions(-) create mode 100644 pkgs/development/python-modules/magic/default.nix diff --git a/pkgs/development/python-modules/magic/default.nix b/pkgs/development/python-modules/magic/default.nix new file mode 100644 index 000000000000..41c932ed1117 --- /dev/null +++ b/pkgs/development/python-modules/magic/default.nix @@ -0,0 +1,28 @@ +{ stdenv +, buildPythonPackage +, pkgs +}: + +buildPythonPackage rec { + name = "${pkgs.file.name}"; + + src = pkgs.file.src; + + patchPhase = '' + substituteInPlace python/magic.py --replace "find_library('magic')" "'${pkgs.file}/lib/libmagic${stdenv.hostPlatform.extensions.sharedLibrary}'" + ''; + + buildInputs = [ pkgs.file ]; + + preConfigure = "cd python"; + + # No test suite + doCheck = false; + + meta = with stdenv.lib; { + description = "A Python wrapper around libmagic"; + homepage = http://www.darwinsys.com/file/; + license = licenses.lgpl2; + }; + +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c259ed984c55..85082f28490e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5771,27 +5771,7 @@ in { python_magic = callPackage ../development/python-modules/python-magic { }; - magic = buildPythonPackage rec { - name = "${pkgs.file.name}"; - - src = pkgs.file.src; - - patchPhase = '' - substituteInPlace python/magic.py --replace "find_library('magic')" "'${pkgs.file}/lib/libmagic${stdenv.hostPlatform.extensions.sharedLibrary}'" - ''; - - buildInputs = with self; [ pkgs.file ]; - - preConfigure = "cd python"; - - # No test suite - doCheck = false; - - meta = { - description = "A Python wrapper around libmagic"; - homepage = http://www.darwinsys.com/file/; - }; - }; + magic = callPackage ../development/python-modules/magic { }; m2crypto = buildPythonPackage rec { version = "0.24.0";