Skip to content

Commit

Permalink
media-libs/ctl: restrict dependency on media-libs/openexr
Browse files Browse the repository at this point in the history
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: ampas/CTL#100
Closes: https://bugs.gentoo.org/878247
Signed-off-by: Bernd Waibel <[email protected]>
  • Loading branch information
waebbl committed Nov 15, 2022
1 parent e183a77 commit b10b070
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 0 deletions.
41 changes: 41 additions & 0 deletions media-libs/ctl/ctl-1.5.2-r3.ebuild
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
From https://github.com/ampas/CTL/commit/370a12c39061da9141bcc538d59df36f6f48031b
From 370a12c39061da9141bcc538d59df36f6f48031b Mon Sep 17 00:00:00 2001
From: michaeldsmith <[email protected]>
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<float> &pixels,
bool exr_read(const char *name, float scale,
ctl::dpx::fb<float> *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<float> &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

0 comments on commit b10b070

Please sign in to comment.