I had hoped to jump ahead with my flameshot-dev repo, since I let it languish for such a long time, but just as FVWM3 made changes that stymie me at present, flameshot has as well. The much newer version of flameshot now uses qt:6 but although I have tried to implement things in the Makefile to comply with this change, after each adjustment I reach another qt6 issue which feels like its not handled by our make build structure completely somehow.
Because the most recent version gave me troubles, I backtracked to earlier commits, and ever earlier commits, until I found hopefully the last or nearly last commit that used qt5. I am doing all of this because once more something strange has occurred. I would assume it is xlibre related, but it could be anything else. When I try to open the Flameshot Launcher, I get a very small window and even when expanded seems to contain nothing. Flameshot does have a maintainer but at present the version in ports is a number of releases behind, and this means I cannot cheat with my flameshot-dev repo and simply copy what I haven't been able to figure out for the qt6 stuff.
My main hope is that firstly I will be able to rebuild flameshot to be more current from source. Second, I would really like to be able to start with a Makefile that works with the last changes that includes qt5, and try to slowly adapt and figure things out, possibly eventually jumping ahead if I can get all of the qt6 things to succeed. It may be humorous to see the long series of commits in my flameshot-dev repo for the 'catching up' process beginning with Feb 2025.
I figured out some things for the qt6 requirements, one method was searching freshports for the missing item in a pkg-plist there, which gave me the needed dependency line. My main trouble, since the first commit that included it, is 'singleapplication' by whatever variation that was used. Looking at some other ports that happened to involve singleapplication (or a variant) helped me discover other Use_QT items such as 5compat, tools:build, and translations:build which are different for qt6 but I didn't notice in the handbook. I probably could have found them if I looked in the /usr/port/Mk/Uses at the qt.mk or qt-dist.mk file.
I don't know why I struggle so much to pass a variable toggle to cmake but I do. After once more looking at the CMakeLists.txt file I finally notice USE_KDSINGLEAPPLICATION which I can set to some variation of "do not use" which for me and my struggle to set that turns out to be:
-DUSE_KDSINGLEAPPLICATION="false" \
-DUSE_KDSINGLEAPPLICATION="FALSE" \
-DUSE_KDSINGLEAPPLICATION="off" \
-DUSE_KDSINGLEAPPLICATION="OFF"
And then I make clean and try make install once more. This time something above is set to avoid 'singleapplication' and everything builds beyond that requirement. It keeps happily chugging along until we reach the QtColorWidgets requirement.
ld: error: unable to find library -lQtColorWidgets c++: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed. ===> Compilation failed unexpectedly. Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer. *** Error code 1 Stop. make: stopped making "install" in /home/tigersharke/flameshot-dev
I would have expected by now that everything would have been satisfied, but I look at the qt.mk file again and wonder if upstream is mixing qt5 and qt6 as well as using the 5compat shim package. It may be that I add a different line to include the Qt5 QtColorWidgets package and see if that cures it. I'd believe upstream should find a Qt6 replacement for it.
# The Qt components supported by qt.mk: list of shared, and version specific ones
_USE_QT_COMMON= 3d charts connectivity datavis3d declarative doc \
examples imageformats location multimedia networkauth \
quick3d quicktimeline remoteobjects scxml sensors \
serialbus serialport speech svg virtualkeyboard wayland \
webchannel webengine websockets webview
_USE_QT5_ONLY= assistant buildtools concurrent core dbus \
declarative-test designer diag gamepad \
graphicaleffects gui help l10n linguist linguisttools \
network opengl paths pixeltool plugininfo printsupport \
qdbus qdbusviewer qdoc qdoc-data qev qmake quickcontrols \
quickcontrols2 script scripttools sql sql-mysql sql-odbc \
sql-pgsql sql-sqlite2 sql-sqlite3 sql-tds testlib uiplugin \
uitools webglplugin websockets-qml \
widgets x11extras xml xmlpatterns
_USE_QT6_ONLY= 5compat base coap graphs grpc httpserver languageserver \
lottie mqtt pdf positioning quick3dphysics quickeffectmaker \
shadertools tools translations sqldriver-sqlite \
sqldriver-mysql sqldriver-psql sqldriver-odbc
It turns out that I had already included that extra line for QtColorWidgets and cmake is simply not finding the requisite files. So this time I go into the work/flameshot directory to search:
packaging/rpm/opensuse/flameshot.spec:rm -rf %{buildroot}%{_includedir}/QtColorWidgets
packaging/rpm/opensuse/flameshot.spec:rm -rf %{buildroot}%{_libdir}/cmake/QtColorWidgets
packaging/rpm/opensuse/flameshot.spec:rm -f %{buildroot}%{_libdir}/libQtColorWidgets.*
packaging/rpm/opensuse/flameshot.spec:rm -f %{buildroot}%{_libdir}/pkgconfig/QtColorWidgets.pc
packaging/rpm/fedora/flameshot.spec:rm -rf %{buildroot}%{_includedir}/QtColorWidgets
packaging/rpm/fedora/flameshot.spec:rm -rf %{buildroot}%{_libdir}/cmake/QtColorWidgets
packaging/rpm/fedora/flameshot.spec:rm -f %{buildroot}%{_libdir}/libQtColorWidgets.*
packaging/rpm/fedora/flameshot.spec:rm -f %{buildroot}%{_libdir}/pkgconfig/QtColorWidgets.pc
src/widgets/panel/sidepanelwidget.h:#include "QtColorWidgets/color_wheel.hpp"
src/CMakeLists.txt: QtColorWidgets
src/config/colorpickereditor.h:#include "QtColorWidgets/color_wheel.hpp"
src/config/uicoloreditor.h:#include "QtColorWidgets/color_wheel.hpp"
root@ichigo:/home/tigersharke/flameshot-dev/work/flameshot-0f37bf09972c7e66ed78ad0460d2ebce97b82809 #
After a long list of translations I see what it is attempting to find. What we have for our path may be a bit different though. The pkg-plist for x11-toolkits/color-widgets-qt5 gives me this:
tigersharke@ichigo:~ % more /usr/ports/x11-toolkits/color-widgets-qt5/pkg-plist include/QtColorWidgets/AbstractWidgetList include/QtColorWidgets/BoundColorSelector include/QtColorWidgets/ColorDelegate include/QtColorWidgets/ColorDialog include/QtColorWidgets/ColorListWidget include/QtColorWidgets/ColorPreview include/QtColorWidgets/ColorSelector include/QtColorWidgets/ColorWheel include/QtColorWidgets/GradientEditor include/QtColorWidgets/GradientListModel include/QtColorWidgets/GradientSlider include/QtColorWidgets/HarmonyColorWheel include/QtColorWidgets/HueSlider include/QtColorWidgets/QtColorWidgets_version.h include/QtColorWidgets/abstract_widget_list.hpp include/QtColorWidgets/bound_color_selector.hpp include/QtColorWidgets/color_2d_slider.hpp include/QtColorWidgets/color_delegate.hpp include/QtColorWidgets/color_dialog.hpp include/QtColorWidgets/color_line_edit.hpp include/QtColorWidgets/color_list_widget.hpp include/QtColorWidgets/color_names.hpp include/QtColorWidgets/color_palette.hpp include/QtColorWidgets/color_palette_model.hpp include/QtColorWidgets/color_palette_widget.hpp include/QtColorWidgets/color_preview.hpp include/QtColorWidgets/color_selector.hpp include/QtColorWidgets/color_utils.hpp include/QtColorWidgets/color_wheel.hpp include/QtColorWidgets/color_wheel_private.hpp include/QtColorWidgets/colorwidgets_global.hpp include/QtColorWidgets/gradient_delegate.hpp include/QtColorWidgets/gradient_editor.hpp include/QtColorWidgets/gradient_helper.hpp include/QtColorWidgets/gradient_list_model.hpp include/QtColorWidgets/gradient_slider.hpp include/QtColorWidgets/harmony_color_wheel.hpp include/QtColorWidgets/hue_slider.hpp include/QtColorWidgets/swatch.hpp lib/cmake/QtColorWidgets-Qt52/QtColorWidgets-Qt52-%%CMAKE_BUILD_TYPE%%.cmake lib/cmake/QtColorWidgets-Qt52/QtColorWidgets-Qt52.cmake lib/cmake/QtColorWidgets-Qt52/qtcolorwidgets-qt52-config-version.cmake lib/cmake/QtColorWidgets-Qt52/qtcolorwidgets-qt52-config.cmake lib/cmake/QtColorWidgets-Qt52/qtcolorwidgets-qt52-targets-%%CMAKE_BUILD_TYPE%%.cmake lib/cmake/QtColorWidgets-Qt52/qtcolorwidgets-qt52-targets.cmake lib/libQtColorWidgets-Qt52.so lib/libQtColorWidgets-Qt52.so.2 lib/libQtColorWidgets-Qt52.so.2.2.0 libdata/pkgconfig/QtColorWidgets-Qt52.pc tigersharke@ichigo:~ %
The error told us that it couldn't find the directory for the includes, so perhaps we need to be more explicit or modify the src/CMakeLists.txt file in work/flameshot. After no progress with plenty of effort, I decided to patch a file and this got the build process going a bit farther forward but still quit with errors.
root@ichigo:/home/tigersharke/flameshot-dev # cat files/patch-src_CMakeLists.txt
--- src/CMakeLists.txt.orig 2025-11-21 21:00:13 UTC
+++ src/CMakeLists.txt
@@ -226,7 +226,7 @@ target_link_libraries(
Qt${QT_VERSION_MAJOR}::Svg
Qt${QT_VERSION_MAJOR}::Network
Qt${QT_VERSION_MAJOR}::Widgets
- QtColorWidgets
+ /usr/local/include/QtColorWidgets
)
if (UNIX)
target_link_libraries(
I succeeded to get cmake to finally find the QtColorWidgets but now it seems like it still isn't what is expected because some things are different or missing.
slations/Internationalization_zh_HK.qm && cd /home/tigersharke/flameshot-dev/work/.build/src && /usr/local/bin/cmake -E copy /home/tigersharke/flameshot-dev/work/.build/src/Internationalization_zh_TW.qm /home/tigersharke/flameshot-dev/work/.build/src/translations/Internationalization_zh_TW.qm ld: error: undefined symbol: color_widgets::ColorWheel::ColorWheel(QWidget*) >>> referenced by colorpickereditor.cpp >>> src/CMakeFiles/flameshot.dir/config/colorpickereditor.cpp.o:(ColorPickerEditor::ColorPickerEditor(QWidget*)) >>> referenced by sidepanelwidget.cpp >>> src/CMakeFiles/flameshot.dir/widgets/panel/sidepanelwidget.cpp.o:(SidePanelWidget::SidePanelWidget(QPixmap*, QWidget*)) >>> referenced by uicoloreditor.cpp >>> src/CMakeFiles/flameshot.dir/config/uicoloreditor.cpp.o:(UIcolorEditor::initColorWheel()) ld: error: undefined symbol: color_widgets::ColorWheel::setColor(QColor) >>> referenced by colorpickereditor.cpp >>> src/CMakeFiles/flameshot.dir/config/colorpickereditor.cpp.o:(ColorPickerEditor::ColorPickerEditor(QWidget*)) >>> referenced by sidepanelwidget.cpp >>> src/CMakeFiles/flameshot.dir/widgets/panel/sidepanelwidget.cpp.o:(SidePanelWidget::SidePanelWidget(QPixmap*, QWidget*)) >>> referenced by sidepanelwidget.cpp >>> src/CMakeFiles/flameshot.dir/widgets/panel/sidepanelwidget.cpp.o:(SidePanelWidget::onColorChanged(QColor const&)) >>> referenced 4 more times ld: error: undefined symbol: color_widgets::ColorWheel::colorSelected(QColor) >>> referenced by colorpickereditor.cpp >>> src/CMakeFiles/flameshot.dir/config/colorpickereditor.cpp.o:(ColorPickerEditor::ColorPickerEditor(QWidget*)) >>> referenced by sidepanelwidget.cpp >>> src/CMakeFiles/flameshot.dir/widgets/panel/sidepanelwidget.cpp.o:(SidePanelWidget::SidePanelWidget(QPixmap*, QWidget*)) >>> referenced by uicoloreditor.cpp >>> src/CMakeFiles/flameshot.dir/config/uicoloreditor.cpp.o:(UIcolorEditor::initColorWheel()) ld: error: undefined symbol: color_widgets::ColorWheel::staticMetaObject >>> referenced by colorpickereditor.cpp >>> src/CMakeFiles/flameshot.dir/config/colorpickereditor.cpp.o:(ColorPickerEditor::ColorPickerEditor(QWidget*)) >>> referenced by sidepanelwidget.cpp >>> src/CMakeFiles/flameshot.dir/widgets/panel/sidepanelwidget.cpp.o:(SidePanelWidget::SidePanelWidget(QPixmap*, QWidget*)) >>> referenced by uicoloreditor.cpp >>> src/CMakeFiles/flameshot.dir/config/uicoloreditor.cpp.o:(UIcolorEditor::initColorWheel()) ld: error: undefined symbol: color_widgets::ColorWheel::colorChanged(QColor) >>> referenced by uicoloreditor.cpp >>> src/CMakeFiles/flameshot.dir/config/uicoloreditor.cpp.o:(UIcolorEditor::initColorWheel()) c++: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed. ===> Compilation failed unexpectedly. Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer. *** Error code 1 Stop. make: stopped making "install" in /home/tigersharke/flameshot-dev
I should not have needed to patch the file to convince cmake to find QtColorWidgets but even this was not entirely successful. Something seems strange with this project. Does it use Qt5 or Qt6 and does a mish mosh of the two affect how everything fits together? How do I manipulate all of this to make a nice smooth build? Since I am making only limited progress and possibly making a few missteps that may be temporary improvements, I'll try another method.
Since I do not have an updated ports tree member for deskutils/flameshot, I will look at what archlinux has done in their AUR and specifically commentary and changes in their commit
PKGBUILD
+ 13
− 1
@@ -5,7 +5,7 @@
pkgname=flameshot
pkgver=13.0.0
pkgrel=2
pkgrel=3
pkgdesc="Powerful yet simple to use screenshot software"
url="https://github.com/flameshot-org/flameshot"
arch=('x86_64')
@@ -25,10 +25,22 @@ build() {
-DCMAKE_INSTALL_PREFIX=/usr \
-DUSE_WAYLAND_CLIPBOARD=ON \
-DDISABLE_UPDATE_CHECKER=ON \
-DUSE_KDSINGLEAPPLICATION=OFF \
-Wno-dev
cmake --build build
}
package() {
DESTDIR="${pkgdir}" cmake --install build
# Remove vendored static builds of shared libraries (used for single application, which we disable)
# See https://github.com/flameshot-org/flameshot/blob/v13.0.0/packaging/rpm/fedora/flameshot.spec#L64-L70
rm -rf "${pkgdir}/usr/include/QtColorWidgets/" \
"${pkgdir}/usr/include/kdsingleapplication-qt6/" \
"${pkgdir}/usr/lib/cmake/KDSingleApplication-qt6/" \
"${pkgdir}/usr/lib/cmake/QtColorWidgets/" \
"${pkgdir}/usr/lib/libQtColorWidgets.a" \
"${pkgdir}/usr/lib/libkdsingleapplication-qt6.a" \
"${pkgdir}/usr/lib/pkgconfig/QtColorWidgets.pc"
rmdir "${pkgdir}/usr/include/" "${pkgdir}/usr/lib/"{cmake,pkgconfig,}
}
What I have at this point is certainly a lot more "junk" than is necessary in my attempts to satisfy requirements and shut up the complaints about missing stuff. According to the arch folks, the single application part of the build includes the QtColorWidgets and a number of other things. Maybe I can do something similar for my unofficial port. I am unsure but it may be that all those deleted things mentioned above are part of a tarball of some sort, so it will probably look differently for me, unless if they're among what is in the initial extracted tarball.
I am at an impasse. The best I can do is the error output below and I have no idea how to get beyond it.
ld: error: undefined symbol: color_widgets::ColorWheel::ColorWheel(QWidget*) >>> referenced by sidepanelwidget.cpp >>> src/CMakeFiles/flameshot.dir/widgets/panel/sidepanelwidget.cpp.o:(SidePanelWidget::SidePanelWidget(QPixmap*, QWidget*)) ld: error: undefined symbol: color_widgets::ColorWheel::setColor(QColor) >>> referenced by sidepanelwidget.cpp >>> src/CMakeFiles/flameshot.dir/widgets/panel/sidepanelwidget.cpp.o:(SidePanelWidget::SidePanelWidget(QPixmap*, QWidget*)) >>> referenced by sidepanelwidget.cpp >>> src/CMakeFiles/flameshot.dir/widgets/panel/sidepanelwidget.cpp.o:(SidePanelWidget::onColorChanged(QColor const&)) >>> referenced by sidepanelwidget.cpp >>> src/CMakeFiles/flameshot.dir/widgets/panel/sidepanelwidget.cpp.o:(SidePanelWidget::onColorGrabAborted()) ld: error: undefined symbol: color_widgets::ColorWheel::colorSelected(QColor) >>> referenced by sidepanelwidget.cpp >>> src/CMakeFiles/flameshot.dir/widgets/panel/sidepanelwidget.cpp.o:(SidePanelWidget::SidePanelWidget(QPixmap*, QWidget*)) ld: error: undefined symbol: color_widgets::ColorWheel::staticMetaObject >>> referenced by sidepanelwidget.cpp >>> src/CMakeFiles/flameshot.dir/widgets/panel/sidepanelwidget.cpp.o:(SidePanelWidget::SidePanelWidget(QPixmap*, QWidget*)) ld: error: undefined symbol: UIcolorEditor::UIcolorEditor(QWidget*) >>> referenced by visualseditor.cpp >>> src/CMakeFiles/flameshot.dir/config/visualseditor.cpp.o:(VisualsEditor::initWidgets()) ld: error: undefined symbol: ColorPickerEditor::ColorPickerEditor(QWidget*) >>> referenced by visualseditor.cpp >>> src/CMakeFiles/flameshot.dir/config/visualseditor.cpp.o:(VisualsEditor::initWidgets()) ld: error: undefined symbol: UIcolorEditor::updateComponents() >>> referenced by visualseditor.cpp >>> src/CMakeFiles/flameshot.dir/config/visualseditor.cpp.o:(VisualsEditor::updateComponents()) c++: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed. ===> Compilation failed unexpectedly. Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer. *** Error code 1 Stop. make: stopped making "install" in /home/tigersharke/flameshot-dev
I am patching a few files which seems to help me get as far as this in the build but I cannot seem to get the build to find exactly what it needs. If I didn't need to deal with the Qt or Qt6 stuff, I would not but it is integral to how flameshot interfaces with the desktop. I don't know how the patch I mentioned earlier fails to help the build find the QtColorWidgets since the listing of that directory is below.
root@ichigo:/home/tigersharke/flameshot-dev # ls /usr/local/include/QtColorWidgets abstract_widget_list.hpp color_dialog.hpp color_palette.hpp ColorDelegate colorwidgets_global.hpp GradientEditor HueSlider AbstractWidgetList color_line_edit.hpp color_preview.hpp ColorDialog gradient_delegate.hpp GradientListModel QtColorWidgets_version.h bound_color_selector.hpp color_list_widget.hpp color_selector.hpp ColorListWidget gradient_editor.hpp GradientSlider swatch.hpp BoundColorSelector color_names.hpp color_utils.hpp ColorPreview gradient_helper.hpp harmony_color_wheel.hpp color_2d_slider.hpp color_palette_model.hpp color_wheel_private.hpp ColorSelector gradient_list_model.hpp HarmonyColorWheel color_delegate.hpp color_palette_widget.hpp color_wheel.hpp ColorWheel gradient_slider.hpp hue_slider.hpp root@ichigo:/home/tigersharke/flameshot-dev #
root@ichigo:/home/tigersharke/flameshot-dev # cat files/patch-src_config_CMakeLists.txt
--- src/config/CMakeLists.txt.orig 2025-11-22 01:50:14 UTC
+++ src/config/CMakeLists.txt
@@ -3,8 +3,6 @@ target_sources(
PRIVATE buttonlistview.cpp
cacheutils.cpp
clickablelabel.cpp
- colorpickereditmode.cpp
- colorpickereditor.cpp
configerrordetails.cpp
configresolver.cpp
configwindow.cpp
@@ -15,6 +13,5 @@ target_sources(
shortcutswidget.cpp
strftimechooserwidget.cpp
styleoverride.cpp
- uicoloreditor.cpp
visualseditor.cpp
)
root@ichigo:/home/tigersharke/flameshot-dev #
I am out of ideas, it seems this situation is unique to flameshot and how it may be using a mix of Qt5 and Qt6 along with the compat5 shim code. I looked at the Gentoo build instructions and those are not any more help than those of Arch. Sometimes these ports that I attempt to shoehorn into FreeBSD need time to adjust something or other which can be cured with our ports tree infrastructure, Mk scripts, and everything. If anyone has any bright ideas how to get this working, they are welcome to make a PR on my github for flameshot-dev. The flameshot in ports (12.1.0_1) is still considerably behind right now, release is 13.3.0 as of last month.
No comments:
Post a Comment