2022-05-18 14:49:53 +00:00
|
|
|
{ stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pytestCheckHook
|
|
|
|
, glib
|
|
|
|
, vips
|
|
|
|
, cffi
|
|
|
|
, pkgconfig # from pythonPackages
|
|
|
|
, pkg-config # from pkgs
|
|
|
|
, lib }:
|
2020-10-07 09:15:18 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyvips";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "2.2.1";
|
2020-10-07 09:15:18 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libvips";
|
|
|
|
repo = "pyvips";
|
|
|
|
rev = "v${version}";
|
2022-08-12 12:06:08 +00:00
|
|
|
sha256 = "sha256-9S7h3bkm+QP78cpemYS7l3c8t+wXsJ5MUAP2T50R/Mc=";
|
2020-10-07 09:15:18 +00:00
|
|
|
};
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
nativeBuildInputs = [ pkgconfig pkg-config ];
|
2020-10-07 09:15:18 +00:00
|
|
|
|
|
|
|
buildInputs = [ glib vips ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ cffi ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2020-10-07 09:15:18 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
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}' \
|
|
|
|
'';
|
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
pythonImportsCheck = [ "pyvips" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A python wrapper for libvips";
|
|
|
|
homepage = "https://github.com/libvips/pyvips";
|
|
|
|
license = licenses.mit;
|
2022-08-12 12:06:08 +00:00
|
|
|
maintainers = with maintainers; [ ccellado anthonyroussel ];
|
2020-10-07 09:15:18 +00:00
|
|
|
};
|
|
|
|
}
|