From f9c2c4a8be1816dff9ad1697d29e795ae839f921 Mon Sep 17 00:00:00 2001 From: chayleaf Date: Thu, 27 Jun 2024 03:19:41 +0700 Subject: [PATCH] jextract: convert to gradle setup hook --- pkgs/by-name/je/jextract/package.nix | 52 +++------------------------- 1 file changed, 5 insertions(+), 47 deletions(-) diff --git a/pkgs/by-name/je/jextract/package.nix b/pkgs/by-name/je/jextract/package.nix index 187a0e91f93a..891eac01ae79 100644 --- a/pkgs/by-name/je/jextract/package.nix +++ b/pkgs/by-name/je/jextract/package.nix @@ -1,41 +1,12 @@ { lib , stdenv , fetchFromGitHub -, emptyDirectory -, writeText , makeBinaryWrapper , gradle , jdk22 , llvmPackages }: -let - gradleInit = writeText "init.gradle" '' - logger.lifecycle 'Replacing Maven repositories with empty directory...' - gradle.projectsLoaded { - rootProject.allprojects { - buildscript { - repositories { - clear() - maven { url '${emptyDirectory}' } - } - } - repositories { - clear() - maven { url '${emptyDirectory}' } - } - } - } - settingsEvaluated { settings -> - settings.pluginManagement { - repositories { - maven { url '${emptyDirectory}' } - } - } - } - ''; -in - stdenv.mkDerivation { pname = "jextract"; version = "unstable-2024-03-13"; @@ -52,27 +23,14 @@ stdenv.mkDerivation { makeBinaryWrapper ]; - env = { - ORG_GRADLE_PROJECT_llvm_home = llvmPackages.libclang.lib; - ORG_GRADLE_PROJECT_jdk22_home = jdk22; - }; - - buildPhase = '' - runHook preBuild - - export GRADLE_USER_HOME=$(mktemp -d) - gradle --console plain --init-script "${gradleInit}" assemble - - runHook postBuild - ''; + gradleFlags = [ + "-Pllvm_home=${llvmPackages.libclang.lib}" + "-Pjdk22_home=${jdk22}" + ]; doCheck = true; - checkPhase = '' - runHook preCheck - gradle --console plain --init-script "${gradleInit}" verify - runHook postCheck - ''; + gradleCheckTask = "verify"; installPhase = '' runHook preInstall