Commit 2d66f08d authored by Jacek Galowicz's avatar Jacek Galowicz Committed by Bjørn Forsman
Browse files

plantuml-c4: Add sprites library

parent cec24ab1
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -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 ];