mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-18 03:30:45 +00:00
jextract-21: convert to gradle setup hook
This commit is contained in:
parent
f9c2c4a8be
commit
6d513fb246
|
@ -1,41 +1,12 @@
|
|||
{ 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";
|
||||
|
@ -52,27 +23,14 @@ stdenv.mkDerivation {
|
|||
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
|
||||
'';
|
||||
gradleFlags = [
|
||||
"-Pllvm_home=${llvmPackages.libclang.lib}"
|
||||
"-Pjdk21_home=${jdk21}"
|
||||
];
|
||||
|
||||
doCheck = true;
|
||||
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
gradle --console plain --init-script "${gradleInit}" verify
|
||||
runHook postCheck
|
||||
'';
|
||||
gradleCheckTask = "verify";
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
|
Loading…
Reference in a new issue