nixpkgs/pkgs/development/python-modules/pyvips/default.nix
Alexis Hildebrandt 755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00

68 lines
1.6 KiB
Nix

{
stdenv,
buildPythonPackage,
pythonOlder,
fetchFromGitHub,
pytestCheckHook,
glib,
vips,
cffi,
pkgconfig, # from pythonPackages
pkg-config, # from pkgs
lib,
}:
buildPythonPackage rec {
pname = "pyvips";
version = "2.2.1";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "libvips";
repo = "pyvips";
rev = "v${version}";
hash = "sha256-9S7h3bkm+QP78cpemYS7l3c8t+wXsJ5MUAP2T50R/Mc=";
};
nativeBuildInputs = [
pkgconfig
pkg-config
];
buildInputs = [
glib
vips
];
propagatedBuildInputs = [ cffi ];
env = lib.optionalAttrs stdenv.cc.isClang {
NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-function-pointer-types";
};
nativeCheckInputs = [ pytestCheckHook ];
postPatch = ''
substituteInPlace pyvips/__init__.py \
--replace 'libvips.so.42' '${lib.getLib vips}/lib/libvips${stdenv.hostPlatform.extensions.sharedLibrary}' \
--replace 'libvips.42.dylib' '${lib.getLib vips}/lib/libvips${stdenv.hostPlatform.extensions.sharedLibrary}' \
--replace 'libgobject-2.0.so.0' '${glib.out}/lib/libgobject-2.0${stdenv.hostPlatform.extensions.sharedLibrary}' \
--replace 'libgobject-2.0.dylib' '${glib.out}/lib/libgobject-2.0${stdenv.hostPlatform.extensions.sharedLibrary}' \
'';
pythonImportsCheck = [ "pyvips" ];
meta = with lib; {
description = "Python wrapper for libvips";
homepage = "https://github.com/libvips/pyvips";
changelog = "https://github.com/libvips/pyvips/blob/v${version}/CHANGELOG.rst";
license = licenses.mit;
maintainers = with maintainers; [
ccellado
anthonyroussel
];
};
}