summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/magic/default.nix
blob: 81c2e2b72e5686cce532dd0602e423ff382986df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
  lib,
  stdenv,
  buildPythonPackage,
  pkgs,
}:

buildPythonPackage {
  format = "setuptools";
  inherit (pkgs.file) pname version 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 = {
    description = "Python wrapper around libmagic";
    homepage = "http://www.darwinsys.com/file/";
    license = lib.licenses.lgpl2;
  };
}