summaryrefslogtreecommitdiff
path: root/media-libs/opensubdiv
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-03-20 00:40:44 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-03-20 00:40:44 +0000
commit4cbcc855382a06088e2f016f62cafdbcb7e40665 (patch)
tree356496503d52354aa6d9f2d36126302fed5f3a73 /media-libs/opensubdiv
parentfcc5224904648a8e6eb528d7603154160a20022f (diff)
gentoo resync : 20.03.2022
Diffstat (limited to 'media-libs/opensubdiv')
-rw-r--r--media-libs/opensubdiv/Manifest2
-rw-r--r--media-libs/opensubdiv/files/opensubdiv-3.4.4-tbb-2021.patch65
-rw-r--r--media-libs/opensubdiv/opensubdiv-3.4.4-r3.ebuild94
3 files changed, 161 insertions, 0 deletions
diff --git a/media-libs/opensubdiv/Manifest b/media-libs/opensubdiv/Manifest
index 82bb0a35821c..d754c6c46c07 100644
--- a/media-libs/opensubdiv/Manifest
+++ b/media-libs/opensubdiv/Manifest
@@ -3,9 +3,11 @@ AUX opensubdiv-3.3.0-use-gnuinstalldirs.patch 1133 BLAKE2B f762b52e23c60c2dded82
AUX opensubdiv-3.4.0-0001-documentation-CMakeLists.txt-force-python2.patch 1620 BLAKE2B 5c7e721f8754d50fdffb468009a2cc67c926ecb8abe3c0c2e5c60f15cac5f778222074f639b0040b98f405eb392f3d9c97358ed3302832fb32a1417d6bc36311 SHA512 b919c3c3f8c3190b683c5bc02cb523821200bbe951d65e2543d6f0f818ee1bcc4117c3140857becf032c54fd58aa4ee2f06b8f8cf550f72f3df9c5b21f483cb1
AUX opensubdiv-3.4.3-install-tutorials-into-bin.patch 2239 BLAKE2B d35a7118b742244f045aa5c0e5e1ab42a8eea98cac377b9fb0efd8948e2b13d2be973aa17714a8554a97061a8de0769861947cf9c890bcf81acff593b3f34ae5 SHA512 2e86d3f73568c16c839d783574abfb765432b3bf9171b73da8eab9c86be4c736912b892879cb04d974046fb90c5fdf2e60669cc94d468d5aec51573c0ffdcaa6
AUX opensubdiv-3.4.4-add-CUDA11-compatibility.patch 846 BLAKE2B df2611fff3112eff3784306c6811285f895593a954f394d1a41b68a9e44ee2dbaae85b5f4e009dfe8edf95e8806f1c085728130c6e003a63a3918ab1ac586012 SHA512 c5c8e6705c0f93d632b45d3e645ff9b207b102ff7534f51b32400e4d60ab07afb18bf6b99a066d1556c55ba275ad586969d4460a6bd3d9c8a2bef83152183deb
+AUX opensubdiv-3.4.4-tbb-2021.patch 2147 BLAKE2B 69f1ae0689fa1a21cb6ee74ff1d6cedd474b38881e49cb5887fbc87bd2b2cc71c7b37b782751390426cc200ea2d488909555c698321c50b5891922f6eb7320ae SHA512 adc5a5126bd1433f4edf8239d7cf48755c8c84d688c8d877121598e8833a352cd3da399577dae918c66b1c4f7d90dd5af08e42d86e66a7532e3b0ae2ad59d048
DIST opensubdiv-3.4.3.tar.gz 39225589 BLAKE2B adb3a3e786999029e5b71659425ed49ea1939a92e2d8ba39ae6abf25ec02c873b8b1bdd34d2e32f843911c7acf5e277a779f82621863fbe0641f772e7603beed SHA512 44fd1361d9e7f48c3fa84f3420ed34743571220602aefb082a42f769ca5b8e9ac21907ce8714f6e3a2caadd75adae03c535a1949a8e6450dfea9ae7a2247cfc2
DIST opensubdiv-3.4.4.tar.gz 39228037 BLAKE2B 53bada3ff2652c6041a3becaf037b593c0e1e4c1bd57a285e6c068c11060b06f9ab0617284a57d0e8974f80082abd6563930ede8b1d6bfb801bfa61dd3256445 SHA512 fc8f28b79347015c8991150535c1339e695d96947c72fadd4fa27b546a0813c1125cd175ee03bed5aacdb3609f74c4e526ef70103d1195ba9f7df041e73ea9fb
EBUILD opensubdiv-3.4.3-r1.ebuild 2376 BLAKE2B 5662809ca588bfe52c46fcf0c2b3e9c3feb56006a1e1ec1f277add0ef0e485a2c863ff1bc137cc8a05b3395b1a221666966d0c27117db4d962f9c7be57a62852 SHA512 fa96d571158a3f7d6bf3fea1e1478e9a0a5e10a6561235d6e58030fd4bac1007df7348fa589ed1aa8e97a09ca3f9f5263fcb04ca12fbb8d438dbe70962170bbe
EBUILD opensubdiv-3.4.4-r1.ebuild 2252 BLAKE2B 11dc22f927daaee1bbcb8b5014efc303a37228439387ed9c89fc49509b13d46e484b1850c5b46cb95666064dfcae2455feda07295ec0bb04270b170d36f59c0f SHA512 a9a117a29ddb15de9bbfe079e6d5ddc97e3fc81804f0e52052880294f30216f2b1fb6dd7719a62f632ec113f73fe3449d2e997697a4b97391d6cc7f1f54dffc9
EBUILD opensubdiv-3.4.4-r2.ebuild 2415 BLAKE2B 8191238ef11d63e09fa843dcad76c553d4fb2676f09dec82ad75af8d6075383c47040370259f4174b79d3596763e2c00716397a475a9533bc61e9c202fc1c5b8 SHA512 637f09451ce22279e1b7e1d6f8778dc6937680615e0ee8b500e8cbbda4f836f03f17922f16906bcb92688263725cf5fce70cf6d8a9dac7c9177e22ee6f853118
+EBUILD opensubdiv-3.4.4-r3.ebuild 2447 BLAKE2B c88e2b9c27020a74ceebd76adbc891c3536494039a6d6e1fe2eb4a38023a1de15a68e28c9f445ffb5dfc2890ec563e4abf970b51246e03ae65d6c611a5b2b84d SHA512 47ff663a6ffa2f210844bfa6646c0a404527c20c0e29472808c17647fbac2e5badbbaa6b35be759add2a32928df5ee8ae5665c8c55ac459b2b8f5d118e72a9cc
MISC metadata.xml 1036 BLAKE2B cc36d0e341535d825d18bc4485cadd6c46b907bacc5fb52421aecd4e194cae73165d9708502dff6ac748396176df6a29c2920b99cb2eb9f841ff26b5de1eb916 SHA512 057a0aa062daed49dcab313aaf049a1ce41a10fa98e6c73c809e7d441689505db27bc0f52785c407226f642c69f65b54a211bccd1690f43eb6f4246faef94984
diff --git a/media-libs/opensubdiv/files/opensubdiv-3.4.4-tbb-2021.patch b/media-libs/opensubdiv/files/opensubdiv-3.4.4-tbb-2021.patch
new file mode 100644
index 000000000000..bae9c4a9d1f1
--- /dev/null
+++ b/media-libs/opensubdiv/files/opensubdiv-3.4.4-tbb-2021.patch
@@ -0,0 +1,65 @@
+https://github.com/PixarAnimationStudios/OpenSubdiv/pull/1234
+https://bugs.gentoo.org/820824
+
+From 7375c99a4d1337f9b79775fb2c753e7865968642 Mon Sep 17 00:00:00 2001
+From: Artur Sinila <freesoftware@logarithmus.dev>
+Date: Sun, 25 Jul 2021 20:34:48 +0300
+Subject: [PATCH 1/2] Fix typo: schedular -> scheduler
+
+---
+ opensubdiv/osd/tbbEvaluator.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/opensubdiv/osd/tbbEvaluator.h b/opensubdiv/osd/tbbEvaluator.h
+index 6bd365bc5..886a94837 100644
+--- a/opensubdiv/osd/tbbEvaluator.h
++++ b/opensubdiv/osd/tbbEvaluator.h
+@@ -1226,7 +1226,7 @@ class TbbEvaluator {
+ /// \brief synchronize all asynchronous computation invoked on this device.
+ static void Synchronize(void *deviceContext = NULL);
+
+- /// \brief initialize tbb task schedular
++ /// \brief initialize tbb task scheduler
+ /// (optional: client may use tbb::task_scheduler_init)
+ ///
+ /// @param numThreads how many threads
+
+From 9079a517f406afba9ea50657b0a0786ad7a7bdcb Mon Sep 17 00:00:00 2001
+From: Artur Sinila <freesoftware@logarithmus.dev>
+Date: Sun, 25 Jul 2021 20:58:27 +0300
+Subject: [PATCH 2/2] Support oneTBB 2021
+
+---
+ opensubdiv/osd/tbbEvaluator.cpp | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/opensubdiv/osd/tbbEvaluator.cpp b/opensubdiv/osd/tbbEvaluator.cpp
+index c98db9f6d..66c2ed58f 100644
+--- a/opensubdiv/osd/tbbEvaluator.cpp
++++ b/opensubdiv/osd/tbbEvaluator.cpp
+@@ -25,7 +25,8 @@
+ #include "../osd/tbbEvaluator.h"
+ #include "../osd/tbbKernel.h"
+
+-#include <tbb/task_scheduler_init.h>
++#define TBB_PREVIEW_GLOBAL_CONTROL true
++#include <tbb/global_control.h>
+
+ namespace OpenSubdiv {
+ namespace OPENSUBDIV_VERSION {
+@@ -215,10 +216,11 @@ TbbEvaluator::Synchronize(void *) {
+ /* static */
+ void
+ TbbEvaluator::SetNumThreads(int numThreads) {
+- if (numThreads == -1) {
+- tbb::task_scheduler_init init;
+- } else {
+- tbb::task_scheduler_init init(numThreads);
++ if (numThreads != -1) {
++ tbb::global_control tbb_global_control(
++ tbb::global_control::max_allowed_parallelism,
++ numThreads
++ );
+ }
+ }
+
diff --git a/media-libs/opensubdiv/opensubdiv-3.4.4-r3.ebuild b/media-libs/opensubdiv/opensubdiv-3.4.4-r3.ebuild
new file mode 100644
index 000000000000..524b64930836
--- /dev/null
+++ b/media-libs/opensubdiv/opensubdiv-3.4.4-r3.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+CMAKE_MAKEFILE_GENERATOR=emake
+
+inherit cmake cuda toolchain-funcs
+
+MY_PV="$(ver_rs "1-3" '_')"
+DESCRIPTION="An Open-Source subdivision surface library"
+HOMEPAGE="https://graphics.pixar.com/opensubdiv/docs/intro.html"
+SRC_URI="https://github.com/PixarAnimationStudios/OpenSubdiv/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/OpenSubdiv-${MY_PV}"
+
+# Modfied Apache-2.0 license, where section 6 has been replaced.
+# See for example CMakeLists.txt for details.
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE="cuda examples opencl openmp ptex tbb test tutorials"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ media-libs/glew:=
+ media-libs/glfw:=
+ x11-libs/libXinerama
+ cuda? ( dev-util/nvidia-cuda-toolkit:* )
+ opencl? ( virtual/opencl )
+ ptex? ( media-libs/ptex )
+"
+DEPEND="
+ ${RDEPEND}
+ tbb? ( dev-cpp/tbb:= )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-3.3.0-use-gnuinstalldirs.patch"
+ "${FILESDIR}/${PN}-3.4.3-install-tutorials-into-bin.patch"
+ "${FILESDIR}/${P}-add-CUDA11-compatibility.patch"
+ "${FILESDIR}/${PN}-3.4.4-tbb-2021.patch"
+)
+
+pkg_pretend() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+src_prepare() {
+ cmake_src_prepare
+
+ use cuda && cuda_src_prepare
+}
+
+src_configure() {
+ # GLTESTS are disabled as portage is unable to open a display during test phase
+ # TODO: virtx work?
+ local mycmakeargs=(
+ -DGLEW_LOCATION="${ESYSROOT}/usr/$(get_libdir)"
+ -DGLFW_LOCATION="${ESYSROOT}/usr/$(get_libdir)"
+ -DNO_CLEW=ON
+ -DNO_CUDA=$(usex !cuda)
+ # Docs needed Python 2 so disabled
+ # bug #815172
+ -DNO_DOC=ON
+ -DNO_EXAMPLES=$(usex !examples)
+ -DNO_GLTESTS=ON
+ -DNO_OMP=$(usex !openmp)
+ -DNO_OPENCL=$(usex !opencl)
+ -DNO_PTEX=$(usex !ptex)
+ -DNO_REGRESSION=$(usex !test)
+ -DNO_TBB=$(usex !tbb)
+ -DNO_TESTS=$(usex !test)
+ -DNO_TUTORIALS=$(usex !tutorials)
+ )
+
+ if use cuda; then
+ # old cmake CUDA module doesn't use environment variable to initialize flags
+ mycmakeargs+=( -DCUDA_NVCC_FLAGS="${NVCCFLAGS}" )
+
+ # check if user provided --gpu-architecture/-arch flag and prevent cmake from overriding it if so
+ for f in ${NVCCFLAGS}; do
+ if [[ ${f} == -arch* || ${f} == --gpu-architecture* ]]; then
+ mycmakeargs+=( -DOSD_CUDA_NVCC_FLAGS="" )
+ break
+ fi
+ done
+ fi
+
+ cmake_src_configure
+}