Hello community, here is the log from the commit of package qhull for openSUSE:Factory checked in at 2020-07-14 07:55:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/qhull (Old) and /work/SRC/openSUSE:Factory/.qhull.new.3060 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "qhull" Tue Jul 14 07:55:25 2020 rev:19 rq:820425 version:2019.1 Changes: -------- --- /work/SRC/openSUSE:Factory/qhull/qhull.changes 2020-02-20 14:53:22.842051160 +0100 +++ /work/SRC/openSUSE:Factory/.qhull.new.3060/qhull.changes 2020-07-14 07:58:08.889567881 +0200 @@ -1,0 +2,9 @@ +Wed Jul 8 19:22:43 UTC 2020 - Stefan BrĂ¼ns <[email protected]> + +- Fix static library references in CMake files, replace + 0001-Link-tools-to-shared-library.patch with upstream + 0001-Allow-disabling-of-static-or-shared-library-builds.patch +- Also remove references to tools in CMake files, add + 0002-Remove-tools-from-CMake-exported-targets.patch + +------------------------------------------------------------------- Old: ---- 0001-Link-tools-to-shared-library.patch New: ---- 0001-Allow-disabling-of-static-or-shared-library-builds.patch 0002-Remove-tools-from-CMake-exported-targets.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ qhull.spec ++++++ --- /var/tmp/diff_new_pack.IUUgWV/_old 2020-07-14 07:58:09.793570808 +0200 +++ /var/tmp/diff_new_pack.IUUgWV/_new 2020-07-14 07:58:09.797570821 +0200 @@ -27,8 +27,10 @@ Group: Development/Libraries/C and C++ URL: http://www.qhull.org Source0: http://www.qhull.org/download/qhull-%{srcyear}-src-%{srcver}.tgz -# PATCH-FIX-OPENUSE -- https://github.com/qhull/qhull/issues/57 -Patch0: 0001-Link-tools-to-shared-library.patch +# PATCH-FIX-UPSTREAM -- https://github.com/qhull/qhull/pull/69 +Patch0: 0001-Allow-disabling-of-static-or-shared-library-builds.patch +# PATCH-FIX-OPENSUSE +Patch1: 0002-Remove-tools-from-CMake-exported-targets.patch BuildRequires: cmake BuildRequires: gcc-c++ @@ -79,19 +81,19 @@ %prep %setup -q %patch0 -p1 +%patch1 -p1 %build %cmake \ -DDOC_INSTALL_DIR="%{_docdir}/%{name}" \ -DINCLUDE_INSTALL_DIR="%{_includedir}" \ - -DLIB_INSTALL_DIR"=%{_libdir}" \ + -DLIB_INSTALL_DIR="%{_lib}" \ -DBIN_INSTALL_DIR="%{_bindir}" \ -DMAN_INSTALL_DIR="%{_mandir}/man1/" %make_jobs %install %cmake_install -rm %{buildroot}%{_libdir}/*.a # Fixup wrong location %if "%{_lib}" != "lib" mv %{buildroot}%{_prefix}/lib/cmake %{buildroot}%{_libdir}/ @@ -101,7 +103,6 @@ %postun -n libqhull%{sonum} -p /sbin/ldconfig %files -%defattr(-,root,root) %license COPYING.txt %doc src/Changes.txt %{_docdir}/%{name}/ @@ -114,7 +115,6 @@ %{_mandir}/man1/* %files -n libqhull%{sonum} -%defattr(-,root,root) %license COPYING.txt %{_libdir}/libqhull.so.%{sonum} %{_libdir}/libqhull.so.%{srcver} @@ -124,7 +124,6 @@ %{_libdir}/libqhull_r.so.%{srcver} %files devel -%defattr(-,root,root) %license COPYING.txt %{_includedir}/libqhull/ %{_includedir}/libqhull_r/ ++++++ 0001-Allow-disabling-of-static-or-shared-library-builds.patch ++++++ >From ffaa43a4d63997e64acfdbeeceabc2df774fa61b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <[email protected]> Date: Wed, 8 Jul 2020 20:18:06 +0200 Subject: [PATCH 1/2] Allow disabling of static or shared library builds If the standard CMake options BUILD_STATIC_LIBS or BUILD_SHARED_LIBS are set to off, the respective set of libraries is excluded from "make all" and installation. As disabling static libraries implies using shared libraries for the tools (qhull, qhalf etc.), add a matching option. The tools will be linked statically by default (if static libs are enabled), but shared linking can be forced by LINK_APPS_SHARED=ON. Fixes https://github.com/qhull/qhull/issues/57 --- CMakeLists.txt | 69 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 56 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 07d3da2..62690d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,6 +79,18 @@ include(CMakeModules/CheckLFS.cmake) option(WITH_LFS "Enable Large File Support" ON) check_lfs(WITH_LFS) +include(CMakeDependentOption) +# Build shared and static libs by default +option(BUILD_STATIC_LIBS "Build static libraries" ON) +option(BUILD_SHARED_LIBS "Build shared libraries" ON) +# When shared libs are built, allow to use it for linking the apps +set(_NO_STATIC_LIBS NOCACHE INTERNAL (NOT ${BUILD_STATIC_LIBS})) +cmake_dependent_option(LINK_APPS_SHARED "Use shared libraries for linking applications" + _NO_STATIC_LIBS + "BUILD_SHARED_LIBS;BUILD_STATIC_LIBS" + ${BUILD_SHARED_LIBS} +) + if(INCLUDE_INSTALL_DIR) else() set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include) @@ -117,6 +129,9 @@ message(STATUS "Include Directory (INCLUDE_INSTALL_DIR): ${INCLUDE_INSTALL_DIR message(STATUS "Documentation Directory (DOC_INSTALL_DIR): ${DOC_INSTALL_DIR}") message(STATUS "Man Pages Directory (MAN_INSTALL_DIR): ${MAN_INSTALL_DIR}") message(STATUS "Build Type (CMAKE_BUILD_TYPE): ${CMAKE_BUILD_TYPE}") +message(STATUS "Build static libraries: ${BUILD_STATIC_LIBS}") +message(STATUS "Build shared libraries: ${BUILD_SHARED_LIBS}") +message(STATUS "Use shared libraries for linking apps: ${LINK_APPS_SHARED}") message(STATUS "To override these options, add -D{OPTION_NAME}=... to the cmake command") message(STATUS " Build the debug targets -DCMAKE_BUILD_TYPE=Debug") message(STATUS) @@ -351,10 +366,10 @@ else() set(qhull_STATICR qhullstatic_r) endif() -set( - qhull_TARGETS_INSTALL - ${qhull_CPP} ${qhull_STATIC} ${qhull_STATICR} ${qhull_SHAREDR} - qhull rbox qconvex qdelaunay qvoronoi qhalf +set(qhull_TARGETS_TOOLS qhull rbox qconvex qdelaunay qvoronoi qhalf) +set(qhull_TARGETS_STATIC ${qhull_CPP} ${qhull_STATIC} ${qhull_STATICR}) +set(qhull_TARGETS_SHARED + ${qhull_SHAREDR} ${qhull_SHARED} ${qhull_SHAREDP} # Deprecated, use qhull_r instead ) set( @@ -469,11 +484,23 @@ set_target_properties(${qhull_CPP} PROPERTIES VERSION ${qhull_VERSION}) # --------------------------------------- -# Define qhull executables linked to qhullstatic library +# Exclude shared or static library builds from "make all" if disabled +# --------------------------------------- +if(NOT ${BUILD_STATIC_LIBS}) + set_target_properties(${qhull_STATIC} PROPERTIES EXCLUDE_FROM_ALL TRUE) + set_target_properties(${qhull_STATICR} PROPERTIES EXCLUDE_FROM_ALL TRUE) + set_target_properties(${qhull_CPP} PROPERTIES EXCLUDE_FROM_ALL TRUE) +endif() +if(NOT ${BUILD_SHARED_LIBS}) + set_target_properties(${qhull_SHARED} PROPERTIES EXCLUDE_FROM_ALL TRUE) + set_target_properties(${qhull_SHAREDR} PROPERTIES EXCLUDE_FROM_ALL TRUE) + set_target_properties(${qhull_SHAREDP} PROPERTIES EXCLUDE_FROM_ALL TRUE) +endif() + +# --------------------------------------- +# Define qhull executables linked to qhullstatic/qhull library # qhull is linked to reentrant qhull (more flexible) # the others are linked to non-reentrant qhull (somewhat faster) -# -# If you prefer dynamic linking, use qhull_SHAREDR or qhull_SHARED instead. # --------------------------------------- set(qhull_SOURCES src/qhull/unix_r.c) @@ -483,23 +510,31 @@ set(qdelaunay_SOURCES src/qdelaunay/qdelaun.c) set(qvoronoi_SOURCES src/qvoronoi/qvoronoi.c) set(qhalf_SOURCES src/qhalf/qhalf.c) +if (LINK_APPS_SHARED) + set(qhull_LIBRARY ${qhull_SHARED}) + set(qhull_LIBRARYR ${qhull_SHAREDR}) +else() + set(qhull_LIBRARY ${qhull_STATIC}) + set(qhull_LIBRARYR ${qhull_STATICR}) +endif() + add_executable(qhull ${qhull_SOURCES}) -target_link_libraries(qhull ${qhull_STATICR}) +target_link_libraries(qhull ${qhull_LIBRARYR}) add_executable(rbox ${rbox_SOURCES}) -target_link_libraries(rbox ${qhull_STATIC}) +target_link_libraries(rbox ${qhull_LIBRARY}) add_executable(qconvex ${qconvex_SOURCES}) -target_link_libraries(qconvex ${qhull_STATIC}) +target_link_libraries(qconvex ${qhull_LIBRARY}) add_executable(qdelaunay ${qdelaunay_SOURCES}) -target_link_libraries(qdelaunay ${qhull_STATIC}) +target_link_libraries(qdelaunay ${qhull_LIBRARY}) add_executable(qvoronoi ${qvoronoi_SOURCES}) -target_link_libraries(qvoronoi ${qhull_STATIC}) +target_link_libraries(qvoronoi ${qhull_LIBRARY}) add_executable(qhalf ${qhalf_SOURCES}) -target_link_libraries(qhalf ${qhull_STATIC}) +target_link_libraries(qhalf ${qhull_LIBRARY}) # --------------------------------------- # Define options for linking to qhull_SHAREDR or qhull_SHARED @@ -617,6 +652,14 @@ add_test(NAME user_eg3 # Define install # --------------------------------------- +set(qhull_TARGETS_INSTALL ${qhull_TARGETS_TOOLS}) +if (BUILD_SHARED_LIBS) + list(APPEND qhull_TARGETS_INSTALL ${qhull_TARGETS_SHARED}) +endif() +if (BUILD_STATIC_LIBS) + list(APPEND qhull_TARGETS_INSTALL ${qhull_TARGETS_STATIC}) +endif() + install(TARGETS ${qhull_TARGETS_INSTALL} EXPORT QhullTargets RUNTIME DESTINATION ${BIN_INSTALL_DIR} LIBRARY DESTINATION ${LIB_INSTALL_DIR} -- 2.27.0 ++++++ 0002-Remove-tools-from-CMake-exported-targets.patch ++++++ >From 855c0e402b03516f4b6e87271dc5e64a4cb78dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <[email protected]> Date: Wed, 8 Jul 2020 20:55:06 +0200 Subject: [PATCH 2/2] Remove tools from CMake exported targets Exporting tools is only useful for binaries required in the build process of dependent project, like code generators. The exported targets would force their installation when using CMake for the build process, otherwise CMake bails out on find_package(Qhull), noting some required component is not available. --- CMakeLists.txt | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 62690d5..11534af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -652,20 +652,22 @@ add_test(NAME user_eg3 # Define install # --------------------------------------- -set(qhull_TARGETS_INSTALL ${qhull_TARGETS_TOOLS}) +install(TARGETS ${qhull_TARGETS_TOOLS} EXPORT + RUNTIME DESTINATION ${BIN_INSTALL_DIR}) + if (BUILD_SHARED_LIBS) - list(APPEND qhull_TARGETS_INSTALL ${qhull_TARGETS_SHARED}) + install(TARGETS ${qhull_TARGETS_SHARED} EXPORT QhullTargets + LIBRARY DESTINATION ${LIB_INSTALL_DIR} + ARCHIVE DESTINATION ${LIB_INSTALL_DIR} + INCLUDES DESTINATION include) endif() if (BUILD_STATIC_LIBS) - list(APPEND qhull_TARGETS_INSTALL ${qhull_TARGETS_STATIC}) + install(TARGETS ${qhull_TARGETS_STATIC} EXPORT QhullTargets + LIBRARY DESTINATION ${LIB_INSTALL_DIR} + ARCHIVE DESTINATION ${LIB_INSTALL_DIR} + INCLUDES DESTINATION include) endif() -install(TARGETS ${qhull_TARGETS_INSTALL} EXPORT QhullTargets - RUNTIME DESTINATION ${BIN_INSTALL_DIR} - LIBRARY DESTINATION ${LIB_INSTALL_DIR} - ARCHIVE DESTINATION ${LIB_INSTALL_DIR} - INCLUDES DESTINATION include) - include(CMakePackageConfigHelpers) write_basic_package_version_file( -- 2.27.0
