diff --git a/pkgs/tools/misc/plantuml/default.nix b/pkgs/tools/misc/plantuml/default.nix index 08df665aede6..b3ceb41191de 100644 --- a/pkgs/tools/misc/plantuml/default.nix +++ b/pkgs/tools/misc/plantuml/default.nix @@ -1,37 +1,34 @@ -{ stdenv, fetchurl, jre, graphviz }: +{ stdenv, fetchurl, makeWrapper, jre, graphviz }: stdenv.mkDerivation rec { - version = "1.2018.10"; + version = "1.2018.11"; name = "plantuml-${version}"; src = fetchurl { url = "mirror://sourceforge/project/plantuml/${version}/plantuml.${version}.jar"; - sha256 = "19s3zrfri388nfykcs67sfk0dhmiw0rcv0dvj1j4c0fkyhl41bjs"; + sha256 = "006bpxz6zsjypxscxbnz3b7icg47bfwcq1v7rvijflchw12hq9nm"; }; - # It's only a .jar file and a shell wrapper - phases = [ "installPhase" ]; + nativeBuildInputs = [ makeWrapper ]; - installPhase = '' - mkdir -p "$out/bin" - mkdir -p "$out/lib" + buildCommand = '' + install -Dm644 $src $out/lib/plantuml.jar - cp "$src" "$out/lib/plantuml.jar" + mkdir -p $out/bin + makeWrapper ${jre}/bin/java $out/bin/plantuml \ + --argv0 plantuml \ + --set GRAPHVIZ_DOT ${graphviz}/bin/dot \ + --add-flags "-jar $out/lib/plantuml.jar" - cat > "$out/bin/plantuml" << EOF - #!${stdenv.shell} - export GRAPHVIZ_DOT="${graphviz}/bin/dot" - exec "${jre}/bin/java" -jar "$out/lib/plantuml.jar" "\$@" - EOF - chmod a+x "$out/bin/plantuml" + $out/bin/plantuml -help ''; meta = with stdenv.lib; { description = "Draw UML diagrams using a simple and human readable text description"; homepage = http://plantuml.sourceforge.net/; - # "java -jar plantuml.jar -license" says GPLv3 or later + # "plantuml -license" says GPLv3 or later license = licenses.gpl3Plus; - maintainers = [ maintainers.bjornfor ]; + maintainers = with maintainers; [ bjornfor ]; platforms = platforms.unix; }; }