From 09f30194d799231a63d63814cccc7ab913beb46b Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 1 Mar 2018 12:37:52 +0100 Subject: [PATCH] CMake: revert un-versioning of libcalamares*.so The install-bits branch commit 83639b182baaf4d992e7e98083852b664f8a757e 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. --- src/libcalamares/CMakeLists.txt | 10 ++++++++++ src/libcalamaresui/CMakeLists.txt | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/libcalamares/CMakeLists.txt b/src/libcalamares/CMakeLists.txt index 94e9145d6..2a1cfeb20 100644 --- a/src/libcalamares/CMakeLists.txt +++ b/src/libcalamares/CMakeLists.txt @@ -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" ) diff --git a/src/libcalamaresui/CMakeLists.txt b/src/libcalamaresui/CMakeLists.txt index 4d0ec8281..7c3e8fca2 100644 --- a/src/libcalamaresui/CMakeLists.txt +++ b/src/libcalamaresui/CMakeLists.txt @@ -78,5 +78,5 @@ calamares_add_library( calamaresui Qt5::QuickWidgets RESOURCES libcalamaresui.qrc EXPORT CalamaresLibraryDepends - NO_VERSION + VERSION ${CALAMARES_VERSION_SHORT} )