You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

default.nix 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. { stdenv, lib, fetchurl, makeWrapper, jre_headless }:
  2. stdenv.mkDerivation rec {
  3. pname = "signal-cli";
  4. version = "0.6.3";
  5. # Building from source would be preferred, but is much more involved.
  6. src = fetchurl {
  7. url = "https://github.com/AsamK/signal-cli/releases/download/v${version}/signal-cli-${version}.tar.gz";
  8. sha256 = "1gvdifscyxmxn2dwlkqi684ahy5kbcj84mqda0m8l4aa8iaq1d59";
  9. };
  10. buildInputs = [ makeWrapper ];
  11. installPhase = ''
  12. mkdir -p $out/bin
  13. cp -r lib $out/lib
  14. cp bin/signal-cli $out/bin/signal-cli
  15. wrapProgram $out/bin/signal-cli \
  16. --prefix PATH : ${lib.makeBinPath [ jre_headless ]} \
  17. --set JAVA_HOME ${jre_headless}
  18. '';
  19. # Execution in the macOS (10.13) sandbox fails with
  20. # dyld: Library not loaded: /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
  21. # Referenced from: /nix/store/5ghc2l65p8jcjh0bsmhahd5m9k5p8kx0-zulu1.8.0_121-8.20.0.5/bin/java
  22. # Reason: no suitable image found. Did find:
  23. # /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa: file system sandbox blocked stat()
  24. # /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa: file system sandbox blocked stat()
  25. # /nix/store/in41dz8byyyz4c0w132l7mqi43liv4yr-stdenv-darwin/setup: line 1310: 2231 Abort trap: 6 signal-cli --version
  26. doInstallCheck = stdenv.isLinux;
  27. installCheckPhase = ''
  28. export PATH=$PATH:$out/bin
  29. # --help returns non-0 exit code even when working
  30. signal-cli --version
  31. '';
  32. meta = with lib; {
  33. homepage = https://github.com/AsamK/signal-cli;
  34. description = "Command-line and dbus interface for communicating with the Signal messaging service";
  35. license = licenses.gpl3;
  36. maintainers = with maintainers; [ ivan ];
  37. platforms = platforms.all;
  38. };
  39. }