summaryrefslogtreecommitdiff
path: root/nix/notmuch-tcp.nix
blob: 1a1947b3c3c9bb61f9a0e295b3a6d7b9a09d3638 (plain)
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
{ stdenv
, python38
}:

stdenv.mkDerivation rec {
  pname = "notmuch-tcp";
  version = "1.0";
  src = [../notmuch-tcp-client ../notmuch-tcp-server];

  phases = [ "unpackPhase" "buildPhase" "installPhase" ];

  python = python38;

  unpackPhase = ''
    for srcFile in $src; do
      cp $srcFile $(stripHash $srcFile)
    done
  '';

  buildPhase = ''
    substituteAllInPlace notmuch-tcp-client
    substituteAllInPlace notmuch-tcp-server
  '';

  installPhase = ''
    install -m 0755 -D -t $out/bin \
      notmuch-tcp-client notmuch-tcp-server
    ln -s notmuch-tcp-client $out/bin/notmuch-tcp
  '';
}