2023-08-10 07:59:29 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2024-04-21 15:54:59 +00:00
|
|
|
, makeBinaryWrapper
|
2023-08-10 07:59:29 +00:00
|
|
|
, gradle
|
2024-01-02 11:29:13 +00:00
|
|
|
, jdk21
|
2023-08-10 07:59:29 +00:00
|
|
|
, llvmPackages
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "jextract";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "unstable-2023-11-27";
|
2023-08-10 07:59:29 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openjdk";
|
|
|
|
repo = "jextract";
|
2024-01-02 11:29:13 +00:00
|
|
|
rev = "8730fcf05c229d035b0db52ee6bd82622e9d03e9"; # Update jextract 21 with latest fixes
|
|
|
|
hash = "sha256-Wct/yx5C0EjDtDyXNYDH5LRmrfq7islXbPVIGBR6x5Y=";
|
2023-08-10 07:59:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
gradle
|
2024-04-21 15:54:59 +00:00
|
|
|
makeBinaryWrapper
|
2023-08-10 07:59:29 +00:00
|
|
|
];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
gradleFlags = [
|
|
|
|
"-Pllvm_home=${llvmPackages.libclang.lib}"
|
|
|
|
"-Pjdk21_home=${jdk21}"
|
|
|
|
];
|
2023-08-10 07:59:29 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
gradleCheckTask = "verify";
|
2023-08-10 07:59:29 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/opt/
|
|
|
|
cp -r ./build/jextract $out/opt/jextract
|
2024-04-21 15:54:59 +00:00
|
|
|
makeBinaryWrapper "$out/opt/jextract/bin/jextract" "$out/bin/jextract"
|
2023-08-10 07:59:29 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Tool which mechanically generates Java bindings from a native library headers";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "jextract";
|
2023-08-10 07:59:29 +00:00
|
|
|
homepage = "https://github.com/openjdk/jextract";
|
2024-04-21 15:54:59 +00:00
|
|
|
platforms = jdk21.meta.platforms;
|
2023-08-10 07:59:29 +00:00
|
|
|
license = licenses.gpl2Only;
|
|
|
|
maintainers = with maintainers; [ sharzy ];
|
|
|
|
};
|
|
|
|
}
|