Code change:
<ins> { lib , stdenv , fetchFromGitHub , emptyDirectory , writeText , makeBinaryWrapper , gradle , jdk21 , 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-2023-11-27"; src = fetchFromGitHub { owner = "openjdk"; repo = "jextract"; rev = "8730fcf05c229d035b0db52ee6bd82622e9d03e9"; # Update jextract 21 with latest fixes hash = "sha256-Wct/yx5C0EjDtDyXNYDH5LRmrfq7islXbPVIGBR6x5Y="; }; nativeBuildInputs = [ gradle makeBinaryWrapper ]; env = { ORG_GRADLE_PROJECT_llvm_home = llvmPackages.libclang.lib; ORG_GRADLE_PROJECT_jdk21_home = jdk21; }; buildPhase = '' runHook preBuild export GRADLE_USER_HOME=$(mktemp -d) gradle --console plain --init-script "${gradleInit}" assemble runHook postBuild ''; doCheck = true; checkPhase = '' runHook preCheck gradle --console plain --init-script "${gradleInit}" verify runHook postCheck ''; installPhase = '' runHook preInstall mkdir -p $out/opt/ cp -r ./build/jextract $out/opt/jextract makeBinaryWrapper "$out/opt/jextract/bin/jextract" "$out/bin/jextract" runHook postInstall ''; meta = with lib; { description = "A tool which mechanically generates Java bindings from a native library headers"; mainProgram = "jextract"; homepage = "https://github.com/openjdk/jextract"; platforms = jdk21.meta.platforms; license = licenses.gpl2Only; maintainers = with maintainers; [ sharzy ]; }; } </ins>

Related discussion:
text: Package name: jextract (jextract-unstable) Current version on the unstable channel: 2023-11-27 Current version on the stable/release channel: n/a As of today the current release build is (see ) It would be nice for the nixpkgs version to be based on JDK 22 -- which contains the final non-preview release of Java Foreign Function & Memory API (aka "Panama") There are significant changes to that users will want before building/launching projects that use Panama. See: I am wiling to contribute but before we can do this we'll need to build with JDK 22 (see Issue )
It would be great if we could update to be based on JDK 22 :+1: , and we should also keep the current JDK 21 package as a new name (perhaps ?) at the same time, as some downstreams still depend on it and JDK 21 is a LTS version.
So should the first step be to rename the existing package? And leave as JDK 21-based (with a warning, maybe) and then do a separate PR to upgrade to JDK 21?
Update: There is a PR for JDK 22:
I can open a PR to update jextract after gets merged. Considering the significant API changes between JDK 21 and 22, and the fact that jextract itself produces very differnt code if you have to use JDK21 (see ) , is there really value in keeping a jextract version compatible with JDK21?
Awesome! I'm going to test on macOS/aarch64 this weekend, so that will help get it merged. wrote: as some downstreams still depend on it and JDK 21 is a LTS version. JDK 21 is LTS, but Panama (Foreign Functions & Memory API) is a "preview feature" which makes it really hard to build anything real with it (i.e. publish JARs for use by other projects. I even had problems with a Gradle multi-module build). I migrated my project to 22 a few weeks ago and am not looking back (which meant I had to stop using Nix as a source for temporarily.) But, I don't see any harm in renaming the existing to and starting a new one. And we certainly don't want to unnecessarily break anyone's dependencies.