*/*: [QA] Fix trivial cases of MissingTestRestrict
[gentoo.git] / media-gfx / alembic / alembic-1.7.11.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python2_7 )
7
8 inherit cmake-utils multiprocessing python-single-r1
9
10 DESCRIPTION="Open framework for storing and sharing scene data"
11 HOMEPAGE="https://www.alembic.io/"
12 SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
13
14 LICENSE="BSD"
15
16 SLOT="0"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="arnold +boost doc examples hdf5 maya prman python test zlib"
19 RESTRICT="!test? ( test )"
20
21 # pyalembic python bindings need boost
22 REQUIRED_USE="
23         ${PYTHON_REQUIRED_USE}
24         hdf5? ( zlib )
25         python? ( boost )
26 "
27
28 RDEPEND="
29         ${PYTHON_DEPS}
30         >=media-libs/openexr-2.3.0:=
31         boost? ( >=dev-libs/boost-1.65.0:=[python,${PYTHON_USEDEP}] )
32         hdf5? ( >=sci-libs/hdf5-1.10.2:=[zlib(+)] )
33         python? ( >=dev-python/pyilmbase-2.3.0[${PYTHON_USEDEP}] )
34         zlib? ( >=sys-libs/zlib-1.2.11-r1 )
35 "
36 DEPEND="
37         ${RDEPEND}
38         doc? ( >=app-doc/doxygen-1.8.14-r1 )
39 "
40
41 DOCS=( "ACKNOWLEDGEMENTS.txt" "FEEDBACK.txt" "NEWS.txt" "README.txt" )
42
43 PATCHES=(
44         "${FILESDIR}/${P}-0001-Fix-to-find-boost-with-cmake-3.11.patch"
45         "${FILESDIR}/${P}-0002-Find-IlmBase-by-setting-a-proper-ILMBASE_ROOT-value.patch"
46         "${FILESDIR}/${P}-0003-Fix-env-var-for-renderman.patch"
47         "${FILESDIR}/${P}-0004-Fix-a-compile-issue-with-const.patch"
48         "${FILESDIR}/${P}-0005-Fix-install-locations.patch"
49         "${FILESDIR}/${P}-0006-python-PyAlembic-Tests-CMakeLists.txt-fix-variable.patch"
50 )
51
52 src_prepare() {
53         cmake-utils_src_prepare
54         if use doc; then
55                 doxygen -u Doxyfile || die "Failed to update Doxyfile"
56                 sed -i -e 's|DOT_NUM_THREADS[ \t]*= 0|DOT_NUM_THREADS = '$(makeopts_jobs)'|' Doxyfile || die "Failed to change dot threads"
57         fi
58 }
59
60 src_configure() {
61         local mycmakeargs=(
62                 -DALEMBIC_SHARED_LIBS=ON
63                 # The CMakeLists.txt file needs C++11 or C++-0x if none of them
64                 # is defined
65                 -DALEMBIC_LIB_USES_BOOST=$(usex boost)
66                 -DALEMBIC_LIB_USES_TR1=$(usex !boost)
67                 -DUSE_ARNOLD=$(usex arnold)
68                 -DUSE_BINARIES=ON
69                 -DUSE_EXAMPLES=$(usex examples)
70                 -DUSE_HDF5=$(usex hdf5)
71                 -DUSE_MAYA=$(usex maya)
72                 -DUSE_PRMAN=$(usex prman)
73                 -DUSE_PYALEMBIC=$(usex python)
74                 -DUSE_TESTS=$(usex test)
75         )
76         cmake-utils_src_configure
77 }
78
79 src_compile() {
80         cmake-utils_src_compile
81         if use doc; then
82                 doxygen Doxyfile || die "Failed to build documentation"
83         fi
84 }
85
86 src_install() {
87         use doc && local HTML_DOCS=( doc/html/. )
88         cmake-utils_src_install
89 }
90
91 pkg_postinst() {
92         if use arnold; then
93                 einfo "NOTE: The arnold plugin is highly experimental and hasn't been"
94                 einfo "tested, due to missing license. If you have trouble compiling"
95                 einfo "or running it, please file a bug report for the package at"
96                 einfo "Gentoo's bugzilla."
97         fi
98         if use maya; then
99                 einfo "NOTE: The maya plugin is highly experimental and hasn't been"
100                 einfo "tested, due to missing license. If you have trouble compiling"
101                 einfo "or running it, please file a bug report for the package at"
102                 einfo "Gentoo's bugzilla."
103         fi
104         if use prman; then
105                 einfo "If you're looking for an ebuild for renderman, you may want to"
106                 einfo "try the waebbl overlay: 'eselect repository enable waebbl'"
107                 einfo "followed by 'emerge renderman'"
108         fi
109 }