jextract: unstable-2023-11-27 -> unstable-2024-03-13

Closes #293102
This commit is contained in:
José Luis Lafuente 2024-03-25 21:02:28 +01:00
parent 4617c089d2
commit 47fe73f5b6
No known key found for this signature in database
GPG Key ID: 8A3455EBE455489A
3 changed files with 99 additions and 8 deletions

View File

@ -3,7 +3,7 @@
, fetchFromGitHub
, emptyDirectory
, writeText
, makeWrapper
, makeBinaryWrapper
, gradle
, jdk21
, llvmPackages
@ -49,7 +49,7 @@ stdenv.mkDerivation {
nativeBuildInputs = [
gradle
makeWrapper
makeBinaryWrapper
];
env = {
@ -79,18 +79,16 @@ stdenv.mkDerivation {
mkdir -p $out/opt/
cp -r ./build/jextract $out/opt/jextract
makeBinaryWrapper "$out/opt/jextract/bin/jextract" "$out/bin/jextract"
runHook postInstall
'';
postFixup = ''
makeWrapper "$out/opt/jextract/bin/jextract" "$out/bin/jextract"
'';
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 ];
};

View File

@ -0,0 +1,95 @@
{ 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";
src = fetchFromGitHub {
owner = "openjdk";
repo = "jextract";
rev = "b9ec8879cff052b463237fdd76382b3a5cd8ff2b";
hash = "sha256-+4AM8pzXPIO/CS3+Rd/jJf2xDvAo7K7FRyNE8rXvk5U=";
};
nativeBuildInputs = [
gradle
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
'';
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 = jdk22.meta.platforms;
license = licenses.gpl2Only;
maintainers = with maintainers; [ jlesquembre sharzy ];
};
}

View File

@ -25382,8 +25382,6 @@ with pkgs;
fastjar = callPackage ../development/tools/java/fastjar { };
jextract = callPackage ../development/tools/java/jextract { };
httpunit = callPackage ../development/libraries/java/httpunit { };
javaCup = callPackage ../development/libraries/java/cup {