Merge pull request #72829 from erictapen/signal-cli-daemon
signal-cli: enable dbus functionality
This commit is contained in:
commit
505120a299
|
@ -1,4 +1,4 @@
|
||||||
{ stdenv, lib, fetchurl, makeWrapper, jre_headless }:
|
{ stdenv, lib, fetchurl, makeWrapper, jre_headless, libmatthew_java, dbus, dbus_java }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "signal-cli";
|
pname = "signal-cli";
|
||||||
|
@ -10,16 +10,24 @@ stdenv.mkDerivation rec {
|
||||||
sha256 = "1gvdifscyxmxn2dwlkqi684ahy5kbcj84mqda0m8l4aa8iaq1d59";
|
sha256 = "1gvdifscyxmxn2dwlkqi684ahy5kbcj84mqda0m8l4aa8iaq1d59";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ makeWrapper ];
|
buildInputs = lib.optional stdenv.isLinux [ libmatthew_java dbus dbus_java ];
|
||||||
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
cp -r lib $out/lib
|
cp -r lib $out/lib
|
||||||
cp bin/signal-cli $out/bin/signal-cli
|
cp bin/signal-cli $out/bin/signal-cli
|
||||||
|
'' + (if stdenv.isLinux then ''
|
||||||
|
makeWrapper ${jre_headless}/bin/java $out/bin/signal-cli \
|
||||||
|
--set JAVA_HOME "${jre_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 \
|
wrapProgram $out/bin/signal-cli \
|
||||||
--prefix PATH : ${lib.makeBinPath [ jre_headless ]} \
|
--prefix PATH : ${lib.makeBinPath [ jre_headless ]} \
|
||||||
--set JAVA_HOME ${jre_headless}
|
--set JAVA_HOME ${jre_headless}
|
||||||
'';
|
'');
|
||||||
|
|
||||||
# Execution in the macOS (10.13) sandbox fails with
|
# Execution in the macOS (10.13) sandbox fails with
|
||||||
# dyld: Library not loaded: /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
|
# dyld: Library not loaded: /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
|
||||||
|
@ -29,6 +37,7 @@ stdenv.mkDerivation rec {
|
||||||
# /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa: file system sandbox blocked stat()
|
# /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa: file system sandbox blocked stat()
|
||||||
# /nix/store/in41dz8byyyz4c0w132l7mqi43liv4yr-stdenv-darwin/setup: line 1310: 2231 Abort trap: 6 signal-cli --version
|
# /nix/store/in41dz8byyyz4c0w132l7mqi43liv4yr-stdenv-darwin/setup: line 1310: 2231 Abort trap: 6 signal-cli --version
|
||||||
doInstallCheck = stdenv.isLinux;
|
doInstallCheck = stdenv.isLinux;
|
||||||
|
|
||||||
installCheckPhase = ''
|
installCheckPhase = ''
|
||||||
export PATH=$PATH:$out/bin
|
export PATH=$PATH:$out/bin
|
||||||
# --help returns non-0 exit code even when working
|
# --help returns non-0 exit code even when working
|
||||||
|
@ -39,7 +48,7 @@ stdenv.mkDerivation rec {
|
||||||
homepage = https://github.com/AsamK/signal-cli;
|
homepage = https://github.com/AsamK/signal-cli;
|
||||||
description = "Command-line and dbus interface for communicating with the Signal messaging service";
|
description = "Command-line and dbus interface for communicating with the Signal messaging service";
|
||||||
license = licenses.gpl3;
|
license = licenses.gpl3;
|
||||||
maintainers = with maintainers; [ ivan ];
|
maintainers = with maintainers; [ ivan erictapen ];
|
||||||
platforms = platforms.all;
|
platforms = platforms.all;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue