aboutsummaryrefslogblamecommitdiff
path: root/pkgs/telegram-cli/default.nix
blob: 4b82b352d8f94d874e0e08eb0fdd4ea4ba189ac4 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16















                                                                                                 
{ stdenv, fetchedGithub, pkgconfig, libevent, lua, jansson, openssl, readline, zlib, libconfig }:
stdenv.mkDerivation (fetchedGithub ./telegram-cli.json // {
  patches = [
    ./telegram-cli.patch
    ];
  buildInputs = [ pkgconfig libevent lua jansson openssl readline zlib libconfig ];
  preBuild = ''
    sed -i -e 's@"/etc/" PROG_NAME "/server.pub"@"'$out'/etc/server.pub"@' main.c
    '';
  installPhase = ''
    mkdir -p $out
    install -Dm755 bin/telegram-cli $out/bin/telegram-cli
    install -Dm644 tg-server.pub $out/etc/server.pub
    install -Dm644 debian/telegram-cli.8 $out/man/man8/telegram-cli.8
    '';
})