depot/pkgs/by-name/je/jextract/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

55 lines
1.2 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, makeBinaryWrapper
, gradle
, jdk23
, llvmPackages
}:
stdenv.mkDerivation {
pname = "jextract";
version = "unstable-2024-03-13";
src = fetchFromGitHub {
owner = "openjdk";
repo = "jextract";
rev = "b9ec8879cff052b463237fdd76382b3a5cd8ff2b";
hash = "sha256-+4AM8pzXPIO/CS3+Rd/jJf2xDvAo7K7FRyNE8rXvk5U=";
};
nativeBuildInputs = [
gradle
makeBinaryWrapper
];
gradleFlags = [
"-Pllvm_home=${lib.getLib llvmPackages.libclang}"
"-Pjdk22_home=${jdk23}"
];
doCheck = true;
gradleCheckTask = "verify";
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 = "Tool which mechanically generates Java bindings from a native library headers";
mainProgram = "jextract";
homepage = "https://github.com/openjdk/jextract";
platforms = jdk23.meta.platforms;
license = licenses.gpl2Only;
maintainers = with maintainers; [ jlesquembre sharzy ];
# Not yet updated for JDK 23
broken = true;
};
}