Skip to content
Snippets Groups Projects
Commit 0453380c authored by Kevin Bowling's avatar Kevin Bowling
Browse files

sysutils/qflipper: New port

PC support for Flipper Zero
parent eec112e6
No related branches found
No related tags found
No related merge requests found
Showing
with 221 additions and 0 deletions
......@@ -1137,6 +1137,7 @@
SUBDIR += pydf
SUBDIR += qchroot
SUBDIR += qdirstat
SUBDIR += qflipper
SUBDIR += qjail
SUBDIR += qjail54
SUBDIR += qlogtools
......
PORTNAME= qFlipper
PORTVERSION= 1.2.1
CATEGORIES= sysutils
MAINTAINER= kbowling@FreeBSD.org
COMMENT= Application for updating Flipper Zero firmware
WWW= https://github.com/flipperdevices/qFlipper
LICENSE= GPLv3
LICENSE_FILE= ${WRKSRC}/LICENSE
LIB_DEPENDS= libprotobuf-nanopb.so:devel/nanopb
USES= compiler:c++11-lang desktop-file-utils gl qmake qt:5
USE_GITHUB= yes
GH_ACCOUNT= flipperdevices
USE_GL= gl
USE_QT= concurrent core declarative gui linguisttools network \
quickcontrols2 serialport svg widgets buildtools:build
PLIST_FILES= bin/qFlipper \
bin/qFlipper-cli \
lib/qt5/plugins/libflipperproto0.so \
share/applications/qFlipper.desktop \
share/icons/hicolor/512x512/apps/qFlipper.png
.include <bsd.port.mk>
TIMESTAMP = 1669525166
SHA256 (flipperdevices-qFlipper-1.2.1_GH0.tar.gz) = 3780c77c09e3837e01af8bdc12ea55e052b2f540812736421224112e66a06f00
SIZE (flipperdevices-qFlipper-1.2.1_GH0.tar.gz) = 1282416
--- application/application.pro.orig 2022-11-27 22:12:16 UTC
+++ application/application.pro
@@ -100,8 +100,8 @@ unix:!macx {
iconfiles.files = $$PWD/assets/icons/$${TARGET}.png
iconfiles.path = $$PREFIX/share/icons/hicolor/512x512/apps
- udevfiles.files = $$PWD/../installer-assets/udev/42-flipperzero.rules
- udevfiles.path = $$PREFIX/lib/udev/rules.d
+ #udevfiles.files = $$PWD/../installer-assets/udev/42-flipperzero.rules
+ #udevfiles.path = $$PREFIX/lib/udev/rules.d
INSTALLS += target desktopfiles iconfiles udevfiles
--- application/applicationupdater.cpp.orig 2022-11-27 21:54:15 UTC
+++ application/applicationupdater.cpp
@@ -57,6 +57,9 @@ void ApplicationUpdater::installUpdate(const Flipper::
void ApplicationUpdater::installUpdate(const Flipper::Updates::VersionInfo &versionInfo)
{
+#ifdef Q_OS_UNIX
+ return;
+#else
#ifdef Q_OS_WINDOWS
const auto fileInfo = versionInfo.fileInfo(QStringLiteral("installer"), QStringLiteral("windows/amd64"));
#elif defined(Q_OS_MAC)
@@ -64,7 +67,7 @@ void ApplicationUpdater::installUpdate(const Flipper::
#elif defined(Q_OS_LINUX)
const auto fileInfo = versionInfo.fileInfo(QStringLiteral("AppImage"), QStringLiteral("linux/amd64"));
#else
-#error "Unsupported OS"
+ #error "Unsupported OS"
#endif
const auto fileName = QFileInfo(fileInfo.url()).fileName();
@@ -145,6 +148,7 @@ void ApplicationUpdater::installUpdate(const Flipper::
qCWarning(CATEGORY_SELFUPDATES) << "Downloading the application update package...";
setState(State::Downloading);
}
+#endif
}
void ApplicationUpdater::setState(State state)
@@ -207,6 +211,7 @@ bool ApplicationUpdater::performUpdate(const QString &
return success;
#else
-#error "Unsupported OS"
+#warning "Unsupported OS"
+ return 1;
#endif
}
--- backend/flipperzero/helper/deviceinfohelper.cpp.orig 2022-11-28 05:07:31 UTC
+++ backend/flipperzero/helper/deviceinfohelper.cpp
@@ -97,7 +97,8 @@ void VCPDeviceInfoHelper::findSerialPort()
void VCPDeviceInfoHelper::findSerialPort()
{
- auto *finder = new SerialFinder(m_deviceInfo.usbInfo.serialNumber(), this);
+ QString serialBsd = QString(m_deviceInfo.usbInfo.serialNumber()).remove(QString("_"));
+ auto *finder = new SerialFinder(serialBsd, this);
connect(finder, &SerialFinder::finished, this, [=](const QSerialPortInfo &portInfo) {
if(portInfo.isNull()) {
--- backend/flipperzero/protobufsession.cpp.orig 2022-11-27 21:43:32 UTC
+++ backend/flipperzero/protobufsession.cpp
@@ -426,7 +426,7 @@ const QString ProtobufSession::protobufPluginFileName(
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_UNIX)
return QStringLiteral("libflipperproto%1.so").arg(versionMajor);
#else
#error "Unsupported OS"
--- cli/cli.pro.orig 2022-11-27 06:21:50 UTC
+++ cli/cli.pro
@@ -11,13 +11,13 @@ unix|win32 {
unix|win32 {
LIBS += \
- -L$$OUT_PWD/../3rdparty/ -l3rdparty \
+ -lprotobuf-nanopb \
-L$$OUT_PWD/../plugins/ -lflipperproto0 \
-L$$OUT_PWD/../backend/ -lbackend \
-L$$OUT_PWD/../dfu/ -ldfu
contains(CONFIG, static): LIBS += \
- -L$$OUT_PWD/../3rdparty/ -l3rdparty \
+ -lprotobuf-nanopb \
-L$$OUT_PWD/../plugins/ -lflipperproto0
}
--- dfu/device/stm32wb55/infotable.h.orig 2022-11-27 21:57:44 UTC
+++ dfu/device/stm32wb55/infotable.h
@@ -52,6 +52,7 @@ struct FUSDeviceInfoTable
uint32_t reserved2;
uint64_t UID64;
uint16_t deviceID;
+ uint32_t padding_ /* padding for 32 bit build */;
};
struct DeviceInfoTable {
--- plugins/flipperproto0/flipperproto0.pro.orig 2022-10-03 15:15:41 UTC
+++ plugins/flipperproto0/flipperproto0.pro
@@ -13,7 +13,6 @@ INCLUDEPATH += $$PWD/../protobufinterface \
VERSION = 0.0.0
INCLUDEPATH += $$PWD/../protobufinterface \
- $$PWD/../../3rdparty/nanopb
HEADERS += \
guirequest.h \
@@ -59,13 +58,13 @@ unix|win32 {
systemresponse.cpp
unix|win32 {
- LIBS += -L$$OUT_PWD/../../3rdparty/ -l3rdparty
+ LIBS += -lprotobuf-nanopb
}
DEFINES += PB_ENABLE_MALLOC
unix:!macx {
- target.path = $$PREFIX/lib/$$NAME/plugins
+ target.path = $$PREFIX/lib/qt5/plugins
} else:macx {
target.path = $$DESTDIR/../$${NAME}.app/Contents/PlugIns
} else:win32 {
--- qFlipper.pro.orig 2022-11-27 06:24:58 UTC
+++ qFlipper.pro
@@ -1,7 +1,6 @@ SUBDIRS += \
TEMPLATE = subdirs
SUBDIRS += \
- 3rdparty \
application \
backend \
dfu \
@@ -11,4 +10,3 @@ cli.depends = backend
backend.depends = dfu plugins
application.depends = backend
cli.depends = backend
-plugins.depends = 3rdparty
--- qflipper_common.pri.orig 2022-11-27 18:49:46 UTC
+++ qflipper_common.pri
@@ -5,7 +5,7 @@ unix:!macx {
unix:!macx {
DEFINES += USB_BACKEND_LIBUSB
CONFIG += link_pkgconfig
- PKGCONFIG += libusb-1.0 zlib
+ LIBS += -lusb -lz
isEmpty(PREFIX): PREFIX = /usr
@@ -27,20 +27,11 @@ unix:!macx {
error("Unsupported OS or compiler")
}
-GIT_VERSION = $$system("git describe --tags --abbrev=0","lines", HAS_VERSION)
-!equals(HAS_VERSION, 0) {
- GIT_VERSION = unknown
-}
+GIT_VERSION = 1.2.1
-GIT_COMMIT = $$system("git rev-parse --short=8 HEAD","lines", HAS_COMMIT)
-!equals(HAS_COMMIT, 0) {
- GIT_COMMIT = unknown
-}
+GIT_COMMIT = 3ec0fd9d
-GIT_TIMESTAMP = $$system("git log -1 --pretty=format:%ct","lines", HAS_TIMESTAMP)
-!equals(HAS_TIMESTAMP, 0) {
- GIT_TIMESTAMP = 0
-}
+GIT_TIMESTAMP = 1664810141
DEFINES += APP_NAME=\\\"$$NAME\\\" \
APP_VERSION=\\\"$$GIT_VERSION\\\" \
Graphical desktop application for updating Flipper Zero firmware via PC
This utility allows updating firmware, repair, remote control, and backup.
[
{ type: install
message: <<EOM
qFlipper must have access to /dev/cuaU* serial ports.
Either add a user to the "dialer" group, or run it with sudo.
EOM
}
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment