summary refs log tree commit diff
path: root/pkgs/tools/security/iaito/default.nix
blob: d8bfc9e4747c58d4d8f181dd79f78e959e7c9207 (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
67
68
69
70
{ lib
, stdenv
, fetchFromGitHub
, meson
, ninja
, pkg-config
, python3
, qtbase
, qttools
, radare2
, wrapQtAppsHook
, nix-update-script
}:

# TODO MacOS support.
# TODO Build and install translations.

stdenv.mkDerivation rec {
  pname = "iaito";
  version = "5.7.2";

  src = fetchFromGitHub {
    owner = "radareorg";
    repo = pname;
    rev = version;
    sha256 = "sha256-5/G5wfdc6aua90XLP3B7Ruy8F3NTXzWfQE6yVDZ0rX8=";
  };

  nativeBuildInputs = [ meson ninja pkg-config python3 qttools wrapQtAppsHook ];

  buildInputs = [ radare2 qtbase ];

  postUnpack = ''
    sourceRoot=$sourceRoot/src
  '';

  # TODO Fix version checking and version information for r2.
  # Version checking always fails due to values being empty strings for some
  # reason. Meanwhile, we can safely assume that radare2's runtime and
  # compile-time implementations are the same and remove this check.
  patches = [ ./remove-broken-version-check.patch ];

  installPhase = ''
    runHook preInstall

    install -m755 -Dt $out/bin iaito
    install -m644 -Dt $out/share/metainfo $src/src/org.radare.iaito.appdata.xml
    install -m644 -Dt $out/share/applications $src/src/org.radare.iaito.desktop
    install -m644 -Dt $out/share/pixmaps $src/src/img/iaito-o.svg

    runHook postInstall
  '';

  passthru.updateScript = nix-update-script {
    attrPath = pname;
  };

  meta = with lib; {
    description = "An official graphical interface of radare2";
    longDescription = ''
      iaito is the official graphical interface of radare2. It's the
      continuation of Cutter for radare2 after the Rizin fork.
    '';
    homepage = "https://radare.org/n/iaito.html";
    changelog = "https://github.com/radareorg/iaito/releases/tag/${src.rev}";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ azahi ];
    platforms = platforms.linux;
  };
}