Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, stdenv 3, buildPythonPackage 4, fetchFromGitHub 5, fetchpatch 6, substituteAll 7, file 8, pytestCheckHook 9}: 10 11buildPythonPackage rec { 12 pname = "python-magic"; 13 version = "0.4.27"; 14 15 src = fetchFromGitHub { 16 owner = "ahupp"; 17 repo = "python-magic"; 18 rev = version; 19 hash = "sha256-fZ+5xJ3P0EYK+6rQ8VzXv2zckKfEH5VUdISIR6ybIfQ="; 20 }; 21 22 patches = [ 23 (substituteAll { 24 src = ./libmagic-path.patch; 25 libmagic = "${file}/lib/libmagic${stdenv.hostPlatform.extensions.sharedLibrary}"; 26 }) 27 (fetchpatch { 28 name = "update-test-for-upstream-added-gzip-extensions.patch"; 29 url = "https://github.com/ahupp/python-magic/commit/4ffcd59113fa26d7c2e9d5897b1eef919fd4b457.patch"; 30 hash = "sha256-67GpjlGiR4/os/iZ69V+ZziVLpjmid+7t+gQ2aQy9I0="; 31 }) 32 ]; 33 34 preCheck = '' 35 export LC_ALL=en_US.UTF-8 36 ''; 37 38 nativeCheckInputs = [ 39 pytestCheckHook 40 ]; 41 42 meta = with lib; { 43 description = "A python interface to the libmagic file type identification library"; 44 homepage = "https://github.com/ahupp/python-magic"; 45 license = licenses.mit; 46 maintainers = with maintainers; [ SuperSandro2000 ]; 47 }; 48}