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";