*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / media-libs / opencolorio / opencolorio-1.1.0-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 # Compatibility with Python 3 is declared by upstream, but it is broken in fact, check on bump
7 PYTHON_COMPAT=( python{2_7,3_6} )
8
9 inherit cmake-utils python-single-r1 vcs-snapshot
10
11 DESCRIPTION="A color management framework for visual effects and animation"
12 HOMEPAGE="http://opencolorio.org/"
13
14 SRC_URI="https://github.com/imageworks/OpenColorIO/archive/v${PV}.tar.gz -> ${P}.tar.gz"
15
16 LICENSE="BSD"
17 SLOT="0"
18 KEYWORDS="amd64 x86"
19 IUSE="cpu_flags_x86_sse2 doc opengl python static-libs test"
20 REQUIRED_USE="
21         doc? ( python )
22         python? ( ${PYTHON_REQUIRED_USE} )"
23
24 RDEPEND="
25         opengl? (
26                 media-libs/lcms:2
27                 media-libs/openimageio
28                 media-libs/glew:=
29                 media-libs/freeglut
30                 virtual/opengl
31         )
32         python? ( ${PYTHON_DEPS} )
33         >=dev-cpp/yaml-cpp-0.5
34         dev-libs/tinyxml"
35
36 DEPEND="${RDEPEND}
37         virtual/pkgconfig
38         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"
39
40 # Restricting tests, bugs #439790 and #447908
41 RESTRICT="test"
42
43 PATCHES=(
44         "${FILESDIR}/${P}-fix-compile-error-with-Lut1DOp.cpp.patch"
45         "${FILESDIR}/${P}-use-GNUInstallDirs-and-fix-cmake-install-location.patch"
46         "${FILESDIR}/${P}-remove-building-of-bundled-programs.patch"
47         "${FILESDIR}/${P}-yaml-cpp-0.6.patch"
48         "${FILESDIR}/${P}-remove-Werror.patch"
49 )
50
51 pkg_setup() {
52         use python && python-single-r1_pkg_setup
53 }
54
55 src_prepare() {
56         cmake-utils_src_prepare
57
58         use python && python_fix_shebang .
59 }
60
61 src_configure() {
62         # Missing features:
63         # - Truelight and Nuke are not in portage for now, so their support are disabled
64         # - Java bindings was not tested, so disabled
65         # Notes:
66         # - OpenImageIO is required for building ociodisplay and ocioconvert (USE opengl)
67         # - OpenGL, GLUT and GLEW is required for building ociodisplay (USE opengl)
68         local mycmakeargs=(
69                 -DOCIO_BUILD_JNIGLUE=OFF
70                 -DOCIO_BUILD_NUKE=OFF
71                 -DOCIO_BUILD_SHARED=ON
72                 -DOCIO_BUILD_STATIC=$(usex static-libs)
73                 -DOCIO_STATIC_JNIGLUE=OFF
74                 -DOCIO_BUILD_TRUELIGHT=OFF
75                 -DUSE_EXTERNAL_LCMS=ON
76                 -DUSE_EXTERNAL_TINYXML=ON
77                 -DUSE_EXTERNAL_YAML=ON
78                 -DOCIO_BUILD_DOCS=$(usex doc)
79                 -DOCIO_BUILD_APPS=$(usex opengl)
80                 -DOCIO_BUILD_PYGLUE=$(usex python)
81                 -DOCIO_USE_SSE=$(usex cpu_flags_x86_sse2)
82                 -DOCIO_BUILD_TESTS=$(usex test)
83                 -DCMAKE_INSTALL_DOCDIR="share/doc/${PF}"
84                 -DCMAKE_DISABLE_FIND_PACKAGE_LATEX=ON # They don't build
85         )
86         cmake-utils_src_configure
87 }