diff options
author | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2023-06-20 15:15:57 +0300 |
---|---|---|
committer | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2023-06-20 15:15:57 +0300 |
commit | 570c2535e5da615b2ee9c442c5809727642a1c2d (patch) | |
tree | f953fd3d9c42cccd04a3e28f95acdf1962258bed /pkgs | |
parent | 50847470ba43e608d4b77c406ca26313229a49a0 (diff) |
cryptomator: convert to mavenfod
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/tools/security/cryptomator/default.nix | 40 |
1 files changed, 6 insertions, 34 deletions
diff --git a/pkgs/tools/security/cryptomator/default.nix b/pkgs/tools/security/cryptomator/default.nix index a7341ef79d9b5..2c20615b1e202 100644 --- a/pkgs/tools/security/cryptomator/default.nix +++ b/pkgs/tools/security/cryptomator/default.nix @@ -1,10 +1,10 @@ -{ lib, stdenv, fetchFromGitHub +{ lib, javaPackages, fetchFromGitHub , autoPatchelfHook , fuse3 , maven, jdk, makeShellWrapper, glib, wrapGAppsHook }: -let +javaPackages.mavenfod rec { pname = "cryptomator"; version = "1.8.0"; @@ -12,43 +12,15 @@ let owner = "cryptomator"; repo = "cryptomator"; rev = version; - sha256 = "sha256-4MjF2PDH0JB1biY4HO2wOC0i6EIGSlzkK6tDm8nzvIo="; + hash = "sha256-4MjF2PDH0JB1biY4HO2wOC0i6EIGSlzkK6tDm8nzvIo="; }; - # perform fake build to make a fixed-output derivation out of the files downloaded from maven central (120MB) - deps = stdenv.mkDerivation { - name = "cryptomator-${version}-deps"; - inherit src; + mvnParameters = "-Dmaven.test.skip=true"; + mvnHash = "sha256-rHLLYkZq3GGE0uhTgZT0tnsh+ChzQdpQ2e+SG1TwBvw="; - nativeBuildInputs = [ jdk maven ]; - buildInputs = [ jdk ]; - - buildPhase = '' - while mvn -Plinux package -Dmaven.test.skip=true -Dmaven.repo.local=$out/.m2 -Dmaven.wagon.rto=5000; [ $? = 1 ]; do - echo "timeout, restart maven to continue downloading" - done - ''; - - # 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 - find $out/.m2 -type f -iname '*.pom' -exec sed -i -e 's/\r\+$//' {} \; - ''; - - outputHashMode = "recursive"; - outputHash = "sha256-2nCaSL7OlS9f+PZPh0YiMvnjOaAqlQimkKWDSjSP+bQ="; - - doCheck = false; - }; - -in stdenv.mkDerivation rec { - inherit pname version src; - - buildPhase = '' + preBuild = '' VERSION=${version} SEMVER_STR=${version} - - mvn -Plinux package --offline -Dmaven.test.skip=true -Dmaven.repo.local=$(cp -dpR ${deps}/.m2 ./ && chmod +w -R .m2 && pwd)/.m2 ''; |