summaryrefslogtreecommitdiff
path: root/pkgs/telegram-cli/default.nix
blob: 6987748d9cad2cc6f22ec10472cdd2ad0ce3fa0c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{ stdenv, mylibs, pkgconfig, libevent, lua, jansson, openssl, readline, zlib, libconfig }:
stdenv.mkDerivation (mylibs.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
    '';
})