signal-cli: 0.12.8 -> 0.13.2

Fixes #293753
This commit is contained in:
Pablo Ovelleiro Corral 2024-04-07 23:52:53 +02:00
parent b7ea13261a
commit b60a810408
No known key found for this signature in database
GPG key ID: 29E9A6ED72CCB334

View file

@ -1,13 +1,13 @@
{ stdenv, lib, fetchurl, makeWrapper, openjdk17_headless, libmatthew_java, dbus, dbus_java }:
{ stdenv, lib, fetchurl, makeWrapper, openjdk21_headless, libmatthew_java, dbus, dbus_java }:
stdenv.mkDerivation rec {
pname = "signal-cli";
version = "0.12.8";
version = "0.13.2";
# Building from source would be preferred, but is much more involved.
src = fetchurl {
url = "https://github.com/AsamK/signal-cli/releases/download/v${version}/signal-cli-${version}.tar.gz";
hash = "sha256-jBz1D1Uz3z+QYj+zAOrbSIkZZeKWSwU3/pHI+sDjJHw=";
hash = "sha256-5+pIkRdcFWTNmsSN2tHSy6XMQfUpGSddGsdw5guWzjA=";
};
buildInputs = lib.optionals stdenv.isLinux [ libmatthew_java dbus dbus_java ];
@ -18,15 +18,15 @@ stdenv.mkDerivation rec {
cp -r lib $out/lib
cp bin/signal-cli $out/bin/signal-cli
'' + (if stdenv.isLinux then ''
makeWrapper ${openjdk17_headless}/bin/java $out/bin/signal-cli \
--set JAVA_HOME "${openjdk17_headless}" \
makeWrapper ${openjdk21_headless}/bin/java $out/bin/signal-cli \
--set JAVA_HOME "${openjdk21_headless}" \
--add-flags "-classpath '$out/lib/*:${libmatthew_java}/lib/jni'" \
--add-flags "-Djava.library.path=${libmatthew_java}/lib/jni:${dbus_java}/share/java/dbus:$out/lib" \
--add-flags "org.asamk.signal.Main"
'' else ''
wrapProgram $out/bin/signal-cli \
--prefix PATH : ${lib.makeBinPath [ openjdk17_headless ]} \
--set JAVA_HOME ${openjdk17_headless}
--prefix PATH : ${lib.makeBinPath [ openjdk21_headless ]} \
--set JAVA_HOME ${openjdk21_headless}
'');
# Execution in the macOS (10.13) sandbox fails with