Commit bd383ac0 authored by Gaetan Lepage's avatar Gaetan Lepage
Browse files

python312Packages.weasyprint: cleanup

parent 17726ac9
Loading
Loading
Loading
Loading
+21 −20
Original line number Diff line number Diff line
{
  stdenv,
  lib,
  stdenv,
  pkgs,
  buildPythonPackage,
  cffi,
  cssselect2,
  fetchPypi,
  flit-core,
  fetchFromGitHub,
  fontconfig,
  fonttools,
  glib,
  harfbuzz,
  pango,

  # build-system
  flit-core,

  # dependencies
  cffi,
  cssselect2,
  fonttools,
  pillow,
  pydyf,
  pyphen,
  tinycss2,
  tinyhtml5,

  # tests
  pytest-cov-stub,
  pytestCheckHook,
  pythonOlder,
  replaceVars,
  tinycss2,
  tinyhtml5,
  writableTmpDirAsHomeHook,
}:

buildPythonPackage rec {
@@ -28,12 +34,11 @@ buildPythonPackage rec {
  version = "65.1";
  pyproject = true;

  disabled = pythonOlder "3.9";

  src = fetchPypi {
    inherit version;
    pname = "weasyprint";
    hash = "sha256-EgKBvb1C/6p9flztvjGCos7zbqWtl/6fNX5DvmoeWOo=";
  src = fetchFromGitHub {
    owner = "Kozea";
    repo = "WeasyPrint";
    tag = "v${version}";
    hash = "sha256-iSeuRX1dnnrGZbcb1yTxOJPD5kgIWY6oz/0v02QJqSs=";
  };

  patches = [
@@ -64,6 +69,7 @@ buildPythonPackage rec {
    pkgs.ghostscript
    pytest-cov-stub
    pytestCheckHook
    writableTmpDirAsHomeHook
  ];

  disabledTests = [
@@ -93,11 +99,6 @@ buildPythonPackage rec {
  # Set env variable explicitly for Darwin, but allow overriding when invoking directly
  makeWrapperArgs = [ "--set-default FONTCONFIG_FILE ${FONTCONFIG_FILE}" ];

  preCheck = ''
    # Fontconfig wants to create a cache.
    export HOME=$TMPDIR
  '';

  pythonImportsCheck = [ "weasyprint" ];

  meta = {