From 2fb477e7e19110262cc30a995956ffe9430723ff Mon Sep 17 00:00:00 2001 From: "Dr. P. Roberts" Date: Tue, 30 Dec 2025 10:13:55 +0100 Subject: gnu: Add qflipper. * gnu/packages/embedded.scm (qflipper): New variable. * gnu/packages/patches/qflipper-qt6.9-compat.patch: New file. * gnu/local.mk: Register it. Signed-off-by: Gabriel Wicki --- gnu/local.mk | 1 + gnu/packages/embedded.scm | 71 ++++++++++++++++++++++++ gnu/packages/patches/qflipper-qt6.9-compat.patch | 43 ++++++++++++++ 3 files changed, 115 insertions(+) create mode 100644 gnu/packages/patches/qflipper-qt6.9-compat.patch diff --git a/gnu/local.mk b/gnu/local.mk index 098316e9194..9f68d0ff190 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2316,6 +2316,7 @@ dist_patch_DATA = \ %D%/packages/patches/qemu-fix-agent-paths.patch \ %D%/packages/patches/qemu-fix-test-virtio-version.patch \ %D%/packages/patches/qemu-disable-aarch64-migration-test.patch \ + %D%/packages/patches/qflipper-qt6.9-compat.patch \ %D%/packages/patches/qrcodegen-cpp-cmake.patch \ %D%/packages/patches/qtbase-absolute-runpath.patch \ %D%/packages/patches/qtbase-qmake-fix-includedir.patch \ diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm index a4d633ac6e5..09deeaf27d8 100644 --- a/gnu/packages/embedded.scm +++ b/gnu/packages/embedded.scm @@ -70,11 +70,13 @@ #:use-module (gnu packages ncurses) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) + #:use-module (gnu packages protobuf) #:use-module (gnu packages python) #:use-module (gnu packages python-build) #:use-module (gnu packages python-crypto) #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) + #:use-module (gnu packages qt) #:use-module (gnu packages readline) #:use-module (gnu packages rust) #:use-module (gnu packages rust-apps) @@ -2090,3 +2092,72 @@ TS-4900 family. The included commands are: in order to program 8051-based System-On-Chip devices: CC254x CC253x CC243x CC251x CC111x.") (license license:gpl2))) + +(define-public qflipper + (package + (name "qflipper") + (version "1.3.3") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/flipperdevices/qFlipper") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0q68pkkak1ji0800hxbypshgj89vzwkql3j5x53sd32v96c8j7yp")) + (patches + (search-patches "qflipper-qt6.9-compat.patch")))) + (build-system gnu-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (replace 'configure + (lambda* (#:key inputs #:allow-other-keys) + (invoke "qmake" + (string-append "PREFIX=" #$output) + (string-append + "QT_TOOL.lrelease.binary=" + (search-input-file inputs "/bin/lrelease")) + "DEFINES+=DISABLE_APPLICATION_UPDATES"))) + (add-after 'unpack 'fix-version + (lambda _ + (substitute* "qflipper_common.pri" + (("GIT_VERSION =.*") (string-append "GIT_VERSION = \"" #$version "\"\n"))))) + (add-after 'unpack 'unbundle-nanopb + (lambda _ + (substitute* "qFlipper.pro" + ((".*3rdparty.*") "")) + (substitute* "plugins/flipperproto0/flipperproto0.pro" + (("-l3rdparty") "-lprotobuf-nanopb"))))))) + (native-inputs (list pkg-config)) + (inputs + (list libusb + nanopb-malloc + qt5compat + qtbase + qtdeclarative + qtserialport + qtsvg + qttools + qtwayland + zlib)) + (home-page "https://github.com/flipperdevices/qFlipper") + (synopsis "Desktop application for Flipper Zero") + (description + "qFlipper is a graphical application for Flipper Zero with the following features: + +@itemize @bullet +@item Update Flipper's firmware and supplemental data +@item Repair a broken firmware installation +@item Stream Flipper's display and control it remotely +@item Install firmware from a @code{.dfu} file +@item Backup and restore settings, progress and pairing data +@item Command line interface +@end itemize + +Tip: to be able to use this application as a regular user, search for the +@code{42-flipperzero.rules} file in the contents of the package, install it +using udev-rules-service, then add your user to the dialout group.") + (license license:gpl3))) diff --git a/gnu/packages/patches/qflipper-qt6.9-compat.patch b/gnu/packages/patches/qflipper-qt6.9-compat.patch new file mode 100644 index 00000000000..38c85642822 --- /dev/null +++ b/gnu/packages/patches/qflipper-qt6.9-compat.patch @@ -0,0 +1,43 @@ +From 57316893037d119931011d9abd4a05ed158c7a24 Mon Sep 17 00:00:00 2001 +From: Michal Suchanek +Date: Tue, 8 Apr 2025 17:06:42 +0200 +Subject: [PATCH] Define == for DeviceInfo + +Looks like some newer Qt versions require == instead of !=. + +Define both. +--- + backend/flipperzero/deviceinfo.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/backend/flipperzero/deviceinfo.h b/backend/flipperzero/deviceinfo.h +index deaa18b..3cfd5f9 100644 +--- a/backend/flipperzero/deviceinfo.h ++++ b/backend/flipperzero/deviceinfo.h +@@ -31,6 +31,7 @@ public: + + // Needed in order to work with QVariant + bool operator !=(const HardwareInfo &other) const { Q_UNUSED(other) return true; } ++ bool operator ==(const HardwareInfo &other) const { Q_UNUSED(other) return false; } + }; + + struct SoftwareInfo { +@@ -50,6 +51,7 @@ public: + + // Needed in order to work with QVariant + bool operator !=(const SoftwareInfo &other) const { Q_UNUSED(other) return true; } ++ bool operator ==(const SoftwareInfo &other) const { Q_UNUSED(other) return false; } + }; + + struct StorageInfo { +@@ -67,6 +69,7 @@ public: + + // Needed in order to work with QVariant + bool operator !=(const StorageInfo &other) const { Q_UNUSED(other) return true; } ++ bool operator ==(const StorageInfo &other) const { Q_UNUSED(other) return false; } + }; + + struct ProtobufInfo { +-- +2.52.0 + -- cgit v1.2.3