Unverified Commit 196dd214 authored by Florian Klink's avatar Florian Klink Committed by GitHub
Browse files

python312Packages.ghostscript: init at 0.7 (#401502)

parents 069ba8e7 450f770c
Loading
Loading
Loading
Loading
+63 −0
Original line number Diff line number Diff line
{
  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 ];
  };
}
+2 −2
Original line number Diff line number Diff line
{
  lib,
  pkgs,
  buildPythonPackage,
  fetchFromGitea,
  fetchpatch,
@@ -10,7 +11,6 @@
  pillow,
  stdenv,
  exiftool,
  ghostscript,
  imagemagick,
  mupdf-headless,
  netpbm,
@@ -67,7 +67,7 @@ buildPythonPackage rec {

  nativeCheckInputs = [
    exiftool
    ghostscript
    pkgs.ghostscript
    imagemagick
    mupdf-headless
    netpbm
+2 −2
Original line number Diff line number Diff line
{
  lib,
  pkgs,
  buildPythonPackage,
  fetchFromGitHub,
  ghostscript,
  jupyterlab,
  nbexec,
  pandas,
@@ -42,7 +42,7 @@ buildPythonPackage rec {
  '';

  nativeCheckInputs = [
    ghostscript
    pkgs.ghostscript
    jupyterlab
    nbexec
    pandas
+2 −2
Original line number Diff line number Diff line
{
  pkgs,
  lib,
  buildPythonPackage,
  fetchPypi,
  flit-core,
  ghostscript,
  pillow,
  pytestCheckHook,
  pytest-cov-stub,
@@ -30,7 +30,7 @@ buildPythonPackage rec {
  nativeBuildInputs = [ flit-core ];

  nativeCheckInputs = [
    ghostscript
    pkgs.ghostscript
    pillow
    pytestCheckHook
    pytest-cov-stub
+4 −4
Original line number Diff line number Diff line
{
  stdenv,
  lib,
  pkgs,
  buildPythonPackage,
  cffi,
  cssselect2,
@@ -6,10 +9,8 @@
  flit-core,
  fontconfig,
  fonttools,
  ghostscript,
  glib,
  harfbuzz,
  lib,
  pango,
  pillow,
  pydyf,
@@ -18,7 +19,6 @@
  pytestCheckHook,
  pythonOlder,
  replaceVars,
  stdenv,
  tinycss2,
  tinyhtml5,
}:
@@ -61,7 +61,7 @@ buildPythonPackage rec {
  ] ++ fonttools.optional-dependencies.woff;

  nativeCheckInputs = [
    ghostscript
    pkgs.ghostscript
    pytest-cov-stub
    pytestCheckHook
  ];
Loading