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