From 2d66f08d28439ef9c1ca3970557b36cf416da90a Mon Sep 17 00:00:00 2001 From: Jacek Galowicz Date: Mon, 26 Sep 2022 19:39:38 +0200 Subject: [PATCH] plantuml-c4: Add sprites library --- pkgs/tools/misc/plantuml/plantuml-c4.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/plantuml/plantuml-c4.nix b/pkgs/tools/misc/plantuml/plantuml-c4.nix index 94cd76e9370d..a8d0001054fd 100644 --- a/pkgs/tools/misc/plantuml/plantuml-c4.nix +++ b/pkgs/tools/misc/plantuml/plantuml-c4.nix @@ -16,12 +16,17 @@ let sha256 = "sha256-vk4YWdGb47OsI9mApGTQ7OfELRZdBouzKfUZq3kchcM="; }; + sprites = fetchzip { + url = "https://github.com/tupadr3/plantuml-icon-font-sprites/archive/fa3f885dbd45c9cd0cdf6c0e5e4fb51ec8b76582.zip"; + sha256 = "sha256-lt9+NNMIaZSkKNsGyHoqXUCTlKmZFGfNYYGjer6X0Xc="; + }; + # In order to pre-fix the plantuml.jar parameter with the argument # -Dplantuml.include.path=..., we post-fix the java command using a wrapper. # This way the plantuml derivation can remain unchanged. plantumlWithExtraPath = let - plantumlIncludePath = lib.concatStringsSep ":" [ c4-lib ]; + plantumlIncludePath = lib.concatStringsSep ":" [ c4-lib sprites ]; includeFlag = "-Dplantuml.include.path=${lib.escapeShellArg plantumlIncludePath}"; postFixedJre = runCommand "jre-postfixed" { nativeBuildInputs = [ makeWrapper ]; } '' @@ -53,10 +58,13 @@ stdenv.mkDerivation rec { runCommand "c4-plantuml-sample.png" { nativeBuildInputs = [ plantuml-c4 ]; } '' sed 's/https:.*\///' "${c4-lib}/samples/C4_Context Diagram Sample - enterprise.puml" > sample.puml plantuml sample.puml -o $out + + sed 's/!include ..\//!include /' ${sprites}/examples/complex-example.puml > sprites.puml + plantuml sprites.puml -o $out ''; meta = with lib; { - description = "PlantUML bundled with C4-Plantuml library"; + description = "PlantUML bundled with C4-Plantuml and plantuml sprites library"; homepage = "https://github.com/plantuml-stdlib/C4-PlantUML"; license = licenses.mit; maintainers = with maintainers; [ tfc ];