nixpkgs/pkgs/development/python-modules/magic/default.nix
Ihar Hrachyshka 567e8dfd8e
treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

28 lines
569 B
Nix

{
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;
};
}