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-05-18 14:49:53 +00:00
|
|
|
version = "2.2.0";
|
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-05-18 14:49:53 +00:00
|
|
|
sha256 = "sha256-qMVoVzqXALhPWVKLzu+VqihHPN7J+pMhKnXdb+ow0zw=";
|
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 ];
|
|
|
|
|
|
|
|
checkInputs = [ pytestCheckHook ];
|
|
|
|
|
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;
|
|
|
|
maintainers = with maintainers; [ ccellado ];
|
|
|
|
};
|
|
|
|
}
|