diff options
Diffstat (limited to 'pkgs/development/tools/scenic-view/default.nix')
-rw-r--r-- | pkgs/development/tools/scenic-view/default.nix | 67 |
1 files changed, 8 insertions, 59 deletions
diff --git a/pkgs/development/tools/scenic-view/default.nix b/pkgs/development/tools/scenic-view/default.nix index 84d47390aa151..3fc74d7e3c737 100644 --- a/pkgs/development/tools/scenic-view/default.nix +++ b/pkgs/development/tools/scenic-view/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, openjdk, openjfx, gradle_7, makeDesktopItem, perl, writeText, makeWrapper }: +{ lib, stdenv, fetchFromGitHub, openjdk, openjfx, gradle_7, makeDesktopItem, makeWrapper }: let jdk = openjdk.override (lib.optionalAttrs stdenv.isLinux { enableJavaFX = true; @@ -17,57 +17,6 @@ let gradle = gradle_7; - deps = stdenv.mkDerivation { - name = "${pname}-deps"; - inherit src; - - nativeBuildInputs = [ jdk perl gradle ]; - - buildPhase = '' - export GRADLE_USER_HOME=$(mktemp -d); - gradle --no-daemon build - ''; - - # Mavenize dependency paths - # e.g. org.codehaus.groovy/groovy/2.4.0/{hash}/groovy-2.4.0.jar -> org/codehaus/groovy/groovy/2.4.0/groovy-2.4.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 - ''; - - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - outputHash = "0d6qs0wg2nfxyq85q46a8dcdqknz9pypb2qmvc8k2w8vcdac1y7n"; - }; - - # Point to our local deps repo - gradleInit = writeText "init.gradle" '' - settingsEvaluated { settings -> - settings.pluginManagement { - repositories { - clear() - maven { url '${deps}' } - } - } - } - logger.lifecycle 'Replacing Maven repositories with ${deps}...' - gradle.projectsLoaded { - rootProject.allprojects { - buildscript { - repositories { - clear() - maven { url '${deps}' } - } - } - repositories { - clear() - maven { url '${deps}' } - } - } - } - ''; - desktopItem = makeDesktopItem { name = pname; desktopName = pname; @@ -79,16 +28,16 @@ let in stdenv.mkDerivation rec { inherit pname version src; - nativeBuildInputs = [ jdk gradle makeWrapper ]; + nativeBuildInputs = [ gradle makeWrapper ]; - buildPhase = '' - runHook preBuild + mitmCache = gradle.fetchDeps { + inherit pname; + data = ./deps.json; + }; - export GRADLE_USER_HOME=$(mktemp -d) - gradle --offline --no-daemon --info --init-script ${gradleInit} build + __darwinAllowLocalNetworking = true; - runHook postBuild - ''; + doCheck = true; installPhase = '' runHook preInstall |