2023-08-22 20:05:09 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2021-03-09 03:18:52 +00:00
|
|
|
, autoPatchelfHook
|
2023-05-24 13:37:59 +00:00
|
|
|
, fuse3
|
2024-05-15 15:35:15 +00:00
|
|
|
, maven, jdk, makeShellWrapper, glib, wrapGAppsHook3
|
2024-01-02 11:29:13 +00:00
|
|
|
, libayatana-appindicator
|
2021-03-09 03:18:52 +00:00
|
|
|
}:
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
mavenJdk = maven.override {
|
|
|
|
jdk = jdk;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
assert stdenv.isLinux; # better than `called with unexpected argument 'enableJavaFX'`
|
|
|
|
mavenJdk.buildMavenPackage rec {
|
2021-03-09 03:18:52 +00:00
|
|
|
pname = "cryptomator";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "1.12.4";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cryptomator";
|
|
|
|
repo = "cryptomator";
|
|
|
|
rev = version;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-i5TrWXOkRR+1iqSzMTJEe5xMJ3iM5kdI3fXb/Z5/Gb0=";
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
mvnParameters = "-Dmaven.test.skip=true -Plinux";
|
2024-02-29 20:09:43 +00:00
|
|
|
mvnHash = "sha256-Zx2HhgmebF8UOp+2JKl2+FGA98aPRSUTIduHPTtgAjI=";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
preBuild = ''
|
2022-04-27 09:35:20 +00:00
|
|
|
VERSION=${version}
|
|
|
|
SEMVER_STR=${version}
|
2021-03-09 03:18:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
# This is based on the instructins in https://github.com/cryptomator/cryptomator/blob/develop/dist/linux/appimage/build.sh
|
2021-03-09 03:18:52 +00:00
|
|
|
installPhase = ''
|
2024-05-15 15:35:15 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
mkdir -p $out/bin/ $out/share/cryptomator/libs/ $out/share/cryptomator/mods/
|
|
|
|
|
|
|
|
cp target/libs/* $out/share/cryptomator/libs/
|
|
|
|
cp target/mods/* target/cryptomator-*.jar $out/share/cryptomator/mods/
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
makeShellWrapper ${jdk}/bin/java $out/bin/${pname} \
|
2023-05-24 13:37:59 +00:00
|
|
|
--add-flags "--enable-preview" \
|
2024-01-02 11:29:13 +00:00
|
|
|
--add-flags "--enable-native-access=org.cryptomator.jfuse.linux.amd64,org.purejava.appindicator" \
|
2022-03-30 09:31:56 +00:00
|
|
|
--add-flags "--class-path '$out/share/cryptomator/libs/*'" \
|
|
|
|
--add-flags "--module-path '$out/share/cryptomator/mods'" \
|
2023-11-16 04:20:00 +00:00
|
|
|
--add-flags "-Dfile.encoding='utf-8'" \
|
|
|
|
--add-flags "-Dcryptomator.logDir='@{userhome}/.local/share/Cryptomator/logs'" \
|
|
|
|
--add-flags "-Dcryptomator.pluginDir='@{userhome}/.local/share/Cryptomator/plugins'" \
|
|
|
|
--add-flags "-Dcryptomator.settingsPath='@{userhome}/.config/Cryptomator/settings.json'" \
|
|
|
|
--add-flags "-Dcryptomator.p12Path='@{userhome}/.config/Cryptomator/key.p12'" \
|
|
|
|
--add-flags "-Dcryptomator.ipcSocketPath='@{userhome}/.config/Cryptomator/ipc.socket'" \
|
|
|
|
--add-flags "-Dcryptomator.mountPointsDir='@{userhome}/.local/share/Cryptomator/mnt'" \
|
2024-01-02 11:29:13 +00:00
|
|
|
--add-flags "-Dcryptomator.showTrayIcon=true" \
|
|
|
|
--add-flags "-Dcryptomator.buildNumber='nix-${src.rev}'" \
|
2022-04-27 09:35:20 +00:00
|
|
|
--add-flags "-Dcryptomator.appVersion='${version}'" \
|
2024-01-02 11:29:13 +00:00
|
|
|
--add-flags "-Djava.net.useSystemProxies=true" \
|
2021-03-09 03:18:52 +00:00
|
|
|
--add-flags "-Xss20m" \
|
|
|
|
--add-flags "-Xmx512m" \
|
2024-01-02 11:29:13 +00:00
|
|
|
--add-flags "-Dcryptomator.disableUpdateCheck=true" \
|
|
|
|
--add-flags "-Dcryptomator.integrationsLinux.trayIconsDir='$out/share/icons/hicolor/symbolic/apps'" \
|
2022-03-30 09:31:56 +00:00
|
|
|
--add-flags "--module org.cryptomator.desktop/org.cryptomator.launcher.Cryptomator" \
|
2023-05-24 13:37:59 +00:00
|
|
|
--prefix PATH : "$out/share/cryptomator/libs/:${lib.makeBinPath [ jdk glib ]}" \
|
2024-01-02 11:29:13 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ fuse3 libayatana-appindicator ]}" \
|
2023-05-24 13:37:59 +00:00
|
|
|
--set JAVA_HOME "${jdk.home}"
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
# install desktop entry and icons
|
2022-03-30 09:31:56 +00:00
|
|
|
cp -r ${src}/dist/linux/appimage/resources/AppDir/usr/* $out/
|
2022-04-27 09:35:20 +00:00
|
|
|
# The directory is read only when copied, enable read to install additional files
|
|
|
|
chmod +w -R $out/
|
|
|
|
cp ${src}/dist/linux/common/org.cryptomator.Cryptomator256.png $out/share/icons/hicolor/256x256/apps/org.cryptomator.Cryptomator.png
|
|
|
|
cp ${src}/dist/linux/common/org.cryptomator.Cryptomator512.png $out/share/icons/hicolor/512x512/apps/org.cryptomator.Cryptomator.png
|
|
|
|
cp ${src}/dist/linux/common/org.cryptomator.Cryptomator.svg $out/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg
|
2024-05-15 15:35:15 +00:00
|
|
|
cp ${src}/dist/linux/common/org.cryptomator.Cryptomator.tray-unlocked.svg $out/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.tray-unlocked.svg
|
|
|
|
cp ${src}/dist/linux/common/org.cryptomator.Cryptomator.tray.svg $out/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.tray.svg
|
|
|
|
cp ${src}/dist/linux/common/org.cryptomator.Cryptomator.tray-unlocked.svg $out/share/icons/hicolor/symbolic/apps/org.cryptomator.Cryptomator.tray-unlocked-symbolic.svg
|
|
|
|
cp ${src}/dist/linux/common/org.cryptomator.Cryptomator.tray.svg $out/share/icons/hicolor/symbolic/apps/org.cryptomator.Cryptomator.tray-symbolic.svg
|
2022-04-27 09:35:20 +00:00
|
|
|
cp ${src}/dist/linux/common/org.cryptomator.Cryptomator.desktop $out/share/applications/org.cryptomator.Cryptomator.desktop
|
|
|
|
cp ${src}/dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml $out/share/metainfo/org.cryptomator.Cryptomator.metainfo.xml
|
|
|
|
cp ${src}/dist/linux/common/application-vnd.cryptomator.vault.xml $out/share/mime/packages/application-vnd.cryptomator.vault.xml
|
2024-05-15 15:35:15 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2021-03-09 03:18:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoPatchelfHook
|
2022-06-16 17:23:12 +00:00
|
|
|
makeShellWrapper
|
2024-05-15 15:35:15 +00:00
|
|
|
wrapGAppsHook3
|
2022-05-18 14:49:53 +00:00
|
|
|
jdk
|
|
|
|
];
|
2024-01-02 11:29:13 +00:00
|
|
|
buildInputs = [ fuse3 jdk glib libayatana-appindicator ];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Free client-side encryption for your cloud files";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "cryptomator";
|
2021-03-09 03:18:52 +00:00
|
|
|
homepage = "https://cryptomator.org";
|
2022-06-16 17:23:12 +00:00
|
|
|
sourceProvenance = with sourceTypes; [
|
|
|
|
fromSource
|
|
|
|
binaryBytecode # deps
|
|
|
|
];
|
2021-03-09 03:18:52 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ bachp ];
|
2023-03-15 16:39:30 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
}
|