Bug 278339

Summary: [NEW PORT] x11/iaito: Official QT frontend of radare2
Product: Ports & Packages Reporter: Martin Filla <freebsd>
Component: Individual Port(s)Assignee: Vladimir Druzenko <vvd>
Status: Closed FIXED    
Severity: Affects Some People CC: agh, vvd
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
URL: https://github.com/radareorg/iaito/releases/tag/5.9.0
Attachments:
Description Flags
iaito.diff
none
0001-x11-iaito-new-port.patch
freebsd: maintainer-approval+
0001-x11-iaito-fix-port.patch
freebsd: maintainer-approval+
0001-x11-iaito-new-port.patch
freebsd: maintainer-approval+
0001-x11-iaito-new-port.patch
none
Fix build with Qt6 if installed both Qt5 and Qt6
vvd: maintainer-approval?
Add flavours qt5 and qt6
vvd: maintainer-approval?
0001-devel-iaito-marked-broken-for-i386.patch none

Description Martin Filla 2024-04-13 04:34:06 UTC
Created attachment 249945 [details]
iaito.diff

Hi,
new port iaito, Official QT frontend of radare2
Comment 1 Martin Filla 2024-04-13 04:35:30 UTC
POudriere ok
===== env: DEVELOPER_MODE=yes STRICT_DEPENDS=yes USER=root UID=0 GID=0
===>  Deinstalling for iaito
===>   Deinstalling iaito-5.9.0
Updating database digests format: .......... done
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
	iaito: 5.9.0

Number of packages to be removed: 1

The operation will free 4 MiB.
[freebsd132x64-default] [1/1] Deinstalling iaito-5.9.0...
[freebsd132x64-default] [1/1] Deleting files for iaito-5.9.0: ....... done
===========================================================================
=>> Checking for extra files and directories
[00:02:11] Installing from package
[freebsd132x64-default] Installing iaito-5.9.0...
[freebsd132x64-default] Extracting iaito-5.9.0: ....... done
[00:02:12] Cleaning up
===>  Cleaning for iaito-5.9.0
[00:02:12] Deinstalling package
Updating database digests format: . done
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
	iaito: 5.9.0

Number of packages to be removed: 1

The operation will free 4 MiB.
[freebsd132x64-default] [1/1] Deinstalling iaito-5.9.0...
[freebsd132x64-default] [1/1] Deleting files for iaito-5.9.0: ....... done
build of x11/iaito | iaito-5.9.0 ended at Sat Apr 13 06:27:29 CEST 2024
build time: 00:02:07
Comment 2 Vladimir Druzenko freebsd_committer freebsd_triage 2024-07-31 11:35:11 UTC
1.
LIB_DEPENDS=libr_*.so:devel/radare2
You don't need full list. Keep 1 lib only, for example core:
libr_core.so:devel/radare2

2. libGL.so:graphics/libglvnd replace with:
USES=gl
USE_GL=gl

3. Sort records in USES and USE_QT.

4. Remove GH_PROJECT=iaito. By default GH_PROJECT=${PORTNAME}.

5. Test Makefile with portclippy and all port with portlint.
Comment 3 Vladimir Druzenko freebsd_committer freebsd_triage 2024-07-31 11:42:29 UTC
6. Update to 5.9.2.

7. Add more description in pkg-descr from https://github.com/radareorg/iaito.
Several lines of text. For example:
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, ...

8. COMMENT=	Official QT frontend of radare2, a libre reverse engineering framework

Who know what is "radare2"?
Comment 4 Martin Filla 2024-08-02 09:14:30 UTC
Created attachment 252448 [details]
0001-x11-iaito-new-port.patch
Comment 5 Martin Filla 2024-08-02 09:18:39 UTC
Created attachment 252449 [details]
0001-x11-iaito-fix-port.patch
Comment 6 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-03 12:19:32 UTC
1. Why CATEGORIES=x11? devel is more suitable.

2. Port don't need "BUILD_DEPEND=radare2>0:devel/radare2" if it have "libr_core.so:devel/radare2".

3. USE_QT=linguisttools probably must be USE_QT=linguisttools:build.

I'll fix this self.
Comment 7 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-03 12:30:12 UTC
4. Use DISTVERSION instead of PORTVERSION.
Comment 8 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-03 12:31:04 UTC
5. Need USES=gl
Comment 9 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-03 13:09:03 UTC
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

#BUILD_DEPENDS=	bash:shells/bash
LIB_DEPENDS=	libcapstone.so:devel/capstone \
		libr_core.so:devel/radare2
#USES=		desktop-file-utils ssl
USES=		gl gmake  qt:5 pkgconfig qmake:no_configure
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}"

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>
Comment 10 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-03 13:09:46 UTC
devel/iaito/files/patch-src_lib__radare2.pri:
--- 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 {
Comment 11 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-10 01:16:50 UTC
ping
Comment 12 Martin Filla 2024-08-10 07:27:33 UTC
Created attachment 252645 [details]
0001-x11-iaito-new-port.patch

I made new patch with fixes
Comment 13 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-10 12:08:07 UTC
(In reply to Martin Filla from comment #12)
1. Why CATEGORIES=x11? devel is more suitable.
Comment 14 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-10 12:12:12 UTC
2 and 4 isn't fixed too.

Why did you add USES=ssl?
Comment 15 Martin Filla 2024-08-10 12:36:03 UTC
Created attachment 252654 [details]
0001-x11-iaito-new-port.patch
Comment 16 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-10 14:09:33 UTC
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=           gl gmake desktop-file-utils qt:5 pkgconfig qmake:no_configure
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>
Comment 17 Martin Filla 2024-08-10 14:13:08 UTC
(In reply to Vladimir Druzenko from comment #16)
it look like good, can you commit ?
Comment 18 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-10 14:13:50 UTC
(In reply to Martin Filla from comment #17)
Ok.
Comment 19 commit-hook freebsd_committer freebsd_triage 2024-08-10 15:06:28 UTC
A commit in branch main references this bug:

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 (new)                         | 39 ++++++++++++++++++++++
 devel/iaito/distinfo (new)                         |  3 ++
 devel/iaito/files/patch-Makefile (new)             | 11 ++++++
 devel/iaito/files/patch-src_lib__radare2.pri (new) | 13 ++++++++
 devel/iaito/pkg-descr (new)                        | 10 ++++++
 6 files changed, 77 insertions(+)
Comment 20 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-10 15:07:49 UTC
How to build with Qt6 if both Qt5 and Qt6 installed?
Comment 21 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-10 16:37:46 UTC
https://github.com/radareorg/iaito/issues/173
Comment 22 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-10 16:53:46 UTC
What do you thing about build it with Qt6 by default?

--- devel/iaito/Makefile
+++ devel/iaito/Makefile
@@ -11,13 +11,12 @@
 LIB_DEPENDS=   libcapstone.so:devel/capstone \
                libr_core.so:devel/radare2
 
-USES=          desktop-file-utils gl gmake pkgconfig qmake:no_configure qt:6
+USES=          desktop-file-utils gl gmake pkgconfig qmake:no_configure qt:5
 USE_GITHUB=    yes
 GH_ACCOUNT=    radareorg
-USE_GL=                opengl
-USE_QT=                base svg
+USE_GL=                gl
+USE_QT=                buildtools core gui linguisttools:build network svg widgets
 GNU_CONFIGURE= yes
-CONFIGURE_ARGS=        --with-qmake6
 MAKE_ENV=      DESTDIR=${STAGEDIR}${PREFIX} \
                QMAKE_FLAGS="PREFIX=${STAGEDIR}${PREFIX}"
 
devel/iaito/files/patch-configure:
--- configure.orig      2024-05-24 00:09:14 UTC
+++ configure
@@ -470,7 +470,7 @@ QMAKE=""; fi
 fi ; fi
 if [ "$WANT_QMAKE6" = "1" ]; then
 QMAKE=""; fi
-if [ "$HAVE_QMAKE" = "1" ]; then
+if [ "$HAVE_QMAKE" = "1" -a "$WANT_QMAKE6" != "1" ]; then
 QMAKE_BIN="${QMAKE}"
 else
 if [ "$HAVE_QMAKE6" = "1" ]; then
Comment 23 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-10 16:56:23 UTC
(In reply to Vladimir Druzenko from comment #22)
Patch for Makefile was in incorrect direction, this is correct:
--- devel/iaito/Makefile
+++ devel/iaito/Makefile
@@ -11,12 +11,13 @@
 LIB_DEPENDS=   libcapstone.so:devel/capstone \
                libr_core.so:devel/radare2
 
-USES=          desktop-file-utils gl gmake pkgconfig qmake:no_configure qt:5
+USES=          desktop-file-utils gl gmake pkgconfig qmake:no_configure qt:6
 USE_GITHUB=    yes
 GH_ACCOUNT=    radareorg
-USE_GL=                gl
-USE_QT=                buildtools core gui linguisttools:build network svg widgets
+USE_GL=                opengl
+USE_QT=                base svg
 GNU_CONFIGURE= yes
+CONFIGURE_ARGS=        --with-qmake6
 MAKE_ENV=      DESTDIR=${STAGEDIR}${PREFIX} \
                QMAKE_FLAGS="PREFIX=${STAGEDIR}${PREFIX}"
 

Ofc we can make flavours qt5 and qt6 if you want.

P.S. Ports trying to migrate all software from qt5 to qt6 by default.
Comment 24 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-10 17:33:57 UTC
(In reply to Vladimir Druzenko from comment #23)
I create flavours:
--- devel/iaito/Makefile
+++ devel/iaito/Makefile
@@ -11,12 +11,29 @@
 LIB_DEPENDS=   libcapstone.so:devel/capstone \
                libr_core.so:devel/radare2
 
-USES=          desktop-file-utils gl gmake pkgconfig qmake:no_configure qt:5
+FLAVORS=               qt5 qt6
+FLAVOR?=               ${FLAVORS:[2]}
+qt5_PKGNAMESUFFIX=     -qt5
+qt6_PKGNAMESUFFIX=     -qt6
+
+USES=          compiler:c++17-lang desktop-file-utils gl gmake pkgconfig \
+               qmake:no_configure
 USE_GITHUB=    yes
 GH_ACCOUNT=    radareorg
-USE_GL=                gl
-USE_QT=                buildtools core gui linguisttools:build network svg widgets
 GNU_CONFIGURE= yes
+
+.if ${FLAVOR} == qt5
+USES+=         qt:5
+USE_GL=                gl
+USE_QT=                core gui network svg widgets \
+               buildtools:build linguisttools:build qmake:build
+.else
+USES+=         qt:6
+USE_GL=                opengl
+USE_QT=                base svg
+CONFIGURE_ARGS=        --with-qmake6
+.endif
+
 MAKE_ENV=      DESTDIR=${STAGEDIR}${PREFIX} \
                QMAKE_FLAGS="PREFIX=${STAGEDIR}${PREFIX}"
Comment 25 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-10 17:36:11 UTC
Created attachment 252659 [details]
Fix build with Qt6 if installed both Qt5 and Qt6
Comment 26 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-10 17:36:51 UTC
Created attachment 252660 [details]
Add flavours qt5 and qt6
Comment 27 Martin Filla 2024-08-11 07:21:28 UTC
(In reply to Vladimir Druzenko from comment #24)
It looks like good, can you commit changes ?
Comment 28 commit-hook freebsd_committer freebsd_triage 2024-08-11 12:32:00 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5195f55b0806ef5d0775e3ff93a6782a6c0b469c

commit 5195f55b0806ef5d0775e3ff93a6782a6c0b469c
Author:     Vladimir Druzenko <vvd@FreeBSD.org>
AuthorDate: 2024-08-11 12:27:12 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2024-08-11 12:27:12 +0000

    devel/iaito: add flavors qt5 and qt6, default qt6

    Add patch build flavor qt6 if qt5 is installed too.
    Upstream issue: https://github.com/radareorg/iaito/issues/173

    PR:             278339
    Approved by:    Martin Filla <freebsd@sysctl.cz> (maintainer)

 devel/iaito/Makefile                    | 23 ++++++++++++++++++++---
 devel/iaito/files/patch-configure (new) | 11 +++++++++++
 2 files changed, 31 insertions(+), 3 deletions(-)
Comment 29 Martin Filla 2024-08-11 13:32:38 UTC
Created attachment 252684 [details]
0001-devel-iaito-marked-broken-for-i386.patch

iaito marked for i386 as broken
Comment 30 commit-hook freebsd_committer freebsd_triage 2024-08-11 14:00:10 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4e152c733c80bac15b64b93cc0f570bcba9f869b

commit 4e152c733c80bac15b64b93cc0f570bcba9f869b
Author:     Martin Filla <freebsd@sysctl.cz>
AuthorDate: 2024-08-11 13:54:53 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2024-08-11 13:57:23 +0000

    devel/iaito: mark broken on i386: non-constant-expression cannot be narrowed from type 'const unsigned long long' to 'size_t'

    error: non-constant-expression cannot be narrowed from type
    'const unsigned long long' to 'size_t' (aka 'unsigned int')

    PR:             278339
    Reported by:    pkg-fallout

 devel/iaito/Makefile | 2 ++
 1 file changed, 2 insertions(+)