2024-03-05 00:49:19 +01:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
|
|
|
, zlib
|
|
|
|
, libXext
|
|
|
|
, libX11
|
|
|
|
, libXrender
|
|
|
|
, libXtst
|
|
|
|
, libXi
|
|
|
|
, freetype
|
|
|
|
, alsa-lib
|
|
|
|
, jdk21
|
|
|
|
, openjfx21
|
|
|
|
, autoPatchelfHook
|
|
|
|
, makeBinaryWrapper
|
2024-04-26 22:24:03 +02:00
|
|
|
, wrapGAppsHook3
|
2024-03-05 00:49:19 +01:00
|
|
|
}:
|
2024-03-05 00:48:38 +01:00
|
|
|
|
2024-03-05 00:49:19 +01:00
|
|
|
let
|
|
|
|
repo = "olvid";
|
|
|
|
|
|
|
|
javafxModules = [ "swing" "controls" "media" "fxml" "graphics" "base" ];
|
|
|
|
|
|
|
|
classpath =
|
|
|
|
lib.concatMap (mod: [
|
|
|
|
"${openjfx21}/modules_src/javafx.${mod}/module-info.java"
|
|
|
|
"${openjfx21}/modules/javafx.${mod}"
|
|
|
|
"${openjfx21}/modules_libs/javafx.${mod}"
|
|
|
|
]) javafxModules ++
|
|
|
|
[ "$out/share/${repo}/*" ];
|
|
|
|
|
|
|
|
jvmArgs = [
|
|
|
|
"-cp" (lib.concatStringsSep ":" classpath)
|
|
|
|
"-Djpackage.app-version=$version"
|
|
|
|
"-Dolvid.sqlcipher=true"
|
|
|
|
"-Dolvid.dev=false"
|
|
|
|
"-Dolvid.packaged=true"
|
|
|
|
"-Dolvid.multiuser=false"
|
|
|
|
"-Dolvid.debug=false"
|
|
|
|
"-Dolvid.version=$version"
|
|
|
|
"-Djava.net.useSystemProxies=true"
|
|
|
|
"-Djava.library.path=$out/lib/"
|
|
|
|
"-Xss8M"
|
|
|
|
"-XX:+ShowCodeDetailsInExceptionMessages"
|
|
|
|
"--add-opens=java.desktop/java.awt=ALL-UNNAMED"
|
|
|
|
"--add-opens=java.desktop/java.awt.geom=ALL-UNNAMED"
|
|
|
|
"--add-opens=java.desktop/sun.awt.geom=ALL-UNNAMED"
|
|
|
|
"--add-opens=java.base/java.util=ALL-UNNAMED"
|
|
|
|
"--add-opens=java.desktop/javax.swing=ALL-UNNAMED"
|
|
|
|
"--add-opens=java.desktop/sun.awt.shell=ALL-UNNAMED"
|
|
|
|
];
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2024-03-05 00:48:38 +01:00
|
|
|
pname = "olvid";
|
2024-04-26 19:10:10 +02:00
|
|
|
version = "1.5.2";
|
2024-03-05 00:48:38 +01:00
|
|
|
|
2024-03-05 00:49:19 +01:00
|
|
|
dontUnpack = true;
|
|
|
|
dontWrapGApps = true;
|
|
|
|
|
2024-03-05 00:48:38 +01:00
|
|
|
src = fetchurl {
|
2024-03-05 00:49:19 +01:00
|
|
|
url = "https://static.olvid.io/linux/${repo}-${finalAttrs.version}.tar.gz";
|
2024-04-26 19:10:10 +02:00
|
|
|
hash = "sha256-WjIOk3dPSXQdAR2fdXseV0NdOjld0PzyqnUx/VbvQio=";
|
2024-03-05 00:48:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoPatchelfHook
|
2024-03-05 00:49:19 +01:00
|
|
|
makeBinaryWrapper
|
2024-04-26 22:24:03 +02:00
|
|
|
wrapGAppsHook3
|
2024-03-05 00:48:38 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
zlib
|
2024-03-05 00:49:19 +01:00
|
|
|
libXext
|
|
|
|
libX11
|
|
|
|
libXrender
|
|
|
|
libXtst
|
|
|
|
libXi
|
|
|
|
freetype
|
|
|
|
alsa-lib
|
2024-03-05 00:48:38 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2024-03-05 00:49:19 +01:00
|
|
|
|
|
|
|
install -dm755 "$out/share/${repo}"
|
|
|
|
tar -xf "$src" -C "$out/share/${repo}" --wildcards --strip-components 3 olvid/lib/app/'*.jar'
|
|
|
|
|
|
|
|
install -dm755 "$out/lib"
|
|
|
|
tar -xf "$src" -C "$out/lib" --strip-components 4 olvid/lib/runtime/lib/
|
|
|
|
|
|
|
|
install -dm755 "$out/bin"
|
|
|
|
makeBinaryWrapper ${jdk21}/bin/java $out/bin/${repo} \
|
|
|
|
"''${gappsWrapperArgs[@]}" \
|
|
|
|
--add-flags "${lib.concatStringsSep " " jvmArgs} io.olvid.windows.messenger.start_up.Launcher"
|
|
|
|
|
2024-03-05 00:48:38 +01:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-03-05 00:49:19 +01:00
|
|
|
description = "The secure french messenger";
|
2024-03-05 00:48:38 +01:00
|
|
|
homepage = "https://www.olvid.io";
|
2024-03-19 13:26:06 +01:00
|
|
|
license = licenses.agpl3Only;
|
2024-03-05 00:49:19 +01:00
|
|
|
mainProgram = "olvid";
|
|
|
|
maintainers = with maintainers; [ rookeur ];
|
2024-03-05 00:48:38 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
2024-03-05 00:49:19 +01:00
|
|
|
})
|