depot/third_party/nixpkgs/pkgs/development/python-modules/magic/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

29 lines
558 B
Nix

{
lib,
stdenv,
buildPythonPackage,
pkgs,
}:
buildPythonPackage {
name = pkgs.file.name;
src = pkgs.file.src;
patchPhase = ''
substituteInPlace python/magic.py --replace "find_library('magic')" "'${pkgs.file}/lib/libmagic${stdenv.hostPlatform.extensions.sharedLibrary}'"
'';
buildInputs = [ pkgs.file ];
preConfigure = "cd python";
# No test suite
doCheck = false;
meta = with lib; {
description = "Python wrapper around libmagic";
homepage = "http://www.darwinsys.com/file/";
license = licenses.lgpl2;
};
}