From d005fdeda834b19d1924954f926fcf1edad56272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Mon, 20 Mar 2023 12:37:03 +0700 Subject: [PATCH] imath: split PyImath CMake config Fix build kio-extras --- .../patches/split-pyimath-cmake-target.patch | 39 +++++++++++++++++++ srcpkgs/imath/template | 8 ++-- 2 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 srcpkgs/imath/patches/split-pyimath-cmake-target.patch diff --git a/srcpkgs/imath/patches/split-pyimath-cmake-target.patch b/srcpkgs/imath/patches/split-pyimath-cmake-target.patch new file mode 100644 index 00000000000..94d8b9ca65c --- /dev/null +++ b/srcpkgs/imath/patches/split-pyimath-cmake-target.patch @@ -0,0 +1,39 @@ +--- a/config/ImathConfig.cmake.in ++++ b/config/ImathConfig.cmake.in +@@ -4,4 +4,7 @@ + @PACKAGE_INIT@ + + include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") ++if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/PyImathTargets.cmake") ++ include("${CMAKE_CURRENT_LIST_DIR}/PyImathTargets.cmake") ++endif() + check_required_components("@PROJECT_NAME@") +--- a/src/python/config/ModuleDefine.cmake ++++ b/src/python/config/ModuleDefine.cmake +@@ -52,7 +52,7 @@ function(PYIMATH_ADD_LIBRARY_PRIV libnam + add_library(${PROJECT_NAME}::${libname} ALIAS ${libname}) + + install(TARGETS ${libname} +- EXPORT ${PROJECT_NAME} ++ EXPORT PyImath + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +--- a/src/python/config/CMakeLists.txt ++++ b/src/python/config/CMakeLists.txt +@@ -7,8 +7,14 @@ + add_library(PyImathConfig INTERFACE) + target_include_directories(PyImathConfig INTERFACE + $) +-install(TARGETS PyImathConfig EXPORT ${PROJECT_NAME}) ++install(TARGETS PyImathConfig EXPORT PyImath) + add_library(PyImath::Config ALIAS PyImathConfig) ++install(EXPORT PyImath ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/PyImath ++ FILE PyImathTargets.cmake ++ NAMESPACE Imath:: ++ EXPORT_LINK_INTERFACE_LIBRARIES ++) + + if(IMATH_INSTALL_PKG_CONFIG) + # use a helper function to avoid variable pollution, but pretty simple diff --git a/srcpkgs/imath/template b/srcpkgs/imath/template index 02417c31b54..892e103b02d 100644 --- a/srcpkgs/imath/template +++ b/srcpkgs/imath/template @@ -1,7 +1,7 @@ # Template file for 'imath' pkgname=imath version=3.1.6 -revision=2 +revision=3 build_style=cmake configure_args="-DPYTHON=ON" hostmakedepends="python3-numpy" @@ -28,8 +28,7 @@ imath-python3_package() { short_desc+=" - Python module" pkg_install() { vmove "usr/lib/libPyImath*.so.*" - vmove "${py3_sitelib}/imath.so" - vmove "${py3_sitelib}/imathnumpy.so" + vmove "${py3_sitelib}" } } @@ -39,6 +38,7 @@ imath-python3-devel_package() { short_desc+=" - Python module - development files" pkg_install() { vmove "usr/include/Imath/Py*" + vmove "usr/lib/cmake/PyImath*" vmove usr/lib/pkgconfig/PyImath.pc vmove "usr/lib/libPyImath*.so" } @@ -51,7 +51,7 @@ imath-devel_package() { pkg_install() { vmove "usr/include/Imath/half*" vmove "usr/include/Imath/Imath*" - vmove usr/lib/cmake + vmove "usr/lib/cmake/Imath*" vmove usr/lib/pkgconfig/Imath.pc vmove "usr/lib/libImath*.so" }