2020-04-24 23:36:52 +00:00
|
|
|
{ buildPythonPackage, lib, fetchPypi, file, stdenv }:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-magic";
|
2020-06-02 18:00:15 +00:00
|
|
|
version = "0.4.18";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-06-02 18:00:15 +00:00
|
|
|
sha256 = "b757db2a5289ea3f1ced9e60f072965243ea43a2221430048fd8cacab17be0ce";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|