12 buildPythonPackage rec {
13 pname = "python-magic";
15 format = "setuptools";
17 src = fetchFromGitHub {
19 repo = "python-magic";
21 hash = "sha256-fZ+5xJ3P0EYK+6rQ8VzXv2zckKfEH5VUdISIR6ybIfQ=";
26 src = ./libmagic-path.patch;
27 libmagic = "${file}/lib/libmagic${stdenv.hostPlatform.extensions.sharedLibrary}";
30 name = "update-test-for-upstream-added-gzip-extensions.patch";
31 url = "https://github.com/ahupp/python-magic/commit/4ffcd59113fa26d7c2e9d5897b1eef919fd4b457.patch";
32 hash = "sha256-67GpjlGiR4/os/iZ69V+ZziVLpjmid+7t+gQ2aQy9I0=";
35 # Upstream patch to amend test suite for-5.45:
36 # https://github.com/ahupp/python-magic/pull/290
38 name = "file-5.45.patch";
39 url = "https://github.com/ahupp/python-magic/commit/3d2405ca80cd39b2a91decd26af81dcf181390a4.patch";
40 hash = "sha256-HRsnO9MGfMD9BkJdC4SrEFQ1OZEaXpwakXFLoaCPK94=";
45 export LC_ALL=en_US.UTF-8
48 nativeCheckInputs = [ pytestCheckHook ];
51 description = "Python interface to the libmagic file type identification library";
52 homepage = "https://github.com/ahupp/python-magic";
53 license = licenses.mit;