From 7c2b16a3004f6f66cffe373f5d35deee87ec042f Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Sat, 26 Feb 2022 18:25:01 +0530 Subject: [PATCH] [new-package] Imath 3.1.5 --- mingw-w64-imath/0001-cmake-libs-name.patch | 22 ++++++ .../0002-fix-openexr-clang-build.patch | 20 ++++++ mingw-w64-imath/PKGBUILD | 72 +++++++++++++++++++ 3 files changed, 114 insertions(+) create mode 100644 mingw-w64-imath/0001-cmake-libs-name.patch create mode 100644 mingw-w64-imath/0002-fix-openexr-clang-build.patch create mode 100644 mingw-w64-imath/PKGBUILD diff --git a/mingw-w64-imath/0001-cmake-libs-name.patch b/mingw-w64-imath/0001-cmake-libs-name.patch new file mode 100644 index 0000000000..1b09a8ddd3 --- /dev/null +++ b/mingw-w64-imath/0001-cmake-libs-name.patch @@ -0,0 +1,22 @@ +--- a/config/Imath.pc.in ++++ b/config/Imath.pc.in +@@ -13,5 +13,5 @@ + Version: @IMATH_VERSION@ + Requires: + Conflicts: +-Libs: -L${libdir} -lImath${libsuffix} ++Libs: -L${libdir} -lImath + Cflags: -I${includedir} -I${includedir}/Imath +--- a/config/LibraryDefine.cmake ++++ b/config/LibraryDefine.cmake +@@ -79,7 +79,9 @@ + endif() + + set_target_properties(${libname} PROPERTIES +- OUTPUT_NAME "${libname}${IMATH_LIB_SUFFIX}" ++ OUTPUT_NAME "${libname}" ++ RUNTIME_OUTPUT_NAME "${libname}${IMATH_LIB_SUFFIX}" ++ ARCHIVE_OUTPUT_NAME "${libname}" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" + ) + add_library(${PROJECT_NAME}::${libname} ALIAS ${libname}) diff --git a/mingw-w64-imath/0002-fix-openexr-clang-build.patch b/mingw-w64-imath/0002-fix-openexr-clang-build.patch new file mode 100644 index 0000000000..576220ab3b --- /dev/null +++ b/mingw-w64-imath/0002-fix-openexr-clang-build.patch @@ -0,0 +1,20 @@ +--- a/src/Imath/ImathVec.h ++++ b/src/Imath/ImathVec.h +@@ -873,7 +873,7 @@ + //---------------------------------------------------------------------------- + + /// @cond Doxygen_Suppress +- ++/* + // Vec2 + template <> IMATH_HOSTDEVICE short Vec2::length() const IMATH_NOEXCEPT = delete; + template <> IMATH_HOSTDEVICE const Vec2& Vec2::normalize() IMATH_NOEXCEPT = delete; +@@ -954,7 +954,7 @@ + template <> IMATH_HOSTDEVICE Vec4 Vec4::normalized() const IMATH_NOEXCEPT = delete; + template <> Vec4 Vec4::normalizedExc() const = delete; + template <> IMATH_HOSTDEVICE Vec4 Vec4::normalizedNonNull() const IMATH_NOEXCEPT = delete; +- ++*/ + /// @endcond Doxygen_Suppress + + //------------------------ diff --git a/mingw-w64-imath/PKGBUILD b/mingw-w64-imath/PKGBUILD new file mode 100644 index 0000000000..84863fca74 --- /dev/null +++ b/mingw-w64-imath/PKGBUILD @@ -0,0 +1,72 @@ +# Maintainer: Biswapriyo Nath + +_realname=imath +pkgbase=mingw-w64-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") +pkgver=3.1.5 +pkgrel=1 +pkgdesc='A C++ and python library of 2D and 3D vector, matrix, and math operations for computer graphics (mingw-w64)' +url='https://www.openexr.com/' +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32') +license=('BSD') +depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs") +makedepends=("${MINGW_PACKAGE_PREFIX}-boost" + "${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-cmake" + "${MINGW_PACKAGE_PREFIX}-ninja" + "${MINGW_PACKAGE_PREFIX}-python" + "${MINGW_PACKAGE_PREFIX}-python-numpy") +optdepends=("${MINGW_PACKAGE_PREFIX}-python: python bindings" + "${MINGW_PACKAGE_PREFIX}-boost: python bindings") +source=("https://github.com/AcademySoftwareFoundation/Imath/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz" + 0001-cmake-libs-name.patch + 0002-fix-openexr-clang-build.patch) +sha256sums=('1e9c7c94797cf7b7e61908aed1f80a331088cc7d8873318f70376e4aed5f25fb' + '2dc2de52e2475cc9d725ff443466d3ac247a405018f1d9b0caeb03a9d5116d9b' + '0eea3c7b57d5b59887f963d696c2afdcfb1976a3913f161995e19b13d6a65086') + +prepare() { + cd "Imath-${pkgver}" + patch -p1 -i "${srcdir}/0001-cmake-libs-name.patch" + if [[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]]; then + patch -p1 -i "${srcdir}/0002-fix-openexr-clang-build.patch" + fi +} + +build() { + [[ -d "${srcdir}/build-${MSYSTEM}" ]] && rm -rf "${srcdir}/build-${MSYSTEM}" + mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}" + + declare -a _extra_config + if check_option "debug" "n"; then + _extra_config+=("-DCMAKE_BUILD_TYPE=Release") + else + _extra_config+=("-DCMAKE_BUILD_TYPE=Debug") + fi + + # ld.lld: error: too many exported symbols (max 65535) + if [[ ${MINGW_PACKAGE_PREFIX} != *-clang-* ]]; then + _extra_config+=("-DPYTHON=ON") + fi + + MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ + ${MINGW_PREFIX}/bin/cmake.exe \ + -G "Ninja" \ + "${_extra_config[@]}" \ + -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ + -DBUILD_SHARED_LIBS=ON \ + -DBUILD_TESTING=OFF \ + -DPython_EXECUTABLE=${MINGW_PREFIX}/bin/python.exe \ + -DIMATH_INSTALL_PKG_CONFIG=ON \ + ../Imath-${pkgver} + + ${MINGW_PREFIX}/bin/cmake.exe --build . +} + +package() { + cd "${srcdir}/build-${MSYSTEM}" + DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake.exe --install ./ + + install -Dm644 "${srcdir}/Imath-${pkgver}/LICENSE.md" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE.md" +}