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