libksane, KSaneCore and QT_NO_KEYWORDS
Tobias Leupold
tl at stonemx.de
Thu Sep 29 12:19:37 BST 2022
Am Donnerstag, 29. September 2022, 12:09:10 CEST schrieb Christophe
Giboudeaux:
> libksane is still needed by a couple applications:
> https://lxr.kde.org/search?%21v=kf5-qt5&_filestring=&_string=KF5%3A%3ASane
Yeah, sure, Scandoc was one of those -- but the problem is that on can't build
the code anymore against newer versions of libksane. The code before the port
(last commit was ea5fe5b890147d0f70235ae9dcdeb022fe7df8a3) compiles without a
problem against libksane 22.04.3, but with version 22.08.1, I get:
In file included from /home/tobias/tmp/git/scandoc/build/scandoc_autogen/
UVLADIE3JM/moc_ScannerSettingsWidget.cpp:10,
from /home/tobias/tmp/git/scandoc/build/scandoc_autogen/
mocs_compilation.cpp:9:
/home/tobias/tmp/git/scandoc/build/scandoc_autogen/UVLADIE3JM/../../../
src/ScannerSettingsWidget.h:9:10: fatal error: KSaneCore: No such file or
directory
9 | #include <KSaneCore>
| ^~~~~~~~~~~
because libksane doesn't include or at least install the respective header(s)
anymore ...
On my Gentoo machine with 22.04.3, the following headers are installed:
/usr/include/KF5/KSane/ksane_export.h
/usr/include/KF5/KSane/KSaneWidget
/usr/include/KF5/KSane/KSaneCore
/usr/include/KF5/KSane/KSaneOption
/usr/include/KF5/KSane/ksanewidget.h
/usr/include/KF5/KSane/ksanecore.h
/usr/include/KF5/KSane/ksaneoption.h
/usr/include/KF5/ksane_version.h
On the Artix machine with 22.08.1 (and also if I upgrade the lib on Gentoo),
only
/usr/include/KF5/KSane/KSaneWidget
/usr/include/KF5/KSane/ksane_export.h
/usr/include/KF5/KSane/ksanewidget.h
/usr/include/KF5/ksane_version.h
remain. So ... nothing besides KSaneWidget ... and if some code uses
libksane's KSaneCore and KSaneOption headers, it can't be built against
22.08.1 anymore ... also, one can't use the new KSaneCore lib as a drop-in
replacement, as the namespaces as well as some signal signatures have been
changed.
Don't get me wrong, It's of course the right thing to do to retire libksane in
favor of KSaneCore. But I would have expected to see some emphasized "Don't
use me anymore, port your stuff to KSaneCore, libksane will be discontinued
soon" warning for at least some time, before an upgrade leaves non-ported code
uncompilable ...
> > The KSaneCore API docs say that one should use
> > "target_link_libraries(yourapp KF5::SaneCore)" in CMakeLists.txt to link
> > against it. That actually didn't work, I had to use
> > "target_link_libraries(scandoc ... KSane::Core)" to make it work. Am I
> > missing something, or should either the documentation be changed and/or
> > the
> > "KF5::SaneCore" target be added/defined?
>
> The change is intentional: https://invent.kde.org/libraries/ksanecore/-/
> commit/40c3d3687aee
>
> The metainfo.yaml also needs an update
Thanks for the clarification!
More information about the kde-devel
mailing list