depot/third_party/nixpkgs/pkgs/development/python-modules/python-magic/default.nix
Default email 889482aab3 Project import generated by Copybara.
GitOrigin-RevId: f2537a505d45c31fe5d9c27ea9829b6f4c4e6ac5
2022-06-26 12:26:21 +02:00

42 lines
866 B
Nix

{ lib
, stdenv
, buildPythonPackage
, fetchFromGitHub
, substituteAll
, file
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "python-magic";
version = "0.4.27";
src = fetchFromGitHub {
owner = "ahupp";
repo = "python-magic";
rev = version;
sha256 = "sha256-fZ+5xJ3P0EYK+6rQ8VzXv2zckKfEH5VUdISIR6ybIfQ=";
};
patches = [
(substituteAll {
src = ./libmagic-path.patch;
libmagic = "${file}/lib/libmagic${stdenv.hostPlatform.extensions.sharedLibrary}";
})
];
preCheck = ''
export LC_ALL=en_US.UTF-8
'';
checkInputs = [
pytestCheckHook
];
meta = with lib; {
description = "A python interface to the libmagic file type identification library";
homepage = "https://github.com/ahupp/python-magic";
license = licenses.mit;
maintainers = with maintainers; [ SuperSandro2000 ];
};
}