diff options
author | Krzysztof Nazarewski <3494992+nazarewk@users.noreply.github.com> | 2022-03-15 16:44:16 +0100 |
---|---|---|
committer | Krzysztof Nazarewski <3494992+nazarewk@users.noreply.github.com> | 2022-03-15 16:50:08 +0100 |
commit | 759517412f9d0f949049d99031decc4752d7ca73 (patch) | |
tree | 0176d23e3249b33c30100c02fdb1b508f8f92179 /pkgs/tools/misc/plantuml-server | |
parent | 9c0dd184928e48d66a50291a7e0ee394029166ed (diff) |
plantuml-server: fixed unstable deps
after merging https://github.com/NixOS/nixpkgs/pull/163431 `plantuml-server-*-deps` derivation turned out unstable, this commit switches to fetching `plantuml.war` directly from releases
Diffstat (limited to 'pkgs/tools/misc/plantuml-server')
-rw-r--r-- | pkgs/tools/misc/plantuml-server/default.nix | 63 |
1 files changed, 7 insertions, 56 deletions
diff --git a/pkgs/tools/misc/plantuml-server/default.nix b/pkgs/tools/misc/plantuml-server/default.nix index 8b6c52446aa82..8be9c0eecee46 100644 --- a/pkgs/tools/misc/plantuml-server/default.nix +++ b/pkgs/tools/misc/plantuml-server/default.nix @@ -1,69 +1,20 @@ -{ lib, stdenv, fetchFromGitHub, maven, jdk17_headless }: +{ lib, stdenv, fetchurl }: let version = "1.2022.2"; - - src = fetchFromGitHub { - owner = "plantuml"; - repo = "plantuml-server"; - rev = "v${version}"; - sha256 = "sha256-55IBhulFo42jscBFrHM39qA0GRgKBoYNye4q9QkmjsM="; - }; - - # perform fake build to make a fixed-output derivation out of the files downloaded from maven central - deps = stdenv.mkDerivation { - name = "plantuml-server-${version}-deps"; - inherit src; - nativeBuildInputs = [ jdk17_headless maven ]; - buildPhase = '' - runHook preBuild - - while mvn package -Dmaven.repo.local=$out/.m2; [ $? = 1 ]; do - echo "timeout, restart maven to continue downloading" - done - - runHook postBuild - ''; - # keep only *.{pom,jar,sha1,nbm} and delete all ephemeral files with lastModified timestamps inside - installPhase = '' - find $out/.m2 -type f -regex '.+\(\.lastUpdated\|resolver-status\.properties\|_remote\.repositories\)' -delete - ''; - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - outputHash = "sha256-AheCBX5jFzDHqTI2pCWBIiDESEKMClXlvWIcFvu0goA="; - }; in - stdenv.mkDerivation rec { pname = "plantuml-server"; inherit version; - inherit src; - - nativeBuildInputs = [ jdk17_headless maven ]; - - buildPhase = '' - runHook preBuild - - # maven can output reproducible files after setting project.build.outputTimestamp property - # see https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-do-i-configure-my-maven-build - # 'maven.repo.local' must be writable so copy it out of nix store - cp -R $src repo - chmod +w -R repo - cd repo - mvn package --offline \ - -Dproject.build.outputTimestamp=0 \ - -Dmaven.repo.local=$(cp -dpR ${deps}/.m2 ./ && chmod +w -R .m2 && pwd)/.m2 - - runHook postBuild - ''; + src = fetchurl { + url = "https://github.com/plantuml/plantuml-server/releases/download/v${version}/plantuml-v${version}.war"; + sha256 = "sha256-h4ulXzZ5L+VPhk2CnZQNxfnEJzWT3B9TNvDEWt4o9Hk="; + }; + dontUnpack = true; installPhase = '' - runHook preInstall - mkdir -p "$out/webapps" - cp "target/plantuml.war" "$out/webapps/plantuml.war" - - runHook postInstall + cp "$src" "$out/webapps/plantuml.war" ''; meta = with lib; { |