diff options
Diffstat (limited to 'pkgs/by-name/fr/freeplane/package.nix')
-rw-r--r-- | pkgs/by-name/fr/freeplane/package.nix | 77 |
1 files changed, 9 insertions, 68 deletions
diff --git a/pkgs/by-name/fr/freeplane/package.nix b/pkgs/by-name/fr/freeplane/package.nix index 5ce7cebac0987..83a59347f9333 100644 --- a/pkgs/by-name/fr/freeplane/package.nix +++ b/pkgs/by-name/fr/freeplane/package.nix @@ -4,9 +4,7 @@ fetchFromGitHub, makeBinaryWrapper, makeDesktopItem, - writeText, jdk17, - perl, gradle_7, which, }: @@ -25,62 +23,6 @@ let hash = "sha256-zEQjB57iiKVQnH8VtynpEGKNAa2e+WpqnGt6fnv5Rjs="; }; - deps = stdenvNoCC.mkDerivation { - pname = "${pname}-deps"; - inherit src version; - - nativeBuildInputs = [ - jdk - perl - gradle - ]; - - buildPhase = '' - runHook preBuild - GRADLE_USER_HOME=$PWD gradle -Dorg.gradle.java.home=${jdk} --no-daemon build - runHook postBuild - ''; - - # 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 = '' - runHook preInstall - find ./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 - # com/squareup/okio/okio-jvm/x.y.z/okio-jvm-x.y.z.jar is expected to exist under com/squareup/okio/okio/x.y.z/okio-x.y.z.jar - while IFS="" read -r -d "" path; do - ln -s "$path" ''${path//okio-jvm/okio} - done < <(find "$out" -type f -name 'okio-jvm-*.jar' -print0) - runHook postInstall - ''; - # otherwise the package with a namespace starting with info/... gets moved to share/info/... - forceShare = [ "dummy" ]; - - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - outputHash = "sha256-mWQTe/hOWGwWtsUPCZ7gle2FtskcEmJwsGQZITEc/Uc="; - }; - - # Point to our local deps repo - gradleInit = writeText "init.gradle" '' - settingsEvaluated { settings -> - settings.pluginManagement { - repositories { - clear() - maven { url '${deps}' } - } - } - } - gradle.projectsLoaded { - rootProject.allprojects { - repositories { - clear() - maven { url '${deps}' } - } - } - } - ''; in stdenvNoCC.mkDerivation (finalAttrs: { inherit pname version src; @@ -91,17 +33,16 @@ stdenvNoCC.mkDerivation (finalAttrs: { gradle ]; - buildPhase = '' - runHook preBuild - mkdir -p freeplane/build + mitmCache = gradle.fetchDeps { + inherit pname; + data = ./deps.json; + }; - GRADLE_USER_HOME=$PWD \ - gradle -Dorg.gradle.java.home=${jdk} \ - --no-daemon --offline --init-script ${gradleInit} \ - -x test \ - build - runHook postBuild - ''; + gradleFlags = [ "-Dorg.gradle.java.home=${jdk}" "-x" "test" ]; + + preBuild = "mkdir -p freeplane/build"; + + gradleBuildTask = "build"; desktopItems = [ (makeDesktopItem { |