Merge pull request #184625 from azahi/iaito

This commit is contained in:
Sandro 2022-08-02 23:21:24 +02:00 committed by GitHub
commit 1940dfe791
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 80 additions and 17 deletions

View file

@ -1,44 +1,52 @@
{ lib
, stdenv
, fetchFromGitHub
, meson
, ninja
, pkg-config
, python3
, qtbase
, qttools
, radare2
, wrapQtAppsHook
, zip
, nix-update-script
}:
# TODO MacOS support.
# TODO Build and install translations.
stdenv.mkDerivation rec {
pname = "iaito";
version = "5.7.0";
version = "5.7.2";
src = fetchFromGitHub {
owner = "radareorg";
repo = pname;
rev = version;
fetchSubmodules = true;
sha256 = "sha256-qEJTsS669eEwo2iiuybN72O5oopCaGEkju8+ekjw2zk=";
sha256 = "sha256-5/G5wfdc6aua90XLP3B7Ruy8F3NTXzWfQE6yVDZ0rX8=";
};
nativeBuildInputs = [ pkg-config qttools wrapQtAppsHook zip ];
nativeBuildInputs = [ meson ninja pkg-config python3 qttools wrapQtAppsHook ];
buildInputs = [ radare2 qtbase ];
postPatch = ''
substituteInPlace Makefile \
--replace "git submodule update --init" ""
postUnpack = ''
sourceRoot=$sourceRoot/src
'';
NIX_CFLAGS_COMPILE = [ "-I${radare2}/include/libr" "-I${radare2}/include/libr/sdb" ];
# 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 -Dm755 build/iaito $out/bin/iaito
install -Dm644 $src/src/org.radare.iaito.appdata.xml $out/share/metainfo/org.radare.iaito.appdata.xml
install -Dm644 $src/src/org.radare.iaito.desktop $out/share/applications/org.radare.iaito.desktop
install -Dm644 $src/src/img/iaito-o.svg $out/share/pixmaps/iaito-o.svg
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
'';
@ -48,14 +56,15 @@ stdenv.mkDerivation rec {
};
meta = with lib; {
description = "Official frontend of radare2";
description = "An official graphical interface of radare2";
longDescription = ''
The official graphical interface for radare2, a libre reverse engineering
framework.
iaito is the official graphical interface of radare2. It's the
continuation of Cutter for radare2 after the Rizin fork.
'';
homepage = "https://github.com/radareorg/iaito";
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;
};
}

View file

@ -0,0 +1,54 @@
diff --git i/IaitoApplication.cpp w/IaitoApplication.cpp
index 25b6a4e7..4cbde5c4 100644
--- i/IaitoApplication.cpp
+++ w/IaitoApplication.cpp
@@ -33,27 +33,6 @@
#include <R2GhidraDecompiler.h>
#endif
-static bool versionCheck() {
- // Check r2 version
- QString a = r_core_version (); // runtime library version
- QString b = "" R2_GITTAP; // compiled version
- QStringList la = a.split(".");
- QStringList lb = b.split(".");
- if (la.size() < 2 && lb.size() < 2) {
- eprintf ("Invalid version string somwhere\n");
- return false;
- }
- if (la.at(0) != lb.at(0)) {
- eprintf ("Major version differs\n");
- return false;
- }
- if (la.at(1) != lb.at(1)) {
- eprintf ("Minor version differs\n");
- return false;
- }
- return true;
-}
-
IaitoApplication::IaitoApplication(int &argc, char **argv) : QApplication(argc, argv)
{
// Setup application information
@@ -101,21 +80,6 @@ IaitoApplication::IaitoApplication(int &argc, char **argv) : QApplication(argc,
std::exit(1);
}
- if (!versionCheck ()) {
- QMessageBox msg;
- msg.setIcon(QMessageBox::Critical);
- msg.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
- msg.setWindowTitle(QObject::tr("Version mismatch!"));
- QString localVersion = r_core_version ();
- QString r2version = R2_GITTAP;
- msg.setText(QString(
- QObject::tr("The version used to compile Iaito (%1) does not match the binary version of radare2 (%2). This could result in unexpected behaviour. Are you sure you want to continue?")).arg(
- localVersion, r2version));
- if (msg.exec() == QMessageBox::No) {
- std::exit(1);
- }
- }
-
#ifdef IAITO_ENABLE_PYTHON
// Init python
if (!clOptions.pythonHome.isEmpty()) {