pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

wip/qFlipper: import qFlipper 1.3.3



Module Name:	pkgsrc-wip
Committed By:	Taylor R Campbell <riastradh%NetBSD.org@localhost>
Pushed By:	riastradh
Date:		Fri Mar 1 03:31:02 2024 +0000
Changeset:	bb1bb7cf62d3c40e575eb86bd7a42adb0eb97f42

Modified Files:
	Makefile
Added Files:
	qFlipper/DESCR
	qFlipper/Makefile
	qFlipper/PLIST
	qFlipper/distinfo
	qFlipper/patches/patch-application_applicationupdater.cpp
	qFlipper/patches/patch-application_screencanvas.cpp
	qFlipper/patches/patch-backend_flipperzero_helper_deviceinfohelper.cpp
	qFlipper/patches/patch-backend_flipperzero_protobufsession.cpp
	qFlipper/patches/patch-backend_flipperzero_utility_storageinforefreshoperation.cpp
	qFlipper/patches/patch-dfu_dfusedevice.cpp

Log Message:
wip/qFlipper: import qFlipper 1.3.3

Flipper Zero firmware update tool

Doesn't work yet on NetBSD because it relies on libusb hotplug, which
isn't supported on NetBSD.

GUI also has awful flickering, no idea why yet.

To be investigated!

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=bb1bb7cf62d3c40e575eb86bd7a42adb0eb97f42

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                                           |  1 +
 qFlipper/DESCR                                     |  9 ++++
 qFlipper/Makefile                                  | 61 ++++++++++++++++++++++
 qFlipper/PLIST                                     |  7 +++
 qFlipper/distinfo                                  | 17 ++++++
 .../patch-application_applicationupdater.cpp       | 43 +++++++++++++++
 .../patches/patch-application_screencanvas.cpp     | 14 +++++
 ...backend_flipperzero_helper_deviceinfohelper.cpp | 14 +++++
 .../patch-backend_flipperzero_protobufsession.cpp  | 15 ++++++
 ...perzero_utility_storageinforefreshoperation.cpp | 14 +++++
 qFlipper/patches/patch-dfu_dfusedevice.cpp         | 14 +++++
 11 files changed, 209 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 6b53171fde..8c71545bfc 100644
--- a/Makefile
+++ b/Makefile
@@ -4798,6 +4798,7 @@ SUBDIR+=	q
 SUBDIR+=	q-dns
 SUBDIR+=	q2pro
 SUBDIR+=	q5go
+SUBDIR+=	qFlipper
 SUBDIR+=	qbe-git
 SUBDIR+=	qcdloop
 SUBDIR+=	qemu-git
diff --git a/qFlipper/DESCR b/qFlipper/DESCR
new file mode 100644
index 0000000000..1d9285d6e4
--- /dev/null
+++ b/qFlipper/DESCR
@@ -0,0 +1,9 @@
+Graphical desktop application for updating Flipper Zero
+(https://flipperzero.one/) firmware via PC.
+
+* Update Flipper's firmware and supplemental data with a press of one
+  button
+* Repair a broken firmware installation
+* Stream Flipper's display and control it remotely
+* Install firmware from a .dfu file
+* Backup and restore settings, progress and pairing data
diff --git a/qFlipper/Makefile b/qFlipper/Makefile
new file mode 100644
index 0000000000..9194c2c3cb
--- /dev/null
+++ b/qFlipper/Makefile
@@ -0,0 +1,61 @@
+# $NetBSD$
+
+GITHUB_PROJECT=	qFlipper
+GITHUB_TAG=	refs/tags/1.3.3
+DISTNAME=	1.3.3
+PKGNAME=	${GITHUB_PROJECT}-${DISTNAME}
+CATEGORIES=	misc
+MASTER_SITES=	${MASTER_SITE_GITHUB:=flipperdevices/}
+DIST_SUBDIR=	${GITHUB_PROJECT}
+
+GITHUB_SUBMODULES+=	pbatard	libwdi	v1.5.0	driver-tool/libwdi
+GITHUB_SUBMODULES+=	nanopb	nanopb	0.4.8	3rdparty/nanopb
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://flipperzero.one/update
+COMMENT=	Flipper Zero firmware update tool
+LICENSE=	gnu-gpl-v3
+
+WRKSRC=		${WRKDIR}/qFlipper-1.3.3
+USE_LANGUAGES=	c c++
+USE_TOOLS+=	pkg-config
+
+TOOL_DEPENDS+=	qt5-qtbase>=0:../../x11/qt5-qtbase
+TOOL_DEPENDS+=	qt5-qttools>=0:../../x11/qt5-qttools
+
+QMAKE=		${QTDIR}/bin/qmake
+QMAKE_ARGS+=	PREFIX=${PREFIX:Q}
+
+INSTALL_ENV+=	INSTALL_ROOT=${DESTDIR:Q}
+
+# _NETBSD_SOURCE pulls in major() and minor() macros in <sys/types.h>,
+# which breaks some parts of qFlipper, so define standard feature
+# macros instead to suppress this.  Somehow part of the build adds
+# _NETBSD_SOURCE itself, so we have to remove it explicitly.
+CFEATUREFLAGS+=		-D_ISOC99_SOURCE
+CFEATUREFLAGS+=		-D_POSIX_C_SOURCE=200809L
+_WRAP_EXTRA_ARGS.CC+=	${CFEATUREFLAGS}
+_WRAP_EXTRA_ARGS.CXX+=	${CFEATUREFLAGS}
+CWRAPPERS_PREPEND.cc+=	${CFEATUREFLAGS}
+CWRAPPERS_PREPEND.cxx+=	${CFEATUREFLAGS}
+BUILDLINK_TRANSFORM+=	rm:-D_NETBSD_SOURCE
+
+BUILD_DIRS=	build
+
+pre-configure:
+	${RUN}cd ${WRKSRC:Q} && mkdir build
+
+do-configure:
+	@${STEP_MSG} Running qmake
+	${RUN}${_ULIMIT_CMD}cd ${WRKSRC:Q}/build && \
+	${PKGSRC_SETENV} ${CONFIGURE_ENV} \
+		${QMAKE:Q} ../qFlipper.pro ${QMAKE_ARGS}
+
+.include "../../devel/libusb1/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../x11/qt5-qtbase/buildlink3.mk"
+.include "../../x11/qt5-qtserialport/buildlink3.mk"
+.include "../../x11/qt5-qtquickcontrols2/buildlink3.mk"
+.include "../../x11/qt5-qtsvg/buildlink3.mk"
+#.include "../../x11/qt5-qtwayland/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/qFlipper/PLIST b/qFlipper/PLIST
new file mode 100644
index 0000000000..8927945189
--- /dev/null
+++ b/qFlipper/PLIST
@@ -0,0 +1,7 @@
+@comment $NetBSD$
+bin/qFlipper
+bin/qFlipper-cli
+lib/qFlipper/plugins/libflipperproto0.so
+lib/udev/rules.d/42-flipperzero.rules
+share/applications/qFlipper.desktop
+share/icons/hicolor/512x512/apps/qFlipper.png
diff --git a/qFlipper/distinfo b/qFlipper/distinfo
new file mode 100644
index 0000000000..4edc57134c
--- /dev/null
+++ b/qFlipper/distinfo
@@ -0,0 +1,17 @@
+$NetBSD$
+
+BLAKE2s (qFlipper/1.3.3.tar.gz) = c8be1624ec51d3e47f512db50bbdf0395dcf45889893083f7c1960479e794085
+SHA512 (qFlipper/1.3.3.tar.gz) = 55f19517982dbcc52f586bafd1c6f3d9acc9c81c29e3f42bc4e4d2f09c962b976bfb97406e20c7a126b9f555b2e6b6e420fa94cd97b07877d00ef74e425e6751
+Size (qFlipper/1.3.3.tar.gz) = 1290922 bytes
+BLAKE2s (qFlipper/nanopb-nanopb-0.4.8.tar.gz) = 0e2a8c346c19cf6289cd2fd19bc0dc1403aed944bde7fe2a9ffdbdbc811b906b
+SHA512 (qFlipper/nanopb-nanopb-0.4.8.tar.gz) = 635577498dfbfb46fd64b8ec83b2a4a9b03b57c665f3c9f67d35c272810c0330b0e9011d7c0e43623e9da74d6ee3a4c1f012878e2bff7e1a7e57fb7c0857ad42
+Size (qFlipper/nanopb-nanopb-0.4.8.tar.gz) = 1163452 bytes
+BLAKE2s (qFlipper/pbatard-libwdi-v1.5.0.tar.gz) = 5ef573fc4d1d2e9277182b8811950ed243f8e384396012b39014ede735f79686
+SHA512 (qFlipper/pbatard-libwdi-v1.5.0.tar.gz) = a70dbf1652228d2fc27968b76c0b92a737c29a3ad6dbc4494a0f6ebd39a539f5155c02e4aaeb437a3b4ba017e61e5e297776163ae94b838a753d467de37b7c0c
+Size (qFlipper/pbatard-libwdi-v1.5.0.tar.gz) = 287250 bytes
+SHA1 (patch-application_applicationupdater.cpp) = ea464b7a20501f147ad3a0b2ee231f6d0485ef08
+SHA1 (patch-application_screencanvas.cpp) = 9482bb31801b5ea6dd44b412f4273c775fca8d24
+SHA1 (patch-backend_flipperzero_helper_deviceinfohelper.cpp) = d75fbfcc4f9f2d2196f852852a085a7e77510d94
+SHA1 (patch-backend_flipperzero_protobufsession.cpp) = 663dc1dfd0f00492301ca5e3c8a877d8650b5659
+SHA1 (patch-backend_flipperzero_utility_storageinforefreshoperation.cpp) = f3da50513cd85bb6dd0f0b247fa47669ab66ffff
+SHA1 (patch-dfu_dfusedevice.cpp) = 971a0b12516d08ddb965f870238ce201bd181ea2
diff --git a/qFlipper/patches/patch-application_applicationupdater.cpp b/qFlipper/patches/patch-application_applicationupdater.cpp
new file mode 100644
index 0000000000..50f9204d0a
--- /dev/null
+++ b/qFlipper/patches/patch-application_applicationupdater.cpp
@@ -0,0 +1,43 @@
+$NetBSD$
+
+Disable self-updates -- updates are in pkgsrc's jurisdiction.  Fixes
+build on non-Windows/macOS/Linux too.
+
+--- application/applicationupdater.cpp.orig	2023-11-10 09:40:31.000000000 +0000
++++ application/applicationupdater.cpp
+@@ -63,6 +63,11 @@ bool ApplicationUpdater::canUpdate(const
+ 
+ void ApplicationUpdater::installUpdate(const Flipper::Updates::VersionInfo &versionInfo)
+ {
++#if 1
++    qCWarning(CATEGORY_SELFUPDATES).noquote() << "Self-updates not supported; update package instead";
++    setState(ErrorOccured);
++    return;
++#else
+ #ifdef Q_OS_WINDOWS
+     const auto fileInfo = versionInfo.fileInfo(QStringLiteral("installer"), QStringLiteral("windows/amd64"));
+ #elif defined(Q_OS_MAC)
+@@ -151,6 +156,7 @@ void ApplicationUpdater::installUpdate(c
+         qCWarning(CATEGORY_SELFUPDATES) << "Downloading the application update package...";
+         setState(Downloading);
+     }
++#endif
+ }
+ 
+ void ApplicationUpdater::setState(ApplicationUpdater::State state)
+@@ -175,6 +181,9 @@ void ApplicationUpdater::setProgress(dou
+ 
+ bool ApplicationUpdater::performUpdate(const QString &path)
+ {
++#if 1
++    return false;
++#else
+     const auto exitApplication = []() {
+         qCInfo(CATEGORY_SELFUPDATES) << "Update started, exiting the application...";
+         QCoreApplication::exit(0);
+@@ -213,4 +222,5 @@ bool ApplicationUpdater::performUpdate(c
+ #else
+ #error "Unsupported OS"
+ #endif
++#endif
+ }
diff --git a/qFlipper/patches/patch-application_screencanvas.cpp b/qFlipper/patches/patch-application_screencanvas.cpp
new file mode 100644
index 0000000000..3922d2fa22
--- /dev/null
+++ b/qFlipper/patches/patch-application_screencanvas.cpp
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Work around NetBSD <math.h> namespace bugs.
+
+--- application/screencanvas.cpp.orig	2023-11-10 09:40:31.000000000 +0000
++++ application/screencanvas.cpp
+@@ -1,3 +1,7 @@
++#ifdef __NetBSD__
++#define	_NETBSD_SOURCE		// PR lib/57960, https://gnats.NetBSD.org/57960
++#endif
++
+ #include "screencanvas.h"
+ 
+ #include <cmath>
diff --git a/qFlipper/patches/patch-backend_flipperzero_helper_deviceinfohelper.cpp b/qFlipper/patches/patch-backend_flipperzero_helper_deviceinfohelper.cpp
new file mode 100644
index 0000000000..9ec5d7cb67
--- /dev/null
+++ b/qFlipper/patches/patch-backend_flipperzero_helper_deviceinfohelper.cpp
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Work around NetBSD <math.h> namespace bugs.
+
+--- backend/flipperzero/helper/deviceinfohelper.cpp.orig	2023-11-10 09:40:31.000000000 +0000
++++ backend/flipperzero/helper/deviceinfohelper.cpp
+@@ -1,3 +1,7 @@
++#ifdef __NetBSD__
++#define	_NETBSD_SOURCE		// PR lib/57960, https://gnats.NetBSD.org/57960
++#endif
++
+ #include "deviceinfohelper.h"
+ 
+ #include <cmath>
diff --git a/qFlipper/patches/patch-backend_flipperzero_protobufsession.cpp b/qFlipper/patches/patch-backend_flipperzero_protobufsession.cpp
new file mode 100644
index 0000000000..cbf4a575a0
--- /dev/null
+++ b/qFlipper/patches/patch-backend_flipperzero_protobufsession.cpp
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Add NetBSD loader support.
+
+--- backend/flipperzero/protobufsession.cpp.orig	2023-11-10 09:40:31.000000000 +0000
++++ backend/flipperzero/protobufsession.cpp
+@@ -445,7 +445,7 @@ const QString ProtobufSession::protobufP
+     return QStringLiteral("flipperproto%1.dll").arg(versionMajor);
+ #elif defined(Q_OS_MAC)
+     return QStringLiteral("libflipperproto%1.dylib").arg(versionMajor);
+-#elif defined(Q_OS_LINUX)
++#elif defined(Q_OS_LINUX) || defined(Q_OS_NETBSD)
+     return QStringLiteral("libflipperproto%1.so").arg(versionMajor);
+ #else
+ #error "Unsupported OS"
diff --git a/qFlipper/patches/patch-backend_flipperzero_utility_storageinforefreshoperation.cpp b/qFlipper/patches/patch-backend_flipperzero_utility_storageinforefreshoperation.cpp
new file mode 100644
index 0000000000..30eade409e
--- /dev/null
+++ b/qFlipper/patches/patch-backend_flipperzero_utility_storageinforefreshoperation.cpp
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Work around NetBSD <math.h> namespace bugs.
+
+--- backend/flipperzero/utility/storageinforefreshoperation.cpp.orig	2023-11-10 09:40:31.000000000 +0000
++++ backend/flipperzero/utility/storageinforefreshoperation.cpp
+@@ -1,3 +1,7 @@
++#ifdef __NetBSD__
++#define	_NETBSD_SOURCE		// PR lib/57960, https://gnats.NetBSD.org/57960
++#endif
++
+ #include "storageinforefreshoperation.h"
+ 
+ #include <cmath>
diff --git a/qFlipper/patches/patch-dfu_dfusedevice.cpp b/qFlipper/patches/patch-dfu_dfusedevice.cpp
new file mode 100644
index 0000000000..d8b018994f
--- /dev/null
+++ b/qFlipper/patches/patch-dfu_dfusedevice.cpp
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Work around NetBSD <math.h> namespace bugs.
+
+--- dfu/dfusedevice.cpp.orig	2023-11-10 09:40:31.000000000 +0000
++++ dfu/dfusedevice.cpp
+@@ -1,3 +1,7 @@
++#ifdef __NetBSD__
++#define	_NETBSD_SOURCE		// PR lib/57960, https://gnats.NetBSD.org/57960
++#endif
++
+ #include "dfusedevice.h"
+ 
+ #include <cmath>


Home | Main Index | Thread Index | Old Index