From da0c791c4555b2c647cd226a5d5b71d5833e126a Mon Sep 17 00:00:00 2001 From: Ivan Kozik Date: Mon, 21 Jan 2019 03:15:18 +0000 Subject: [PATCH] signal-cli: init at 0.6.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit is based on work by Christopher Fredén in https://github.com/icetan/dot-nixpkgs/blob/8867ed07f78d7632ffefa1a3aceb8136a8c46a03/overlays/pkgs/signal-cli.nix --- .../instant-messengers/signal-cli/default.nix | 45 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 47 insertions(+) create mode 100644 pkgs/applications/networking/instant-messengers/signal-cli/default.nix diff --git a/pkgs/applications/networking/instant-messengers/signal-cli/default.nix b/pkgs/applications/networking/instant-messengers/signal-cli/default.nix new file mode 100644 index 000000000000..3336c05aae74 --- /dev/null +++ b/pkgs/applications/networking/instant-messengers/signal-cli/default.nix @@ -0,0 +1,45 @@ +{ stdenv, lib, fetchurl, makeWrapper, jre_headless }: + +stdenv.mkDerivation rec { + name = "signal-cli-${version}"; + version = "0.6.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"; + sha256 = "050nizf7v10jlrwr8f4awzi2368qr01pzpvl2qkrwhdk25r505yr"; + }; + + buildInputs = [ makeWrapper ]; + + installPhase = '' + mkdir -p $out/bin + cp -r lib $out/lib + cp bin/signal-cli $out/bin/signal-cli + wrapProgram $out/bin/signal-cli \ + --prefix PATH : ${lib.makeBinPath [ jre_headless ]} \ + --set JAVA_HOME ${jre_headless} + ''; + + # Execution in the macOS (10.13) sandbox fails with + # dyld: Library not loaded: /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa + # Referenced from: /nix/store/5ghc2l65p8jcjh0bsmhahd5m9k5p8kx0-zulu1.8.0_121-8.20.0.5/bin/java + # Reason: no suitable image found. Did find: + # /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 + doInstallCheck = stdenv.isLinux; + installCheckPhase = '' + export PATH=$PATH:$out/bin + # --help returns non-0 exit code even when working + signal-cli --version + ''; + + meta = with lib; { + homepage = https://github.com/AsamK/signal-cli; + description = "Command-line and dbus interface for communicating with the Signal messaging service"; + license = licenses.gpl3; + maintainers = with maintainers; [ ivan ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 86670b314507..4a2486efb82d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5449,6 +5449,8 @@ in sigil = libsForQt5.callPackage ../applications/editors/sigil { }; + signal-cli = callPackage ../applications/networking/instant-messengers/signal-cli { }; + signal-desktop = callPackage ../applications/networking/instant-messengers/signal-desktop { }; slither-analyzer = with python3Packages; toPythonApplication slither-analyzer;