1{ lib
2, stdenv
3, fetchFromGitHub
4, meson
5, ninja
6, pkg-config
7, python3
8, qtbase
9, qttools
10, radare2
11, wrapQtAppsHook
12}:
13
14stdenv.mkDerivation rec {
15 pname = "iaito";
16 version = "5.8.6";
17
18 srcs = [
19 (fetchFromGitHub rec {
20 owner = "radareorg";
21 repo = "iaito";
22 rev = version;
23 hash = "sha256-rl8bOIR0oS6YvZA5pr8oSj7HcKK4YeCjAEi7saVdvk8=";
24 name = repo;
25 })
26 (fetchFromGitHub rec {
27 owner = "radareorg";
28 repo = "iaito-translations";
29 rev = "e66b3a962a7fc7dfd730764180011ecffbb206bf";
30 hash = "sha256-6NRTZ/ydypsB5TwbivvwOH9TEMAff/LH69hCXTvMPp8=";
31 name = repo;
32 })
33 ];
34 sourceRoot = "iaito/src";
35
36 postUnpack = ''
37 chmod -R u+w iaito-translations
38 '';
39
40 postPatch = ''
41 substituteInPlace common/ResourcePaths.cpp \
42 --replace "/app/share/iaito/translations" "$out/share/iaito/translations"
43 '';
44
45 nativeBuildInputs = [
46 meson
47 ninja
48 pkg-config
49 python3
50 qttools
51 wrapQtAppsHook
52 ];
53
54 buildInputs = [
55 qtbase
56 radare2
57 ];
58
59 # the radare2 binary package seems to not install all necessary headers.
60 env.NIX_CFLAGS_COMPILE = toString [ "-I" "${radare2.src}/shlr/sdb/include/sdb" ];
61
62 postBuild = ''
63 pushd ../../../iaito-translations
64 make build -j$NIX_BUILD_CORES PREFIX=$out
65 popd
66 '';
67
68 installPhase = ''
69 runHook preInstall
70
71 install -m755 -Dt $out/bin iaito
72 install -m644 -Dt $out/share/metainfo ../org.radare.iaito.appdata.xml
73 install -m644 -Dt $out/share/applications ../org.radare.iaito.desktop
74 install -m644 -Dt $out/share/pixmaps ../img/iaito-o.svg
75
76 pushd ../../../iaito-translations
77 make install -j$NIX_BUILD_CORES PREFIX=$out
78 popd
79
80 runHook postInstall
81 '';
82
83 meta = with lib; {
84 description = "An official graphical interface of radare2";
85 longDescription = ''
86 iaito is the official graphical interface of radare2. It's the
87 continuation of Cutter for radare2 after the Rizin fork.
88 '';
89 homepage = "https://radare.org/n/iaito.html";
90 changelog = "https://github.com/radareorg/iaito/releases/tag/${version}";
91 license = licenses.gpl3Plus;
92 maintainers = with maintainers; [ azahi ];
93 platforms = platforms.linux;
94 };
95}