diff options
Diffstat (limited to 'pkgs/applications/science/logic/key/default.nix')
-rw-r--r-- | pkgs/applications/science/logic/key/default.nix | 50 |
1 files changed, 10 insertions, 40 deletions
diff --git a/pkgs/applications/science/logic/key/default.nix b/pkgs/applications/science/logic/key/default.nix index 5a48abfc4aa48..0cd5e90cbb504 100644 --- a/pkgs/applications/science/logic/key/default.nix +++ b/pkgs/applications/science/logic/key/default.nix @@ -2,7 +2,6 @@ , fetchurl , jdk , gradle_7 -, perl , jre , makeWrapper , makeDesktopItem @@ -12,6 +11,9 @@ }: let + gradle = gradle_7; + +in stdenv.mkDerivation rec { pname = "key"; version = "2.10.0"; src = fetchurl { @@ -20,30 +22,6 @@ let }; sourceRoot = "key-${version}/key"; - # fake build to pre-download deps into fixed-output derivation - deps = stdenv.mkDerivation { - pname = "${pname}-deps"; - inherit version src sourceRoot; - nativeBuildInputs = [ gradle_7 perl ]; - buildPhase = '' - export GRADLE_USER_HOME=$(mktemp -d) - # https://github.com/gradle/gradle/issues/4426 - ${lib.optionalString stdenv.isDarwin "export TERM=dumb"} - gradle --no-daemon classes testClasses - ''; - # perl code mavenizes pathes (com.squareup.okio/okio/1.13.0/a9283170b7305c8d92d25aff02a6ab7e45d06cbe/okio-1.13.0.jar -> com/squareup/okio/okio/1.13.0/okio-1.13.0.jar) - installPhase = '' - find $GRADLE_USER_HOME/caches/modules-2 -type f -regex '.*\.\(jar\|pom\)' \ - | perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/\s]+))$# ($x = $2) =~ tr|\.|/|; "install -Dm444 $1 \$out/$x/$3/$4/$5" #e' \ - | sh - ''; - outputHashMode = "recursive"; - outputHashAlgo = "sha256"; - outputHash = "sha256-GjBUwJxeyJA6vGrPQVtNpcHb4CJlNlY4kHt1PT21xjo="; - }; -in stdenv.mkDerivation rec { - inherit pname version src sourceRoot; - nativeBuildInputs = [ jdk gradle_7 @@ -65,23 +43,15 @@ in stdenv.mkDerivation rec { }) ]; - # disable tests (broken on darwin) - gradleAction = if stdenv.isDarwin then "assemble" else "build"; - - buildPhase = '' - runHook preBuild + mitmCache = gradle.fetchDeps { + inherit pname; + data = ./deps.json; + }; - export GRADLE_USER_HOME=$(mktemp -d) - # https://github.com/gradle/gradle/issues/4426 - ${lib.optionalString stdenv.isDarwin "export TERM=dumb"} - # point to offline repo - sed -ie "s#repositories {#repositories { maven { url '${deps}' }#g" build.gradle - cat <(echo "pluginManagement { repositories { maven { url '${deps}' } } }") settings.gradle > settings_new.gradle - mv settings_new.gradle settings.gradle - gradle --offline --no-daemon ${gradleAction} + __darwinAllowLocalNetworking = true; - runHook postBuild - ''; + # tests are broken on darwin + doCheck = !stdenv.isDarwin; installPhase = '' runHook preInstall |