Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Openexr 3.2 #931

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tools/MINGW-packages/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ mingw-w64-qt4
mingw-w64-shiboken
mingw-w64-pyside
mingw-w64-imath
mingw-w64-libdeflate
mingw-w64-openexr
mingw-w64-libraw-gpl2
mingw-w64-opencolorio2-git
Expand Down
1 change: 1 addition & 0 deletions tools/MINGW-packages/build_natron_package_repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ CWD=$(pwd)
PKGS="
mingw-w64-natron-setup
mingw-w64-imath
mingw-w64-libdeflate
mingw-w64-openexr
mingw-w64-libraw-gpl2
mingw-w64-opencolorio2-git
Expand Down
5 changes: 3 additions & 2 deletions tools/MINGW-packages/get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ VERSION="current"
TMP="${CWD}/tmp-${VERSION}"
URL="https://sourceforge.net/projects/natron/files/MINGW-packages"
PKGS="
mingw-w64-x86_64-imath-3.1.7-99.1-any.pkg.tar.zst
mingw-w64-x86_64-openexr-3.1.7-99.1-any.pkg.tar.zst
mingw-w64-x86_64-imath-3.1.9-99.1-any.pkg.tar.zst
mingw-w64-x86_64-libdeflate-1.19-99.1-any.pkg.tar.zst
mingw-w64-x86_64-openexr-3.2.1-99.1-any.pkg.tar.zst
mingw-w64-x86_64-opencolorio-git-1356.66b7b7d5-99.1-any.pkg.tar.zst
mingw-w64-x86_64-openimageio-2.4.10.0-99.1-any.pkg.tar.zst
mingw-w64-x86_64-ffmpeg-gpl2-4.4.3-99.1-any.pkg.tar.zst
Expand Down
17 changes: 17 additions & 0 deletions tools/MINGW-packages/mingw-w64-libdeflate/002-pkg-config.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--- libdeflate-1.15/libdeflate.pc.in.orig 2022-12-05 05:40:10.000000000 +0100
+++ libdeflate-1.15/libdeflate.pc.in 2022-12-05 20:32:35.832915600 +0100
@@ -7,12 +7,5 @@
Description: Fast implementation of DEFLATE, zlib, and gzip
Version: @PROJECT_VERSION@
Libs: -L${libdir} -ldeflate
-Cflags: -I${includedir}
-
-# Note: this library's public header allows LIBDEFLATE_DLL to be defined when
-# linking to the DLL on Windows, to make __declspec(dllimport) be used.
-# However, the only way to define a shared-library-only flag in a pkgconfig file
-# is to use the weird workaround of unconditionally defining it in Cflags, then
-# undefining it in Cflags.private. Just don't bother with this, since
-# __declspec(dllimport) is optional anyway. It is a very minor performance
-# optimization that is irrelevant for most use cases of libdeflate.
+Cflags: -I${includedir} -DLIBDEFLATE_DLL
+Cflags.private: -ULIBDEFLATE_DLL
54 changes: 54 additions & 0 deletions tools/MINGW-packages/mingw-w64-libdeflate/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
_realname=libdeflate
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.19
pkgrel=99.1
pkgdesc="Heavily optimized library for DEFLATE/zlib/gzip compression and decompression (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
url='https://github.com/ebiggers/libdeflate'
license=('spdx:MIT')
makedepends=(
"${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-ninja"
)
source=(${_realname}-${pkgver}.tar.gz::"${url}/archive/v${pkgver}.tar.gz"
"002-pkg-config.patch")
sha256sums=('27bf62d71cd64728ff43a9feb92f2ac2f2bf748986d856133cc1e51992428c25'
'7feb96b6466375824af54a829dfe0d5cbd641970d64ef9fe0f9f4ab5e18040dd')

prepare() {
cd "${srcdir}"/${_realname}-${pkgver}

patch -p1 -i "${srcdir}"/002-pkg-config.patch
}

build() {
cd "${srcdir}/${_realname}-${pkgver}"
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

MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
"${MINGW_PREFIX}"/bin/cmake.exe \
-GNinja \
-DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \
"${extra_config[@]}" \
../${_realname}-${pkgver}

"${MINGW_PREFIX}"/bin/cmake.exe --build .
}

package() {
cd "${srcdir}/build-${MSYSTEM}"

DESTDIR="${pkgdir}" "${MINGW_PREFIX}"/bin/cmake.exe --install .

install -Dm644 "${srcdir}"/${_realname}-${pkgver}/COPYING "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/COPYING
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
Description: OpenEXR image library
Version: @OPENEXR_VERSION@

-Libs: @exr_pthread_libs@ -L${libdir} -lOpenEXR${libsuffix} -lOpenEXRUtil${libsuffix} -lOpenEXRCore${libsuffix} -lIex${libsuffix} -lIlmThread${libsuffix}
+Libs: @exr_pthread_libs@ -L${libdir} -lOpenEXR -lOpenEXRUtil -lOpenEXRCore -lIex -lIlmThread
-Libs: @exr_pthread_libs@ -L${libdir} -lOpenEXR${libsuffix} -lOpenEXRUtil${libsuffix} -lOpenEXRCore${libsuffix} -lIex${libsuffix} -lIlmThread${libsuffix} @EXR_DEFLATE_LDFLAGS@
+Libs: @exr_pthread_libs@ -L${libdir} -lOpenEXR -lOpenEXRUtil -lOpenEXRCore -lIex -lIlmThread @EXR_DEFLATE_LDFLAGS@
Cflags: -I${includedir} -I${OpenEXR_includedir} @exr_pthread_cflags@
Requires: Imath
Libs.private: @zlib_link@
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--- a/src/lib/OpenEXR/ImfAttribute.h
+++ b/src/lib/OpenEXR/ImfAttribute.h
@@ -215,14 +215,14 @@
}

template <class T>
-inline T&
+T&
TypedAttribute<T>::value ()
{
return _value;
}

template <class T>
-inline const T&
+const T&
TypedAttribute<T>::value () const
{
return _value;
25 changes: 12 additions & 13 deletions tools/MINGW-packages/mingw-w64-openexr/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
_realname=openexr
pkgbase=mingw-w64-natron_${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-natron_${_realname}")
pkgver=3.1.8
pkgver=3.2.1
pkgrel=99.1
pkgdesc='A high dynamic-range image file format library (mingw-w64)'
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
url="https://www.openexr.com/"
license=('BSD')
license=('spdx:BSD-3-Clause')
depends=("${MINGW_PACKAGE_PREFIX}-natron_imath"
"${MINGW_PACKAGE_PREFIX}-libwinpthread-git"
"${MINGW_PACKAGE_PREFIX}-zlib")
"${MINGW_PACKAGE_PREFIX}-libdeflate"
"${MINGW_PACKAGE_PREFIX}-libwinpthread-git")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-ninja")
Expand All @@ -26,9 +26,11 @@ replaces=(
"${MINGW_PACKAGE_PREFIX}-pyilmbase"
)
source=("https://github.com/openexr/openexr/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz"
0006-cmake-soversion.patch)
sha256sums=('3ff47111ef7e5da6f69330e66e1e90ae620b79df1cedf2512bb9bffe86c2c617'
'e65852ac2e5545472ad90830c97e964aa2c71e1795979a8b9867155d578d45ed')
0006-cmake-soversion.patch
0007-export-TypedAttribute-value.patch)
sha256sums=('61e175aa2203399fb3c8c2288752fbea3c2637680d50b6e306ea5f8ffdd46a9b'
'a5ce463815e8d05c879dbe6a255e9f8ac2697cd3ef4242dac1e5cb331f78ed02'
'204777b48cde1c4d390789f10c5e429d5295be701f68a7937a90d0ecf271c048')

# Helper macros to help make tasks easier #
apply_patch_with_msg() {
Expand All @@ -43,7 +45,8 @@ prepare(){
cd "${srcdir}/${_realname}-${pkgver}"

apply_patch_with_msg \
0006-cmake-soversion.patch
0006-cmake-soversion.patch \
0007-export-TypedAttribute-value.patch
}

build() {
Expand All @@ -56,10 +59,6 @@ build() {
extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
fi

if [[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]]; then
extra_config+=("-DOPENEXR_BUILD_TOOLS=OFF")
fi

CXXFLAGS+=" -Wno-ignored-attributes"

MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
Expand All @@ -70,7 +69,7 @@ build() {
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTING=OFF \
-DOPENEXR_INSTALL_EXAMPLES=OFF \
-DOPENEXR_INSTALL_PKG_CONFIG=ON \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this and the OPENEXR_BUILD_TOOLS=OFF logic above being removed? Are then no longer needed/defined in the new version of OPENEXR?

-DOPENEXR_BUILD_TOOLS=OFF \
../${_realname}-${pkgver}

${MINGW_PREFIX}/bin/cmake --build .
Expand Down