Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
64 lines
1.5 KiB
Nix
64 lines
1.5 KiB
Nix
{
|
|
stdenv,
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchFromGitLab,
|
|
pytestCheckHook,
|
|
|
|
setuptools,
|
|
|
|
ghostscript_headless,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "ghostscript";
|
|
version = "0.7";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitLab {
|
|
owner = "pdftools";
|
|
repo = "python-ghostscript";
|
|
tag = "v${version}";
|
|
hash = "sha256-yBJuAnLK/4YDU9PBsSWPQay4pDws3bP+3rCplysq41w=";
|
|
};
|
|
|
|
postPatch =
|
|
let
|
|
extLib = stdenv.hostPlatform.extensions.sharedLibrary;
|
|
in
|
|
''
|
|
substituteInPlace ghostscript/__init__.py \
|
|
--replace-fail '__version__ = gs.__version__' '__version__ = "${version}"'
|
|
|
|
substituteInPlace ghostscript/_gsprint.py \
|
|
--replace-fail 'cdll.LoadLibrary("libgs.so")' 'cdll.LoadLibrary("${lib.getLib ghostscript_headless}/lib/libgs${extLib}")'
|
|
'';
|
|
|
|
build-system = [
|
|
setuptools
|
|
];
|
|
|
|
nativeCheckInputs = [
|
|
pytestCheckHook
|
|
];
|
|
|
|
disabledTests = [
|
|
# Some tests don't (fully) match anymore.
|
|
# Not sure if ghostscript ever promised to keep producing the same outputs, bit-by-bit…
|
|
"test_simple"
|
|
"test_unicode_arguments"
|
|
"test_run_string"
|
|
"test_stdin"
|
|
];
|
|
|
|
pythonImportsCheck = [ "ghostscript" ];
|
|
|
|
meta = {
|
|
description = "Interface to the Ghostscript C-API using ctypes";
|
|
homepage = "https://gitlab.com/pdftools/python-ghostscript";
|
|
changelog = "https://gitlab.com/pdftools/python-ghostscript/-/blob/v${version}/CHANGES.txt";
|
|
license = lib.licenses.gpl3Plus;
|
|
maintainers = with lib.maintainers; [ flokli ];
|
|
};
|
|
}
|