summary refs log blame commit diff
path: root/pkgs/development/python-modules/magic/default.nix
blob: 45fd740e2e89dfee1e4a89a4a870f8e981110b50 (plain) (tree)
1
2
3
4
5
6
7
             



                    
                    
                        













                                                                                                                                                    
                    
                                                     
                                                



                             
{ 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 = "A Python wrapper around libmagic";
    homepage = "http://www.darwinsys.com/file/";
    license = licenses.lgpl2;
  };

}