From 808fb65d20ad469593ca7acaa191923b395cecde Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 15 Feb 2024 00:11:06 +0000 Subject: [PATCH 1/2] plantuml: 1.2024.1 -> 1.2024.2 --- pkgs/tools/misc/plantuml/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/plantuml/default.nix b/pkgs/tools/misc/plantuml/default.nix index 79e742989cac..88048d498626 100644 --- a/pkgs/tools/misc/plantuml/default.nix +++ b/pkgs/tools/misc/plantuml/default.nix @@ -1,12 +1,12 @@ { lib, stdenv, fetchurl, makeWrapper, jre, graphviz }: stdenv.mkDerivation rec { - version = "1.2024.1"; + version = "1.2024.2"; pname = "plantuml"; src = fetchurl { url = "https://github.com/plantuml/plantuml/releases/download/v${version}/plantuml-pdf-${version}.jar"; - sha256 = "sha256-lXo8eU6IX4JQFfhNUM2h6fi0HkShiwLsjMRTNbwLYwk="; + sha256 = "sha256-23EKdS1Z7beuyovgab8ELA1rCAn2Zl83YPmSZ83EBdw="; }; nativeBuildInputs = [ makeWrapper ]; From 44275c8b864008080168ad7933eb19fc2798a200 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Thu, 15 Feb 2024 22:22:35 +0100 Subject: [PATCH 2/2] plantuml: use `finalAttrs` pattern - replace `stdenv` with `stdenvNoCC` - replace `makeWrapper` with `makeBinaryWrapper` - add `postInstallCheck` step --- pkgs/tools/misc/plantuml/default.nix | 40 ++++++++++++++++++---------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/pkgs/tools/misc/plantuml/default.nix b/pkgs/tools/misc/plantuml/default.nix index 88048d498626..4524222873d5 100644 --- a/pkgs/tools/misc/plantuml/default.nix +++ b/pkgs/tools/misc/plantuml/default.nix @@ -1,15 +1,23 @@ -{ lib, stdenv, fetchurl, makeWrapper, jre, graphviz }: +{ lib +, stdenvNoCC +, fetchurl +, makeBinaryWrapper +, jre +, graphviz +}: -stdenv.mkDerivation rec { - version = "1.2024.2"; +stdenvNoCC.mkDerivation (finalAttrs: { pname = "plantuml"; + version = "1.2024.2"; src = fetchurl { - url = "https://github.com/plantuml/plantuml/releases/download/v${version}/plantuml-pdf-${version}.jar"; - sha256 = "sha256-23EKdS1Z7beuyovgab8ELA1rCAn2Zl83YPmSZ83EBdw="; + url = "https://github.com/plantuml/plantuml/releases/download/v${finalAttrs.version}/plantuml-pdf-${finalAttrs.version}.jar"; + hash = "sha256-23EKdS1Z7beuyovgab8ELA1rCAn2Zl83YPmSZ83EBdw="; }; - nativeBuildInputs = [ makeWrapper ]; + nativeBuildInputs = [ + makeBinaryWrapper + ]; buildCommand = '' install -Dm644 $src $out/lib/plantuml.jar @@ -19,18 +27,22 @@ stdenv.mkDerivation rec { --argv0 plantuml \ --set GRAPHVIZ_DOT ${graphviz}/bin/dot \ --add-flags "-jar $out/lib/plantuml.jar" - - $out/bin/plantuml -help ''; - meta = with lib; { + doInstallCheck = true; + postCheckInstall = '' + $out/bin/plantuml -help + $out/bin/plantuml -testdot + ''; + + meta = { description = "Draw UML diagrams using a simple and human readable text description"; homepage = "https://plantuml.com/"; - sourceProvenance = with sourceTypes; [ binaryBytecode ]; # "plantuml -license" says GPLv3 or later - license = licenses.gpl3Plus; - maintainers = with maintainers; [ bjornfor Mogria ]; - platforms = platforms.unix; + license = lib.licenses.gpl3Plus; mainProgram = "plantuml"; + maintainers = with lib.maintainers; [ bjornfor Mogria ]; + platforms = lib.platforms.unix; + sourceProvenance = with lib.sourceTypes; [ binaryBytecode ]; }; -} +})