9 , pkgconfig # from pythonPackages
10 , pkg-config # from pkgs
13 buildPythonPackage rec {
16 format = "setuptools";
18 disabled = pythonOlder "3.7";
20 src = fetchFromGitHub {
24 hash = "sha256-9S7h3bkm+QP78cpemYS7l3c8t+wXsJ5MUAP2T50R/Mc=";
27 nativeBuildInputs = [ pkgconfig pkg-config ];
29 buildInputs = [ glib vips ];
31 propagatedBuildInputs = [ cffi ];
33 env = lib.optionalAttrs stdenv.cc.isClang {
34 NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-function-pointer-types";
37 nativeCheckInputs = [ pytestCheckHook ];
40 substituteInPlace pyvips/__init__.py \
41 --replace 'libvips.so.42' '${lib.getLib vips}/lib/libvips${stdenv.hostPlatform.extensions.sharedLibrary}' \
42 --replace 'libvips.42.dylib' '${lib.getLib vips}/lib/libvips${stdenv.hostPlatform.extensions.sharedLibrary}' \
43 --replace 'libgobject-2.0.so.0' '${glib.out}/lib/libgobject-2.0${stdenv.hostPlatform.extensions.sharedLibrary}' \
44 --replace 'libgobject-2.0.dylib' '${glib.out}/lib/libgobject-2.0${stdenv.hostPlatform.extensions.sharedLibrary}' \
47 pythonImportsCheck = [ "pyvips" ];
50 description = "A python wrapper for libvips";
51 homepage = "https://github.com/libvips/pyvips";
52 changelog = "https://github.com/libvips/pyvips/blob/v${version}/CHANGELOG.rst";
53 license = licenses.mit;
54 maintainers = with maintainers; [ ccellado anthonyroussel ];