From 8f4441a03734c782897ab38b706e0d055f39f5d7 Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Wed, 3 Jan 2024 22:07:24 +0100 Subject: [PATCH] javaCup: make deterministic and clean up --- .../libraries/java/cup/default.nix | 54 ++++++++++++------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/pkgs/development/libraries/java/cup/default.nix b/pkgs/development/libraries/java/cup/default.nix index f7732ff637af..2f673a8e5a67 100644 --- a/pkgs/development/libraries/java/cup/default.nix +++ b/pkgs/development/libraries/java/cup/default.nix @@ -1,38 +1,56 @@ -{ lib, stdenv, fetchurl, jdk, ant } : +{ lib +, stdenv +, fetchurl +, ant +, jdk +, makeWrapper +, canonicalize-jars-hook +}: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "java-cup"; version = "11b-20160615"; src = fetchurl { - url = "http://www2.cs.tum.edu/projects/cup/releases/java-cup-src-${version}.tar.gz"; - sha256 = "1ymz3plngxclh7x3xr31537rvvak7lwyd0qkmnl1mkj5drh77rz0"; + url = "http://www2.cs.tum.edu/projects/cup/releases/java-cup-src-${finalAttrs.version}.tar.gz"; + hash = "sha256-4OdzYG5FzhqorROD5jk9U+2dzyhh5D76gZT1Z+kdv/o="; }; sourceRoot = "."; - nativeBuildInputs = [ jdk ant ]; - patches = [ ./javacup-0.11b_beta20160615-build-xml-git.patch ]; - buildPhase = "ant"; + nativeBuildInputs = [ + ant + jdk + makeWrapper + canonicalize-jars-hook + ]; + + buildPhase = '' + runHook preBuild + ant + runHook postBuild + ''; installPhase = '' - mkdir -p $out/{bin,share/{java,java-cup}} - cp dist/java-cup-11b.jar $out/share/java-cup/ - cp dist/java-cup-11b-runtime.jar $out/share/java/ - cat > $out/bin/javacup <