depot/third_party/nixpkgs/pkgs/applications/misc/scli/default.nix
Default email ce641f4048 Project import generated by Copybara.
GitOrigin-RevId: bc5d68306b40b8522ffb69ba6cff91898c2fbbff
2021-12-06 17:07:01 +01:00

52 lines
1.1 KiB
Nix

{ lib
, python3
, fetchFromGitHub
, dbus
, signal-cli
, xclip
}:
python3.pkgs.buildPythonApplication rec {
pname = "scli";
version = "0.6.5";
src = fetchFromGitHub {
owner = "isamert";
repo = pname;
rev = "v${version}";
sha256 = "1lykxkqscvpzb7bvl8kfaf23mjhr2kaaqdg0756xx4z1m0smpkgy";
};
propagatedBuildInputs = with python3.pkgs; [
pyqrcode
urwid
urwid-readline
];
dontBuild = true;
checkPhase = ''
# scli attempts to write to these directories, make sure they're writeable
export XDG_DATA_HOME=$(mktemp -d)
export XDG_CONFIG_HOME=$(mktemp -d)
./scli --help > /dev/null # don't spam nix-build log
test $? == 0
'';
installPhase = ''
mkdir -p $out/bin
patchShebangs scli
install -m755 -D scli $out/bin/scli
'';
makeWrapperArgs = [
"--prefix" "PATH" ":" (lib.makeBinPath [ dbus signal-cli xclip ])
];
meta = with lib; {
description = "Simple terminal user interface for Signal";
homepage = "https://github.com/isamert/scli";
license = licenses.gpl3Only;
maintainers = with maintainers; [ alex-eyre ];
};
}