From ca8e544e4e3db7bba1c18eab0cb62505782086cc Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Wed, 3 Jan 2024 18:35:47 +0100 Subject: [PATCH] calcoo: make deterministic and clean up --- .../misc/calcoo/0001-javac-encoding.diff | 21 ------------ pkgs/applications/misc/calcoo/default.nix | 32 +++++++++---------- 2 files changed, 15 insertions(+), 38 deletions(-) delete mode 100644 pkgs/applications/misc/calcoo/0001-javac-encoding.diff diff --git a/pkgs/applications/misc/calcoo/0001-javac-encoding.diff b/pkgs/applications/misc/calcoo/0001-javac-encoding.diff deleted file mode 100644 index c16616b3dd04..000000000000 --- a/pkgs/applications/misc/calcoo/0001-javac-encoding.diff +++ /dev/null @@ -1,21 +0,0 @@ -diff -Naur calcoo-2.1.0-old/build.xml calcoo-2.1.0-new/build.xml ---- calcoo-2.1.0-old/build.xml 1969-12-31 21:00:01.000000000 -0300 -+++ calcoo-2.1.0-new/build.xml 2022-04-16 15:41:59.763861191 -0300 -@@ -16,7 +16,7 @@ - - - -- -+ - - - -@@ -31,7 +31,7 @@ - - - -- -+ - - - diff --git a/pkgs/applications/misc/calcoo/default.nix b/pkgs/applications/misc/calcoo/default.nix index b0fc6da5eb46..5f90b4bb2363 100644 --- a/pkgs/applications/misc/calcoo/default.nix +++ b/pkgs/applications/misc/calcoo/default.nix @@ -2,57 +2,55 @@ , stdenv , fetchzip , ant +, canonicalize-jars-hook , jdk , makeWrapper }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "calcoo"; version = "2.1.0"; src = fetchzip { - url = "mirror://sourceforge/project/calcoo/calcoo/${version}/${pname}-${version}.zip"; + url = "mirror://sourceforge/calcoo/calcoo-${finalAttrs.version}.zip"; hash = "sha256-Bdavj7RaI5CkWiOJY+TPRIRfNelfW5qdl/74J1KZPI0="; }; - patches = [ - # Sets javac encoding option on build.xml - ./0001-javac-encoding.diff - ]; - nativeBuildInputs = [ ant + canonicalize-jars-hook jdk makeWrapper ]; dontConfigure = true; + env.JAVA_TOOL_OPTIONS = "-Dfile.encoding=iso-8859-1"; + buildPhase = '' runHook preBuild - ant - runHook postBuild ''; installPhase = '' runHook preInstall - mkdir -p $out/bin $out/share/${pname} - mv dist/lib/calcoo.jar $out/share/${pname} + install -Dm644 dist/lib/calcoo.jar -t $out/share/calcoo makeWrapper ${jdk}/bin/java $out/bin/calcoo \ - --add-flags "-jar $out/share/${pname}/calcoo.jar" + --add-flags "-jar $out/share/calcoo/calcoo.jar" runHook postInstall ''; - meta = with lib; { - homepage = "https://calcoo.sourceforge.net/"; + meta = { + changelog = "https://calcoo.sourceforge.net/changelog.html"; description = "RPN and algebraic scientific calculator"; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ AndersonTorres ]; + homepage = "https://calcoo.sourceforge.net/"; + license = lib.licenses.gpl2Plus; + mainProgram = "calcoo"; + maintainers = with lib.maintainers; [ AndersonTorres ]; inherit (jdk.meta) platforms; }; -} +})