summary refs log tree commit diff
path: root/pkgs/applications/version-management/git-and-tools/radicle-cli/default.nix
blob: a8df056774a2a265bc59461e51b4e058d51dee78 (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
56
57
58
59
60
61
62
63
64
65
66
{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, pkg-config
, cmake
, installShellFiles
, asciidoctor
, DarwinTools
, openssl
, libusb1
, AppKit
, openssh
}:

rustPlatform.buildRustPackage rec {
  pname = "radicle-cli";
  version = "0.6.1";

  src = fetchFromGitHub {
    owner = "radicle-dev";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-LS6zYpMg0LanRL2M8ioGG8Ys07TPT/3hP7geEGehwxg=";
  };

  cargoSha256 = "sha256-o7ahnV7NnvzKxXb7HdNqKcxekshOtKanYKb0Sy15mhs=";

  nativeBuildInputs = [
    pkg-config
    cmake
    installShellFiles
    asciidoctor
  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
    DarwinTools
  ];

  buildInputs = [
    openssl
  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
    libusb1
    AppKit
  ];

  postInstall = ''
    for f in $(find . -name '*.adoc'); do
      mf=''${f%.*}
      asciidoctor --doctype manpage --backend manpage $f -o $mf
      installManPage $mf
    done
  '';

  checkInputs = [ openssh ];
  preCheck = ''
    eval $(ssh-agent)
  '';

  meta = {
    description = "Command-line tooling for Radicle, a decentralized code collaboration network";
    homepage = "https://radicle.xyz";
    license = lib.licenses.gpl3Plus;
    maintainers = with lib.maintainers; [ amesgen ];
    platforms = lib.platforms.unix;
    mainProgram = "rad";
  };
}