From 3c3bc83c392da1775eca14a665a9f9965e05a105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Balzarotti?= Date: Fri, 9 Feb 2018 13:16:04 +0100 Subject: [PATCH] python-magic: move to own file, 0.4.10 -> 0.4.13 move python_magic --- .../python-modules/python-magic/default.nix | 28 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 27 +----------------- 2 files changed, 29 insertions(+), 26 deletions(-) create mode 100644 pkgs/development/python-modules/python-magic/default.nix diff --git a/pkgs/development/python-modules/python-magic/default.nix b/pkgs/development/python-modules/python-magic/default.nix new file mode 100644 index 00000000000..56be2e3448a --- /dev/null +++ b/pkgs/development/python-modules/python-magic/default.nix @@ -0,0 +1,28 @@ +{ buildPythonPackage, lib, fetchPypi, file, stdenv }: + +buildPythonPackage rec { + pname = "python-magic"; + version = "0.4.13"; + + src = fetchPypi { + inherit pname version; + sha256 = "128j9y30zih6cyjyjnxhghnvpjm8vw40a1q7pgmrp035yvkaqkk0"; + }; + + postPatch = '' + substituteInPlace magic.py --replace "ctypes.util.find_library('magic')" "'${file}/lib/libmagic${stdenv.hostPlatform.extensions.sharedLibrary}'" + ''; + + doCheck = false; + + # TODO: tests are failing + #checkPhase = '' + # ${python}/bin/${python.executable} ./test.py + #''; + + meta = { + description = "A python interface to the libmagic file type identification library"; + homepage = https://github.com/ahupp/python-magic; + license = lib.licenses.mit; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3c3d3a7925b..2263fb29ecd 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9793,32 +9793,7 @@ in { py_scrypt = callPackage ../development/python-modules/py_scrypt/default.nix { }; - python_magic = buildPythonPackage rec { - name = "python-magic-0.4.10"; - - src = pkgs.fetchurl { - url = "mirror://pypi/p/python-magic/${name}.tar.gz"; - sha256 = "1hx2sjd4fdswswj3yydn2azxb59rjmi9b7jzh94lf1wnxijjizbr"; - }; - - propagatedBuildInputs = with self; [ pkgs.file ]; - - patchPhase = '' - substituteInPlace magic.py --replace "ctypes.util.find_library('magic')" "'${pkgs.file}/lib/libmagic${stdenv.hostPlatform.extensions.sharedLibrary}'" - ''; - - doCheck = false; - - # TODO: tests are failing - #checkPhase = '' - # ${python}/bin/${python.executable} ./test.py - #''; - - meta = { - description = "A python interface to the libmagic file type identification library"; - homepage = https://github.com/ahupp/python-magic; - }; - }; + python_magic = callPackage ../development/python-modules/python-magic { }; magic = buildPythonPackage rec { name = "${pkgs.file.name}";