summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/telegram/telegram-cli/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-08-04 10:54:22 +0000
committerAlyssa Ross <hi@alyssa.is>2021-08-04 10:54:22 +0000
commitd2e147bedf251976ed99b94b6c905d6761f7a892 (patch)
tree9e0c62d61698916fd4627ed98d3d880c8fc0ab2e /pkgs/applications/networking/instant-messengers/telegram/telegram-cli/default.nix
parent62614cbef7da005c1eda8c9400160f6bcd6546b8 (diff)
parentc464dc811babfe316ed4ab7bbc12351122e69dd7 (diff)
downloadnixpkgs-d2e147bedf251976ed99b94b6c905d6761f7a892.tar
nixpkgs-d2e147bedf251976ed99b94b6c905d6761f7a892.tar.gz
nixpkgs-d2e147bedf251976ed99b94b6c905d6761f7a892.tar.bz2
nixpkgs-d2e147bedf251976ed99b94b6c905d6761f7a892.tar.lz
nixpkgs-d2e147bedf251976ed99b94b6c905d6761f7a892.tar.xz
nixpkgs-d2e147bedf251976ed99b94b6c905d6761f7a892.tar.zst
nixpkgs-d2e147bedf251976ed99b94b6c905d6761f7a892.zip
Merge remote-tracking branch 'nixpkgs/nixos-unstable' into master
Diffstat (limited to 'pkgs/applications/networking/instant-messengers/telegram/telegram-cli/default.nix')
-rw-r--r--pkgs/applications/networking/instant-messengers/telegram/telegram-cli/default.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/pkgs/applications/networking/instant-messengers/telegram/telegram-cli/default.nix b/pkgs/applications/networking/instant-messengers/telegram/telegram-cli/default.nix
new file mode 100644
index 00000000000..bff3d3769a7
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/telegram/telegram-cli/default.nix
@@ -0,0 +1,49 @@
+{ stdenv, fetchFromGitHub, jansson, lib, libconfig, libevent, libgcrypt, lua, lua53Packages
+, makeWrapper, openssl, pkg-config, python3, readline, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "telegram-cli";
+  version = "20200106";
+
+  src = fetchFromGitHub {
+    owner = "kenorb-contrib";
+    repo = "tg";
+    rev = "refs/tags/${version}";
+    sha256 = "sha256-wYBPr2b8IOycO9y/CNyGjnRsyGyYl3oiXYtTzwTurVA=";
+    fetchSubmodules = true;
+  };
+
+  buildInputs = [
+    jansson
+    libconfig
+    libevent
+    libgcrypt
+    lua
+    lua53Packages.lgi
+    openssl
+    python3
+    readline
+    zlib
+  ];
+  nativeBuildInputs = [
+    pkg-config
+    makeWrapper
+  ];
+
+  installPhase = ''
+    runHook preInstall
+    install -Dm755 ./bin/telegram-cli $out/bin/telegram-cli-keyless
+    install -Dm644 ./tg-server.pub -t $out/share/telegram-cli
+    makeWrapper $out/bin/telegram-cli-keyless $out/bin/telegram-cli \
+      --add-flags "-k $out/share/telegram-cli/tg-server.pub"
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Command-line interface for Telegram, that uses readline interface, it's a client implementation of TGL library";
+    downloadPage = "https://github.com/kenorb-contrib/tg";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ superherointj ];
+  };
+}