From b10b0703b7fa4a1dbe1666a5d854d95c9fe17997 Mon Sep 17 00:00:00 2001 From: Bernd Waibel Date: Tue, 15 Nov 2022 07:49:48 +0100 Subject: [PATCH] media-libs/ctl: restrict dependency on media-libs/openexr Package currently doesn't build with OpenEXR-3/Imath. This revision adds an upstream patch to disable certain tests if no OpenEXR-2 is available and thus needs to depend on IlmBase only. Bug: https://github.com/ampas/CTL/issues/100 Closes: https://bugs.gentoo.org/878247 Signed-off-by: Bernd Waibel --- media-libs/ctl/ctl-1.5.2-r3.ebuild | 41 ++++++++++++ ...der-does-not-compile-without-openexr.patch | 63 +++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 media-libs/ctl/ctl-1.5.2-r3.ebuild create mode 100644 media-libs/ctl/files/ctl-1.5.2-Issues-0101-ctlrender-does-not-compile-without-openexr.patch diff --git a/media-libs/ctl/ctl-1.5.2-r3.ebuild b/media-libs/ctl/ctl-1.5.2-r3.ebuild new file mode 100644 index 00000000000000..5cc899976225f5 --- /dev/null +++ b/media-libs/ctl/ctl-1.5.2-r3.ebuild @@ -0,0 +1,41 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake + +DESCRIPTION="AMPAS' Color Transformation Language" +HOMEPAGE="https://github.com/ampas/CTL" +SRC_URI="https://github.com/ampas/CTL/archive/${P}.tar.gz" +S="${WORKDIR}/CTL-ctl-${PV}" + +LICENSE="AMPAS" +SLOT="0" +KEYWORDS="~amd64 ~ia64 ~ppc64 ~x86" +IUSE="test" + +RESTRICT="!test? ( test )" + +RDEPEND="media-libs/ilmbase:= + media-libs/tiff:= + !media-libs/openexr_ctl" +DEPEND="${RDEPEND}" +BDEPEND="virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}/${P}-Use-GNUInstallDirs-and-fix-PkgConfig-files-1.patch" + "${FILESDIR}/${P}-openexr-2.3.patch" + "${FILESDIR}/${P}-fix-to-build-with-gcc-11.patch" + "${FILESDIR}/${P}-install-dpx-library.patch" + "${FILESDIR}/${P}-fix-unit-tests.patch" + "${FILESDIR}/${P}-Issues-0101-ctlrender-does-not-compile-without-openexr.patch" +) + +mycmakeargs=( -DCMAKE_INSTALL_DOCDIR="share/doc/${PF}" ) + +src_test() { + pushd "${BUILD_DIR}" >/dev/null || die + eninja check + popd >/dev/null || die +} diff --git a/media-libs/ctl/files/ctl-1.5.2-Issues-0101-ctlrender-does-not-compile-without-openexr.patch b/media-libs/ctl/files/ctl-1.5.2-Issues-0101-ctlrender-does-not-compile-without-openexr.patch new file mode 100644 index 00000000000000..ae250ab33d69e4 --- /dev/null +++ b/media-libs/ctl/files/ctl-1.5.2-Issues-0101-ctlrender-does-not-compile-without-openexr.patch @@ -0,0 +1,63 @@ +From https://github.com/ampas/CTL/commit/370a12c39061da9141bcc538d59df36f6f48031b +From 370a12c39061da9141bcc538d59df36f6f48031b Mon Sep 17 00:00:00 2001 +From: michaeldsmith <37905569+michaeldsmith@users.noreply.github.com> +Date: Mon, 14 Nov 2022 07:23:21 -0800 +Subject: [PATCH 1/2] Issues/0101 ctlrender does not compile without openexr + (#103) + +* add no openexr workflow + +* update unittest cmakelists for openexr not found + +* correct the exr_write() stub function prototype + +* fixes #101 + +Changes to github workflow removed from patch for Gentoo + +--- a/ctlrender/exr_file.cc ++++ b/ctlrender/exr_file.cc +@@ -258,12 +258,17 @@ void exr_write(const char *name, float scale, const ctl::dpx::fb &pixels, + bool exr_read(const char *name, float scale, + ctl::dpx::fb *pixels, + format_t *bpp) { ++// fprintf(stderr, "WARNING on line %d of file %s in function %s(): exr_read() function was called but OpenEXR library was not found\n", ++// __LINE__, __FILE__, __FUNCTION__); + return FALSE; + } + + void exr_write(const char *name, float scale, + const ctl::dpx::fb &pixels, +- format_t *format) { ++ format_t *format, ++ Compression *compression) { ++// fprintf(stderr, "WARNING on line %d of file %s in function %s(): exr_write() function was called but OpenEXR library was not found\n", ++// __LINE__, __FILE__, __FUNCTION__); + } + + #endif +--- a/unittest/IlmCtlMath/CMakeLists.txt ++++ b/unittest/IlmCtlMath/CMakeLists.txt +@@ -5,9 +5,6 @@ add_executable(IlmCtlMathTest + testGaussRec.cpp + ) + +-include_directories( ${OpenEXR_INCLUDE_DIRS} ) +-link_directories( ${OpenEXR_LIBRARY_DIRS} ) +- + include_directories( "${CMAKE_CURRENT_SOURCE_DIR}" + "${PROJECT_SOURCE_DIR}/lib/IlmCtlMath" ) + +--- a/unittest/IlmImfCtl/CMakeLists.txt ++++ b/unittest/IlmImfCtl/CMakeLists.txt +@@ -1,3 +1,7 @@ ++if ( NOT OpenEXR_FOUND ) ++ message(WARNING "OpenEXR not found, skipping IlmImfCtl unit test") ++ return() ++endif() + + include_directories( ${OpenEXR_INCLUDE_DIRS} ) + link_directories( ${OpenEXR_LIBRARY_DIRS} ) +-- +2.38.1 +