summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/telegram-cli/default.nix
blob: 812f00829e27cdc0965f3de547c00d0f111650f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ stdenv, fetchgit, libconfig, lua5_2, openssl, readline, zlib
}:

stdenv.mkDerivation rec {
  name = "telegram-cli";

  src = fetchgit {
    url = "https://github.com/vysheng/tg.git";
    rev = "ac6079a00ac66bb37a3179a82af130b41ec39bc9";
    sha256 = "1rpwnyzmqk7p97n5pd00m5c6rypc39mb3hs94qxxrdcpwpgcb73q";
  };

  buildInputs = [ libconfig lua5_2 openssl readline zlib ];

  NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations"; # CPPFunction

  installPhase = ''
    mkdir -p $out/bin
    cp ./telegram $out/bin/telegram-wo-key
    cp ./tg.pub $out/
    cat > $out/bin/telegram <<EOF
    #!/usr/bin/env bash
    $out/bin/telegram-wo-key -k $out/tg.pub
    EOF
    chmod +x $out/bin/telegram
  '';

  meta = {
    description = "Command-line interface for Telegram messenger";
    homepage = https://telegram.org/;
    license = stdenv.lib.licenses.gpl2;
    platforms = stdenv.lib.platforms.linux;
  };
}