Warning: there may be occasional oddness due to css and blog edits. **Active remodel of blog posts - mostly starting with most recent** 70/86
Showing posts with label flameshot. Show all posts
Showing posts with label flameshot. Show all posts

Thursday, April 30, 2026

flameshot qt6 update success

Commits on Nov 20, 2025

    Save my place,
    
Commits on Nov 18, 2025

    Update to May 17th upstream commit.
    Update to May 14th upstream commit.
    Update to May 12th upstream commit.
    Update to May 11th upstream commit.
    Update to May 10th upstream commit.
    Update to May 2nd upstream commit.
    Update to May 1st upstream commit.
    Update to April 28th upstream commit.
    Update to April 27th upstream commit.
    Update to April 7th upstream commit.
    Update to March 17th upstream commit.
    Update to March 7th upstream commit.
    Update to March 4th upstream commit.
    Update to Feb 26th upstream commit.

I once wrote in a blog post:

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.
...

Now to the present, quite a while later, though not like I didn't frequently look at the git repos since then somewhat longingly for closure.

This whole process was set aside, put on hold.  I couldn't at the time figure it out.  I am not sure if something in the /usr/ports/Mk files changed, updated, improved in the time between November 2025 and now but surely something did.  I finally succeeded and also realized some new methods to find information.

The error output above was due to my patch file that added an include directory instead of a library, but now it is corrected.

patch-src_CMakeLists.txt
root@ichigo:/home/tigersharke/GitRepos/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/lib/libQtColorWidgets-Qt52.so
 )
 if (UNIX)
 target_link_libraries(

When I am searching for dependencies, I can go to /usr/ports and search grep -R QtColorWidgets * to find any file in all of those directories that has that mentioned.  I can look in /usr/ports/devel to see if I can find other dependencies and install them, then use pkg info x11-toolkits/color-widgets-qt5 to see what it installs, and choose the shared library line.

pkginfo
root@ichigo:/home/tigersharke/GitRepos/flameshot-dev # pkg info x11-toolkits/color-widgets-qt5
color-widgets-qt5-2.2.0
Name           : color-widgets-qt5
Version        : 2.2.0
Installed on   : Sun Apr 12 20:03:27 2026 CDT
Origin         : x11-toolkits/color-widgets-qt5
Architecture   : FreeBSD:15:amd64
Prefix         : /usr/local
Categories     : x11-toolkits
Licenses       : LGPL3
Maintainer     : yuri@FreeBSD.org
WWW            : https://gitlab.com/mattia.basaglia/Qt-Color-Widgets
Comment        : Qt (C++) widgets to manage color inputs
Shared Libs required:
        libQt5Core.so.5
        libQt5Gui.so.5
        libQt5Widgets.so.5
        libc++.so.1
        libc.so.7
        libcxxrt.so.1
        libgcc_s.so.1
        libm.so.5
Shared Libs provided:
        libQtColorWidgets-Qt52.so.2
Annotations    :
        FreeBSD_version: 1500507
Flat size      : 585KiB
Description    :
Qt-Color-Widgets is a color dialog that is more user-friendly than the default
QColorDialog and several other color-related widgets.

The provided widgets are:
* ColorWheel, An analog widget used to select a color
* ColorPreview, A simple widget that displays a color
* GradientSlider, A slider that has a gradient background
* HueSlider, A variant of GradientSlider that has a rainbow background
* ColorSelector, A ColorPreview that shows a ColorDialog when clicked
* ColorDialog, A dialog that uses the above widgets to provide a better user
  experience than QColorDialog
* ColorListWidget, A widget to edit a list of colors
* Swatch, A widget to display a color palette
* ColorPaletteWidget, A widget to use and manage a list of palettes
* Color2DSlider, An analog widget used to select 2 color components
* ColorLineEdit, A widget to manipulate a string representing a color
* HarmonyColorWheel, A ColorWheel which allows defining multiple colors,
  separated by hue
* GradientListModel, A QAbstractListModel used to list gradients (useful for
  comboboxes, list views and the like)

Things for qt are somewhat of a mixed bag, some libraries go to expected directories or those that are more obvious, others not so much.

/usr/local/lib/qt5/libQt5Gui.so 
/usr/local/lib/qt6/libQt6DesignerComponents.so 
/usr/local/lib/libkdsingleapplication-qt6.so

If I look in each of those library directories I can find whether there is any other library for libQtColorWidgets though this is a sort of autocomplete output by pressing tab.

root@ichigo:/home/tigersharke/GitRepos/flameshot-dev # ls /usr/local/lib/libQtColorWidgets-Qt52.so.2
libQtColorWidgets-Qt52.so.2.2.0* libQtColorWidgets-Qt52.so.2@

What baffled me for a long time after everything sucessfully built, was that I couldn't do make makeplist > pkg-plist to make the pkg-plist file.  I figured it out though and it probably is not very obvious.  I had a mistake in my USES line due to my previous repeated iterations to get the change for qt6 from the upstream update to work, build.

USES=	cmake qmake qt:5 qt:6 desktop-file-utils gl

When I removed qmake from that line, the pkg-plist was generated as expected.  I updated my repo for this to keep my successful build but now that I cured the pkg-plist issue, I can make another update for the Makefile and add the pkg-plist file it needs as well.  Definitely this whole belated success and that last nit finally cured are reasons to celebrate

If you're updating an official port or one mainly for yourself that you provide to the public also, or creating a new port based on something in an upstream git repo, it may take time to figure it out.  Maybe you need a break when frustration gets to an unbearable level, but be sure to return sometime later and see if you can see what was wrong that was clouded by emotion.  Maybe upstream will have changed its code enough that now those same problems no longer apply, or perhaps mechanisms for porting in FreeBSD may have been improved.

There are plenty of sources for information, and ways to find it.  grep -R keyword * can help dig through things in /usr/ports/Mk to find the option or a clue how to succeed.  Do the search in /usr/ports to find how someone else may have tackled the same issue, similar ports.  Search within a patch file by using that as the key word, like grep -R patch- * because any patch in a port's leaf directory will be in its files subdirectory given a "patch-" prefix in its name.  And remember, FreeBSD Porter's Handbook and FreeBSD Discord are options for help among many.

UPDATE:
I have discovered that although it built perfectly and created all the files, something is wrong because taking a screenshot fails to save a png that is a real png.  I am looking into things, expecting that somewhere a dependency may be wrong or some other odd issue related to how I convinced flameshot to build.

Wednesday, November 26, 2025

flameshot qt6 conversion fail

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:

make
                -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.

make
# 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.

patch-src_CMakeLists.txt
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 #

The other patch is below, that I thought would either cause another build error or avoid the part that seems to need the QtColorWidgets.

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
 )

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.

Frequently viewed this week