nixpkgs/pkgs/by-name/cr/cryptomator/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

133 lines
5.1 KiB
Nix
Raw Normal View History

2024-11-19 22:43:36 +00:00
{
autoPatchelfHook,
fetchFromGitHub,
2024-11-19 22:43:36 +00:00
fuse3,
glib,
2024-11-19 23:07:22 +00:00
jdk23,
lib,
libayatana-appindicator,
2024-11-19 22:43:36 +00:00
makeShellWrapper,
maven,
2024-11-19 22:43:36 +00:00
wrapGAppsHook3,
}:
2024-11-19 23:07:22 +00:00
let
jdk = jdk23.override { enableJavaFX = true; };
in
2024-07-15 13:13:03 +00:00
maven.buildMavenPackage rec {
pname = "cryptomator";
2024-11-19 23:16:38 +00:00
version = "1.14.2";
src = fetchFromGitHub {
owner = "cryptomator";
repo = "cryptomator";
rev = version;
2024-11-19 23:16:38 +00:00
hash = "sha256-TSE83QYFry8O6MKAoggJBjqonYiGax5GG/a7sm7aHf8=";
};
2024-11-19 23:16:38 +00:00
patches = [
# https://github.com/cryptomator/cryptomator/pull/3621
./string-template-removal-and-jdk23.patch
];
2024-07-15 13:13:03 +00:00
mvnJdk = jdk;
mvnParameters = "-Dmaven.test.skip=true -Plinux";
2024-11-19 23:16:38 +00:00
mvnHash = "sha256-LFD150cGW6OdwkK28GYI9j44GtVE0pwFMaQ8dQqArLo=";
2023-06-20 12:15:57 +00:00
preBuild = ''
2022-04-02 11:28:22 +00:00
VERSION=${version}
SEMVER_STR=${version}
'';
2022-04-02 11:28:22 +00:00
# This is based on the instructins in https://github.com/cryptomator/cryptomator/blob/develop/dist/linux/appimage/build.sh
installPhase = ''
2024-04-23 13:39:01 +00:00
runHook preInstall
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/
makeShellWrapper ${jdk}/bin/java $out/bin/${pname} \
--add-flags "--enable-preview" \
--add-flags "--enable-native-access=org.cryptomator.jfuse.linux.amd64,org.purejava.appindicator" \
--add-flags "--class-path '$out/share/cryptomator/libs/*'" \
--add-flags "--module-path '$out/share/cryptomator/mods'" \
--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'" \
--add-flags "-Dcryptomator.showTrayIcon=true" \
--add-flags "-Dcryptomator.buildNumber='nix-${src.rev}'" \
2022-04-02 11:28:22 +00:00
--add-flags "-Dcryptomator.appVersion='${version}'" \
--add-flags "-Djava.net.useSystemProxies=true" \
--add-flags "-Xss20m" \
--add-flags "-Xmx512m" \
--add-flags "-Dcryptomator.disableUpdateCheck=true" \
--add-flags "-Dcryptomator.integrationsLinux.trayIconsDir='$out/share/icons/hicolor/symbolic/apps'" \
--add-flags "--module org.cryptomator.desktop/org.cryptomator.launcher.Cryptomator" \
2024-11-19 22:43:36 +00:00
--prefix PATH : "$out/share/cryptomator/libs/:${
lib.makeBinPath [
jdk
glib
]
}" \
--prefix LD_LIBRARY_PATH : "${
lib.makeLibraryPath [
fuse3
libayatana-appindicator
]
}" \
--set JAVA_HOME "${jdk.home}"
# install desktop entry and icons
cp -r ${src}/dist/linux/appimage/resources/AppDir/usr/* $out/
2022-04-02 11:28:22 +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-04-23 13:39:01 +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-02 11:28:22 +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-04-23 13:39:01 +00:00
runHook postInstall
'';
nativeBuildInputs = [
autoPatchelfHook
jdk
makeShellWrapper
wrapGAppsHook3
];
2024-11-19 22:43:36 +00:00
buildInputs = [
fuse3
glib
jdk
2024-11-19 22:43:36 +00:00
libayatana-appindicator
];
meta = {
description = "Free client-side encryption for your cloud files";
homepage = "https://cryptomator.org";
license = lib.licenses.gpl3Plus;
mainProgram = "cryptomator";
maintainers = with lib.maintainers; [
bachp
2024-11-20 00:04:59 +00:00
gepbird
];
platforms = [ "x86_64-linux" ];
sourceProvenance = with lib.sourceTypes; [
fromSource
2024-11-19 22:43:36 +00:00
binaryBytecode # deps
];
};
}