Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/opensubdiv/
Date: Sat, 09 Oct 2021 04:21:51
Message-Id: 1633753269.e4dfe173407c47cbd202d3fd062f949a11b31e12.sam@gentoo
1 commit: e4dfe173407c47cbd202d3fd062f949a11b31e12
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 9 04:16:23 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 9 04:21:09 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e4dfe173
7
8 media-libs/opensubdiv: add 3.4.4
9
10 Drops docs support as it requires Python 2.
11
12 Closes: https://bugs.gentoo.org/774264
13 Closes: https://bugs.gentoo.org/815172
14 Signed-off-by: Sam James <sam <AT> gentoo.org>
15
16 media-libs/opensubdiv/Manifest | 1 +
17 media-libs/opensubdiv/opensubdiv-3.4.4.ebuild | 85 +++++++++++++++++++++++++++
18 2 files changed, 86 insertions(+)
19
20 diff --git a/media-libs/opensubdiv/Manifest b/media-libs/opensubdiv/Manifest
21 index 9d551e63ade..ab281bfc665 100644
22 --- a/media-libs/opensubdiv/Manifest
23 +++ b/media-libs/opensubdiv/Manifest
24 @@ -1 +1,2 @@
25 DIST opensubdiv-3.4.3.tar.gz 39225589 BLAKE2B adb3a3e786999029e5b71659425ed49ea1939a92e2d8ba39ae6abf25ec02c873b8b1bdd34d2e32f843911c7acf5e277a779f82621863fbe0641f772e7603beed SHA512 44fd1361d9e7f48c3fa84f3420ed34743571220602aefb082a42f769ca5b8e9ac21907ce8714f6e3a2caadd75adae03c535a1949a8e6450dfea9ae7a2247cfc2
26 +DIST opensubdiv-3.4.4.tar.gz 39228037 BLAKE2B 53bada3ff2652c6041a3becaf037b593c0e1e4c1bd57a285e6c068c11060b06f9ab0617284a57d0e8974f80082abd6563930ede8b1d6bfb801bfa61dd3256445 SHA512 fc8f28b79347015c8991150535c1339e695d96947c72fadd4fa27b546a0813c1125cd175ee03bed5aacdb3609f74c4e526ef70103d1195ba9f7df041e73ea9fb
27
28 diff --git a/media-libs/opensubdiv/opensubdiv-3.4.4.ebuild b/media-libs/opensubdiv/opensubdiv-3.4.4.ebuild
29 new file mode 100644
30 index 00000000000..20acfdfe73a
31 --- /dev/null
32 +++ b/media-libs/opensubdiv/opensubdiv-3.4.4.ebuild
33 @@ -0,0 +1,85 @@
34 +# Copyright 1999-2021 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=7
38 +
39 +CMAKE_MAKEFILE_GENERATOR=emake
40 +
41 +inherit cmake toolchain-funcs
42 +
43 +MY_PV="$(ver_rs "1-3" '_')"
44 +DESCRIPTION="An Open-Source subdivision surface library"
45 +HOMEPAGE="https://graphics.pixar.com/opensubdiv/docs/intro.html"
46 +SRC_URI="https://github.com/PixarAnimationStudios/OpenSubdiv/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
47 +S="${WORKDIR}/OpenSubdiv-${MY_PV}"
48 +
49 +# Modfied Apache-2.0 license, where section 6 has been replaced.
50 +# See for example CMakeLists.txt for details.
51 +LICENSE="Apache-2.0"
52 +SLOT="0"
53 +KEYWORDS="~amd64 ~arm ~arm64 ~x86"
54 +IUSE="cuda examples opencl openmp ptex tbb test tutorials"
55 +RESTRICT="!test? ( test )"
56 +
57 +RDEPEND="
58 + media-libs/glew:=
59 + media-libs/glfw:=
60 + x11-libs/libXinerama
61 + cuda? ( dev-util/nvidia-cuda-toolkit:* )
62 + opencl? ( virtual/opencl )
63 + ptex? ( media-libs/ptex )
64 +"
65 +DEPEND="
66 + ${RDEPEND}
67 + tbb? ( dev-cpp/tbb )
68 +"
69 +BDEPEND="
70 + cuda? ( <sys-devel/gcc-9[cxx] )
71 +"
72 +
73 +PATCHES=(
74 + "${FILESDIR}/${PN}-3.3.0-use-gnuinstalldirs.patch"
75 + "${FILESDIR}/${PN}-3.3.0-add-CUDA9-compatibility.patch"
76 + "${FILESDIR}/${PN}-3.4.3-install-tutorials-into-bin.patch"
77 +)
78 +
79 +pkg_pretend() {
80 + if use cuda; then
81 + [[ $(gcc-major-version) -gt 8 ]] && \
82 + eerror "USE=cuda requires gcc < 9. Run gcc-config to switch your default compiler" && \
83 + die "Need gcc version earlier than 9"
84 + fi
85 + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
86 +}
87 +
88 +pkg_setup() {
89 + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
90 +}
91 +
92 +src_configure() {
93 + # GLTESTS are disabled as portage is unable to open a display during test phase
94 + # TODO: virtx work?
95 + local mycmakeargs=(
96 + -DGLEW_LOCATION="${ESYSROOT}/usr/$(get_libdir)"
97 + -DGLFW_LOCATION="${ESYSROOT}/usr/$(get_libdir)"
98 + -DNO_CLEW=ON
99 + -DNO_CUDA=$(usex !cuda)
100 + # Docs needed Python 2 so disabled
101 + # bug #815172
102 + -DNO_DOC=ON
103 + -DNO_EXAMPLES=$(usex !examples)
104 + -DNO_GLTESTS=ON
105 + -DNO_OMP=$(usex !openmp)
106 + -DNO_OPENCL=$(usex !opencl)
107 + -DNO_PTEX=$(usex !ptex)
108 + -DNO_REGRESSION=$(usex !test)
109 + -DNO_TBB=$(usex !tbb)
110 + -DNO_TESTS=$(usex !test)
111 + -DNO_TUTORIALS=$(usex !tutorials)
112 + )
113 +
114 + # Fails with building cuda kernels when using multiple jobs
115 + export MAKEOPTS="-j1"
116 +
117 + cmake_src_configure
118 +}