CMake: revert un-versioning of libcalamares*.so

The install-bits branch commit 83639b182b
dropped .so-versioning for libcalamares and the creation of the Python-
support symlink. This broke KDE Neon dev-unstable because the embedded
Python can no longer find libcalamares.

Installing unversioned .so's straight to LIBDIR is also not a good thing
(according to Debian), so revert to the original scheme with versioned
.so and a Python-support symlink.

Medium-term fix is to install unversioned straight into LIBDIR/calamares
and fix up the RPATH for the executable.
This commit is contained in:
Adriaan de Groot 2018-03-01 12:37:52 +01:00
parent 73a5e0bbcd
commit 09f30194d7
2 changed files with 11 additions and 1 deletions

View File

@ -83,6 +83,8 @@ add_library( calamares SHARED ${libSources} ${kdsagSources} ${utilsSources} )
set_target_properties( calamares
PROPERTIES
AUTOMOC TRUE
VERSION ${CALAMARES_VERSION_SHORT}
SOVERSION ${CALAMARES_VERSION_SHORT}
)
target_link_libraries( calamares
@ -92,10 +94,18 @@ target_link_libraries( calamares
install( TARGETS calamares
EXPORT CalamaresLibraryDepends
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
# Make symlink lib/calamares/libcalamares.so to lib/libcalamares.so.VERSION so
# lib/calamares can be used as module path for the Python interpreter.
install( CODE "
file( MAKE_DIRECTORY \"\$ENV{DESTDIR}/${CMAKE_INSTALL_FULL_LIBDIR}/calamares\" )
execute_process( COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ../libcalamares.so.${CALAMARES_VERSION_SHORT} libcalamares.so WORKING_DIRECTORY \"\$ENV{DESTDIR}/${CMAKE_INSTALL_FULL_LIBDIR}/calamares\" )
")
# Install header files
file( GLOB rootHeaders "*.h" )
file( GLOB kdsingleapplicationguardHeaders "kdsingleapplicationguard/*.h" )

View File

@ -78,5 +78,5 @@ calamares_add_library( calamaresui
Qt5::QuickWidgets
RESOURCES libcalamaresui.qrc
EXPORT CalamaresLibraryDepends
NO_VERSION
VERSION ${CALAMARES_VERSION_SHORT}
)