summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/vk-cli/default.nix
blob: e1b3cc4f775301f57ae6bce37a0ee64bb56a53e6 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{ stdenv
, lib
, fetchurl
, curl
, zulip
, p7zip
, glibc
, ncurses
, openssl
}:

stdenv.mkDerivation rec {
  pname = "vk-cli";
  version = "0.7.6";

  src = fetchurl {
    url = "https://github.com/vk-cli/vk/releases/download/${version}/vk-${version}-64-bin.7z";
    sha256 = "sha256-Y40oLjddunrd7ZF1JbCcgjSCn8jFTubq69jhAVxInXw=";
  };

  nativeBuildInputs = [
    p7zip
  ];

  buildInputs = [
    curl
    ncurses
    openssl
  ];

  unpackPhase = ''
    mkdir -p $TMP/
    7z x $src -o$TMP/
  '';

  installPhase = ''
    mkdir -p $out/bin/
    mv $TMP/vk-${version}-64-bin vk-cli
    install -D vk-cli --target-directory=$out/bin/
  '';

  postFixup = ''
    patchelf $out/bin/vk-cli \
      --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
      --set-rpath "${lib.makeLibraryPath [ curl zulip glibc ]}"
  '';

  meta = with lib; {
    description = "A console (ncurses) client for vk.com written in D";
    homepage = "https://github.com/vk-cli/vk";
    license = licenses.asl20;
    maintainers = with maintainers; [ dan4ik605743 ];
    platforms = [ "x86_64-linux" ];
  };
}