1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 pkgs,
6}:
7
8buildPythonPackage {
9 format = "setuptools";
10 inherit (pkgs.file) pname version src;
11
12 patchPhase = ''
13 substituteInPlace python/magic.py --replace "find_library('magic')" "'${pkgs.file}/lib/libmagic${stdenv.hostPlatform.extensions.sharedLibrary}'"
14 '';
15
16 buildInputs = [ pkgs.file ];
17
18 preConfigure = "cd python";
19
20 # No test suite
21 doCheck = false;
22
23 meta = with lib; {
24 description = "Python wrapper around libmagic";
25 homepage = "http://www.darwinsys.com/file/";
26 license = licenses.lgpl2;
27 };
28}