Unverified Commit 2d659ce1 authored by Pol Dellaiera's avatar Pol Dellaiera Committed by GitHub
Browse files

python3Packages.plantuml-markdown: patch path to local `plantuml` (#428255)

parents 3171c7df 7b4b8c4d
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
{
  buildPythonPackage,
  fetchFromGitHub,
  pkgs, # Only for pkgs.plantuml,
  lib,
  plantuml,
  markdown,
@@ -9,7 +10,6 @@
  runCommand,
  writeText,
  plantuml-markdown,
  pythonOlder,
}:

buildPythonPackage rec {
@@ -17,8 +17,6 @@ buildPythonPackage rec {
  version = "3.11.1";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "mikitex70";
    repo = "plantuml-markdown";
@@ -26,6 +24,11 @@ buildPythonPackage rec {
    hash = "sha256-DgHWqwPsZ5q1XqrfaAiUslKnJdHX4Pzw9lygF3iaxz4=";
  };

  postPatch = ''
    substituteInPlace plantuml_markdown/plantuml_markdown.py \
      --replace-fail '"plantuml_cmd": ["plantuml"' '"plantuml_cmd": ["${lib.getExe pkgs.plantuml}"'
  '';

  propagatedBuildInputs = [
    plantuml
    markdown
@@ -34,6 +37,7 @@ buildPythonPackage rec {
  ];

  # The package uses a custom script that downloads a certain version of plantuml for testing.
  # Missing https://github.com/ezequielramos/http-server-mock which looks unmaintained
  doCheck = false;

  pythonImportsCheck = [ "plantuml_markdown" ];
@@ -52,7 +56,7 @@ buildPythonPackage rec {
      ! grep -q "Error" $out
    '';

  meta = with lib; {
  meta = {
    description = "PlantUML plugin for Python-Markdown";
    longDescription = ''
      This plugin implements a block extension which can be used to specify a PlantUML
@@ -60,7 +64,7 @@ buildPythonPackage rec {
    '';
    homepage = "https://github.com/mikitex70/plantuml-markdown";
    changelog = "https://github.com/mikitex70/plantuml-markdown/releases/tag/${src.tag}";
    license = licenses.bsd2;
    maintainers = with maintainers; [ nikstur ];
    license = lib.licenses.bsd2;
    maintainers = with lib.maintainers; [ nikstur ];
  };
}