git: 3f895cf5a812 - main - x11/iaito: New port: Official QT frontend of radare2

From: Vladimir Druzenko <vvd_at_FreeBSD.org>
Date: Sat, 10 Aug 2024 15:05:39 UTC
The branch main has been updated by vvd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3f895cf5a8128a5c3ca852c9daf1cbaf5cf73f34

commit 3f895cf5a8128a5c3ca852c9daf1cbaf5cf73f34
Author:     Martin Filla <freebsd@sysctl.cz>
AuthorDate: 2024-08-10 14:24:20 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2024-08-10 15:05:16 +0000

    x11/iaito: New port: Official QT frontend of radare2
    
    iaito is the official graphical interface for radare2, a libre reverse
    engineering framework.
     * Requires radare2 and Qt-5/6.
     * Iaito was the original name of this GUI before being forked as Cutter.
     * Use r2 plugins (f.ex: no need for r2ghidra-iaito plugin if r2ghidra is
       installed).
     * Focus on simplicity, parity with commands, keybindings and r2-style
       workflows.
     * Aims to cover other radare2 features, not just a disassembler:
       forensics, networking, bindiffing, solvers, ...
    https://github.com/radareorg/iaito
    
    PR:     278339
---
 devel/Makefile                               |  1 +
 devel/iaito/Makefile                         | 39 ++++++++++++++++++++++++++++
 devel/iaito/distinfo                         |  3 +++
 devel/iaito/files/patch-Makefile             | 11 ++++++++
 devel/iaito/files/patch-src_lib__radare2.pri | 13 ++++++++++
 devel/iaito/pkg-descr                        | 10 +++++++
 6 files changed, 77 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index 957773771584..7641d67b405b 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -987,6 +987,7 @@
     SUBDIR += hyprlang
     SUBDIR += hyprutils
     SUBDIR += hyprwayland-scanner
+    SUBDIR += iaito
     SUBDIR += ice
     SUBDIR += ice37
     SUBDIR += icestorm
diff --git a/devel/iaito/Makefile b/devel/iaito/Makefile
new file mode 100644
index 000000000000..eef31254152c
--- /dev/null
+++ b/devel/iaito/Makefile
@@ -0,0 +1,39 @@
+PORTNAME=	iaito
+DISTVERSION=	5.9.2
+CATEGORIES=	devel
+
+MAINTAINER=	freebsd@sysctl.cz
+COMMENT=	Official QT frontend of radare2, a libre reverse engineering framework
+WWW=		https://github.com/radareorg/iaito
+
+LICENSE=	GPLv3
+
+LIB_DEPENDS=	libcapstone.so:devel/capstone \
+		libr_core.so:devel/radare2
+
+USES=		desktop-file-utils gl gmake pkgconfig qmake:no_configure qt:5
+USE_GITHUB=	yes
+GH_ACCOUNT=	radareorg
+USE_GL=		gl
+USE_QT=		buildtools core gui linguisttools:build network svg widgets
+GNU_CONFIGURE=	yes
+MAKE_ENV=	DESTDIR=${STAGEDIR}${PREFIX} \
+		QMAKE_FLAGS="PREFIX=${STAGEDIR}${PREFIX}"
+
+PLIST_FILES=	bin/iaito \
+		share/applications/org.radare.iaito.desktop \
+		share/icons/hicolor/scalable/apps/org.radare.iaito.svg \
+		share/metainfo/org.radare.iaito.appdata.xml
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/build/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
+	${INSTALL_DATA} ${WRKSRC}/src/org.radare.iaito.desktop \
+			${STAGEDIR}${DESKTOPDIR}
+	${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/scalable/apps
+	${INSTALL_DATA} ${WRKSRC}/src/img/org.radare.iaito.svg \
+			${STAGEDIR}${PREFIX}/share/icons/hicolor/scalable/apps
+	${MKDIR} ${STAGEDIR}${PREFIX}/share/metainfo
+	${INSTALL_DATA} ${WRKSRC}/src/org.radare.iaito.appdata.xml \
+			${STAGEDIR}${PREFIX}/share/metainfo
+
+.include <bsd.port.mk>
diff --git a/devel/iaito/distinfo b/devel/iaito/distinfo
new file mode 100644
index 000000000000..fa034e4526f5
--- /dev/null
+++ b/devel/iaito/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1722457123
+SHA256 (radareorg-iaito-5.9.2_GH0.tar.gz) = fdaf0e29cb41219224c44f770c838147f8dd5c2fc407a933745772bc86056337
+SIZE (radareorg-iaito-5.9.2_GH0.tar.gz) = 3105697
diff --git a/devel/iaito/files/patch-Makefile b/devel/iaito/files/patch-Makefile
new file mode 100644
index 000000000000..ea8edf634450
--- /dev/null
+++ b/devel/iaito/files/patch-Makefile
@@ -0,0 +1,11 @@
+--- Makefile.orig	2024-05-24 00:09:14 UTC
++++ Makefile
+@@ -19,7 +19,7 @@ endif
+ ifeq ($(WANT_PYTHON_BINDINGS),1)
+ QMAKE_FLAGS+=IAITO_ENABLE_PYTHON_BINDINGS=true
+ endif
+-QMAKE_FLAGS+=PREFIX=$(PREFIX)
++#QMAKE_FLAGS+=PREFIX=$(PREFIX)
+ 
+ all: iaito
+ 
diff --git a/devel/iaito/files/patch-src_lib__radare2.pri b/devel/iaito/files/patch-src_lib__radare2.pri
new file mode 100644
index 000000000000..b13f716240bf
--- /dev/null
+++ b/devel/iaito/files/patch-src_lib__radare2.pri
@@ -0,0 +1,13 @@
+--- src/lib_radare2.pri.orig	2024-05-24 00:09:14 UTC
++++ src/lib_radare2.pri
+@@ -78,8 +78,8 @@ win32 {
+     equals(USE_PKGCONFIG, 1) {
+         CONFIG += link_pkgconfig
+        # PKGCONFIG += r_core
+-        R2_INCLUDEPATH = "$$system("bash -c 'pkg-config --variable=includedir r_core'")/libr"
+-        R2_INCLUDEPATH += "$$system("bash -c 'pkg-config --variable=includedir r_core'")/libr/sdb"
++        R2_INCLUDEPATH = "$$system("sh -c 'pkg-config --variable=includedir r_core'")/libr"
++        R2_INCLUDEPATH += "$$system("sh -c 'pkg-config --variable=includedir r_core'")/libr/sdb"
+         INCLUDEPATH += $$R2_INCLUDEPATH
+         LIBS += $$system("pkg-config --libs r_core")
+     } else {
diff --git a/devel/iaito/pkg-descr b/devel/iaito/pkg-descr
new file mode 100644
index 000000000000..efd7acf63e96
--- /dev/null
+++ b/devel/iaito/pkg-descr
@@ -0,0 +1,10 @@
+iaito is the official graphical interface for radare2, a libre reverse
+engineering framework.
+ * Requires radare2 and Qt-5/6.
+ * Iaito was the original name of this GUI before being forked as Cutter.
+ * Use r2 plugins (f.ex: no need for r2ghidra-iaito plugin if r2ghidra is
+   installed).
+ * Focus on simplicity, parity with commands, keybindings and r2-style
+   workflows.
+ * Aims to cover other radare2 features, not just a disassembler:
+   forensics, networking, bindiffing, solvers, ...