kColorPicker icon indicating copy to clipboard operation
kColorPicker copied to clipboard

How should downstream Linux distros handle Qt5/Qt6 coexistance?

Open hosiet opened this issue 1 year ago • 2 comments

With kcolorpicker v0.3.0, the solution seemed to be straightforward. It introduced libkColorPicker-Qt5 and libkColorPicker-Qt6. When building shared libraries, they can be installed together without conflict since they are of different names.

With kcolorpicker v0.3.1 ( specifically https://github.com/ksnip/kColorPicker/commit/f58d6ad957b11b29639e209e95e0eb1efb7fb119 ), the shared libraries built all have the file name libkColorPicker.so.0.x. This means that the Qt5 and Qt6 versions of shared library cannot be installed together. (In the meanwhile, the headers and CMake files can coexist because they are placed under usr/include/kColorPicker-Qt{5,6}/ and usr/lib/*/cmake/kColorPicker-Qt{5,6}/, respectively.

As Debian packager, I would like to know how you would like us to provide the kColorPicker in Debian and its derivatives (e.g., Ubuntu). Do you expect that everything move to Qt6 as Arch Linux, or do you want to make coexistance possible? That will determine how I change the packaging structure at https://tracker.debian.org/pkg/kcolorpicker .

hosiet avatar Mar 19 '24 22:03 hosiet

I will also have to mention that switching from Qt5 to Qt6 is a major API breakage that should be accompanied with SONAME bump. I would suggest both kcolorpicker project and kimageannotator project to raise their SONAME (0 -> 1) to avoid any issues.

Another very important thing worth mentioning is that the kimageannotator library is being used by external projects:

-> % aptitude why libkcolorpicker0
i   task-kde-desktop    Depends    kde-standard
p   kde-standard        Depends    gwenview (>= 4:22.12.3)
p   gwenview            Depends    libkimageannotator0 (>= 0.6.0)
p   libkimageannotator0 Depends    libkcolorpicker0 (>= 0.2.0)

While the latest version of gwenview has migrated to Qt6, older releases may still depends on Qt5 and Qt5 flavor of libkimageannotator. Taking it into consideration, I believe (1) the SONAME bump is necessary, and (2) Qt5/Qt6 library coexistance would be helpful (though not an absolute must).

hosiet avatar Mar 19 '24 22:03 hosiet

For openSUSE, we applied tiny changes to kcolorpicker and kimageannotator to make them coinstallable again.

kcolorpicker:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1d15048..cd61fd8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,6 +65,7 @@ set_target_properties(kColorPicker
 					  RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin
 		 			  VERSION ${PROJECT_VERSION}
 					  SOVERSION 0
+					  OUTPUT_NAME kColorPicker-Qt${QT_MAJOR_VERSION}
 					  )
 
 install(TARGETS kColorPicker

kimageannotator:


diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8f3516e..6a12399 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -97,6 +97,7 @@ set_target_properties(kImageAnnotator
 					  RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin
 					  VERSION ${PROJECT_VERSION}
 					  SOVERSION 0
+					  OUTPUT_NAME kImageAnnotator-Qt${QT_MAJOR_VERSION}
 					  )
 
 install(TARGETS kImageAnnotator

and https://github.com/ksnip/ksnip/commit/76f4b3819 to our ksnip package.

krop avatar Mar 20 '24 18:03 krop