properly attempt to locate the kioslave bin in $libexec AND $libexec/kf5
ClosedPublic

Authored by sitter on Feb 4 2019, 2:31 PM.

Details

Summary

the kioslave harness is installed to LIBEXEC_KF5 which is '$libexec/' on
win32 (technically $bindir) and '$libexec/kf5/' everywhere else.
since we cannot expect qt.conf to point to the $libexec/kf5/ path
(what with other bits of the application or libraries wanting to find
their own stuff in libexec), we need to explicitly try to search the
suffixed version as well. IOW: the expectation is that the path is
/foo/libexec/ and we'll also want to check /foo/libexec/kf5/ as that
is where the binary may be located on !win32.

this enables !win32 builds to be somewhat more relocatable, so long as
qt.conf contains a suitable path config

Diff Detail

Repository
R241 KIO
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 7861
Build 7879: arc lint + arc unit
sitter created this revision.Feb 4 2019, 2:31 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptFeb 4 2019, 2:31 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
sitter requested review of this revision.Feb 4 2019, 2:31 PM
sitter added a comment.EditedFeb 4 2019, 2:34 PM

BTW, am I missing something or shouldn't this entire kioslave lookup be made static? It only needs computing once but currently is run for every new slave that gets started (in fork-mode).

apol added a subscriber: apol.Feb 12 2019, 2:35 PM

Would it make sense to just install it in libexec and remove the difference between platforms?

sitter added a comment.EditedFeb 12 2019, 2:41 PM

Generally yes, I am not sure we can do that very well for 5.x though. The LIBEXECDIR_KF5 where kioslave is installed is controlled by ECM, that's where the conditional split between suffix-or-not happens, so unless we add another LIBEXECDIR_KF5_REAL which does away with the conditional and then explicitly install kioslave using LIBEXECDIR_KF5_REAL I don't think we can fix it. (and a second LIBEXEC var may only be confusing; the thought of it certainly doesn't excite me).

from KDEInstallDirs.cmake

if(WIN32)
    _define_relative(LIBEXECDIR BINDIR ""
        "executables for internal use by programs and libraries"
        LIBEXEC_INSTALL_DIR)
    _define_non_cache(LIBEXECDIR_KF5 "${CMAKE_INSTALL_LIBEXECDIR}")
else()
    _define_relative(LIBEXECDIR LIBDIR "libexec"
        "executables for internal use by programs and libraries"
        LIBEXEC_INSTALL_DIR)
    _define_non_cache(LIBEXECDIR_KF5 "${CMAKE_INSTALL_LIBEXECDIR}/kf5")
endif()

Oh, we could maybe use GNUInstallDirs.cmake's LIBEXECDIR on !Win32?

like so:
https://phabricator.kde.org/P317

I am not sure if there are any downsides to this. CMake code-wise I am not sure we should workaround implementation details of ECM in such a way.

apol accepted this revision.Feb 12 2019, 4:48 PM

eh... LGTM and nobody seems to have a big problem with it either.

This revision is now accepted and ready to land.Feb 12 2019, 4:48 PM
This revision was automatically updated to reflect the committed changes.