diff options
Diffstat (limited to 'pkgs/tools/typesetting/pdftk/default.nix')
-rw-r--r-- | pkgs/tools/typesetting/pdftk/default.nix | 66 |
1 files changed, 9 insertions, 57 deletions
diff --git a/pkgs/tools/typesetting/pdftk/default.nix b/pkgs/tools/typesetting/pdftk/default.nix index 27d95c00c01bd..9ecb87b86ff65 100644 --- a/pkgs/tools/typesetting/pdftk/default.nix +++ b/pkgs/tools/typesetting/pdftk/default.nix @@ -1,6 +1,6 @@ -{ lib, stdenv, fetchFromGitLab, gradle, jre, perl, writeText, runtimeShell }: +{ lib, stdenv, fetchFromGitLab, gradle, jre, runtimeShell }: -let +stdenv.mkDerivation rec { pname = "pdftk"; version = "3.3.3"; @@ -11,66 +11,18 @@ let hash = "sha256-ciKotTHSEcITfQYKFZ6sY2LZnXGChBJy0+eno8B3YHY="; }; - deps = stdenv.mkDerivation { - pname = "${pname}-deps"; - inherit src version; - - nativeBuildInputs = [ gradle perl ]; - - buildPhase = '' - export GRADLE_USER_HOME=$(mktemp -d) - gradle -Dfile.encoding=utf-8 shadowJar; - ''; - - # 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 - ''; + nativeBuildInputs = [ gradle ]; - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - outputHash = "sha256-Mx5CdiRxuql22kbLozzr9Rs2E2Svzg2zN1138Xa0pMc="; + mitmCache = gradle.fetchDeps { + inherit pname; + data = ./deps.json; }; - # Point to our local deps repo - gradleInit = writeText "init.gradle" '' - logger.lifecycle 'Replacing Maven repositories with ${deps}...' - gradle.projectsLoaded { - rootProject.allprojects { - buildscript { - repositories { - clear() - maven { url '${deps}' } - } - } - repositories { - clear() - maven { url '${deps}' } - } - } - } + __darwinAllowLocalNetworking = true; - settingsEvaluated { settings -> - settings.pluginManagement { - repositories { - maven { url '${deps}' } - } - } - } - ''; + gradleFlags = [ "-Dfile.encoding=utf-8" ]; -in stdenv.mkDerivation rec { - inherit pname version src; - - nativeBuildInputs = [ gradle ]; - - buildPhase = '' - export GRADLE_USER_HOME=$(mktemp -d) - gradle --offline --no-daemon --info --init-script ${gradleInit} shadowJar - ''; + gradleBuildTask = "shadowJar"; installPhase = '' mkdir -p $out/{bin,share/pdftk,share/man/man1} |