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