From b040f27af205cdfe8461a2ff0cb77649df1ab459 Mon Sep 17 00:00:00 2001
From: Leon Marz <main@lmarz.org>
Date: Wed, 28 Sep 2022 16:05:47 +0200
Subject: [PATCH] community/opensubdiv: upgrade to 3.5.0

---
 community/opensubdiv/0001-remove-rpath.patch  | 42 +++++++++----------
 ...1.patch => 0002-Support-oneTBB-2021.patch} | 30 +++----------
 community/opensubdiv/APKBUILD                 | 18 ++++----
 3 files changed, 34 insertions(+), 56 deletions(-)
 rename community/opensubdiv/{fix-tbb-2021.patch => 0002-Support-oneTBB-2021.patch} (52%)

diff --git a/community/opensubdiv/0001-remove-rpath.patch b/community/opensubdiv/0001-remove-rpath.patch
index 6eda0fea8994..5048297d3caf 100644
--- a/community/opensubdiv/0001-remove-rpath.patch
+++ b/community/opensubdiv/0001-remove-rpath.patch
@@ -1,36 +1,32 @@
-From 1d841c8e5ab36b932d9e51a1e871539451786632 Mon Sep 17 00:00:00 2001
+From 230fa21d8a37eb1696f96e407707221c7d00d35e Mon Sep 17 00:00:00 2001
 From: Leon Marz <main@lmarz.org>
-Date: Sat, 1 May 2021 16:21:51 +0200
-Subject: [PATCH] remove rpath
+Date: Wed, 28 Sep 2022 16:01:51 +0200
+Subject: [PATCH 1/2] remove rpath
 
 ---
- CMakeLists.txt | 13 -------------
- 1 file changed, 13 deletions(-)
+ CMakeLists.txt | 2 ++
+ 1 file changed, 2 insertions(+)
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 359114e..eebf833 100644
+index 8616b2f..d55c1f4 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -140,19 +140,6 @@ elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Intel")
-     set(CMAKE_COMPILER_IS_ICC 1)
+@@ -141,6 +141,7 @@ elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Intel")
  endif()
  
--
--if (NOT CMAKE_COMPILER_IS_ICC)
--    # Currently icc has a bug that asserts when linking rpaths containing long
--    # sequences of ':' that this command causes. The consequence is that examples
--    # built and installed using icc will not have an rpath pointing to the built
--    # OSD library which they depend on and will have to set LD_LIBRARY_PATH instead.
--    list(APPEND CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
--endif()
--
--# add the automatically determined parts of the RPATH
--# which point to directories outside the build tree to the install RPATH
--SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
--
+ 
++if (false)
+ if (NOT CMAKE_COMPILER_IS_ICC)
+     # Currently icc has a bug that asserts when linking rpaths containing long
+     # sequences of ':' that this command causes. The consequence is that examples
+@@ -152,6 +153,7 @@ endif()
+ # add the automatically determined parts of the RPATH
+ # which point to directories outside the build tree to the install RPATH
+ SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
++endif()
+ 
  # ensure that ARC is shown as enabled in the Xcode UI
  if(CMAKE_GENERATOR STREQUAL "Xcode")
-     set (CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC "YES")
 -- 
-2.31.1
+2.37.3
 
diff --git a/community/opensubdiv/fix-tbb-2021.patch b/community/opensubdiv/0002-Support-oneTBB-2021.patch
similarity index 52%
rename from community/opensubdiv/fix-tbb-2021.patch
rename to community/opensubdiv/0002-Support-oneTBB-2021.patch
index c4cc85118d91..f0f014a97c0d 100644
--- a/community/opensubdiv/fix-tbb-2021.patch
+++ b/community/opensubdiv/0002-Support-oneTBB-2021.patch
@@ -1,27 +1,4 @@
-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 0fd85db5a7806cb73055db86869a6b1d8e3dfecd 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
@@ -31,7 +8,7 @@ Subject: [PATCH 2/2] Support oneTBB 2021
  1 file changed, 7 insertions(+), 5 deletions(-)
 
 diff --git a/opensubdiv/osd/tbbEvaluator.cpp b/opensubdiv/osd/tbbEvaluator.cpp
-index c98db9f6d..66c2ed58f 100644
+index c98db9f..66c2ed5 100644
 --- a/opensubdiv/osd/tbbEvaluator.cpp
 +++ b/opensubdiv/osd/tbbEvaluator.cpp
 @@ -25,7 +25,8 @@
@@ -60,3 +37,6 @@ index c98db9f6d..66c2ed58f 100644
      }
  }
  
+-- 
+2.37.3
+
diff --git a/community/opensubdiv/APKBUILD b/community/opensubdiv/APKBUILD
index 28e11034029d..8b7221ebcf80 100644
--- a/community/opensubdiv/APKBUILD
+++ b/community/opensubdiv/APKBUILD
@@ -2,9 +2,9 @@
 # Contributor: Leon Marz <main@lmarz.org>
 # Maintainer: Leon Marz <main@lmarz.org>
 pkgname=opensubdiv
-pkgver=3.4.4
+pkgver=3.5.0
 _pkgver=${pkgver//./_}
-pkgrel=2
+pkgrel=0
 pkgdesc="An Open-Source subdivision surface library"
 url="https://graphics.pixar.com/opensubdiv"
 arch="all !s390x" # ptex isn't available on this arch
@@ -16,16 +16,17 @@ makedepends="cmake
 	libxcursor-dev
 	libxi-dev
 	libxrandr-dev
+	opencl-dev
 	ptex-dev
 	ptex
 	py3-docutils
 	samurai
 	zlib-dev
 	"
-subpackages="$pkgname-dev $pkgname-doc $pkgname-tutorials $pkgname-tools"
+subpackages="$pkgname-dev $pkgname-tutorials $pkgname-tools"
 source="$pkgname-$pkgver.tar.gz::https://github.com/PixarAnimationStudios/OpenSubdiv/archive/v$_pkgver.tar.gz
 	0001-remove-rpath.patch
-	fix-tbb-2021.patch
+	0002-Support-oneTBB-2021.patch
 	"
 builddir="$srcdir/OpenSubdiv-$_pkgver"
 
@@ -35,7 +36,8 @@ build() {
 		-DCMAKE_INSTALL_PREFIX=/usr \
 		-DNO_CLEW=ON \
 		-DNO_CUDA=ON \
-		-DNO_GLTESTS=ON
+		-DNO_GLTESTS=ON \
+		-DNO_DOC=ON
 	cmake --build build
 }
 
@@ -66,7 +68,7 @@ tools() {
 }
 
 sha512sums="
-fc8f28b79347015c8991150535c1339e695d96947c72fadd4fa27b546a0813c1125cd175ee03bed5aacdb3609f74c4e526ef70103d1195ba9f7df041e73ea9fb  opensubdiv-3.4.4.tar.gz
-2b00a32cc6708fcd0cfe54d5b4895f64f8295044fdfa1c5e7adcddb630fe6cb3564330a9ebd6b801e7469befc45a26f48aa18620f3b7cf5a27272d54cda442c0  0001-remove-rpath.patch
-cc127a461a96c7c863808c2c26c7a14bd583b9e9cebbc621c3ed442a2c127e628e841ea5f0a63bc89afb8bbc6bda0732e8f0ff13b3669b52398037ccf9cfbc07  fix-tbb-2021.patch
+7ede8f3f335a6306486d649199117401ab4285d360a3b53a536f25046d94741b5e7eacbc06a55d8a0bd5798c810c1b3cfd7964859f04f95363ad26411310b320  opensubdiv-3.5.0.tar.gz
+7e82d76196b1be5dd0d0d485e1124bbfe2d75a98155a520d3457135106148ea1313abbb89c8f87acf51f577faacdc09898b67784ea1d4291cbee2a52df4a17c4  0001-remove-rpath.patch
+ec7327081e614612ca49eff673c95873bcb521041f136de06912f5c2cfe7db84dd00d376ec4630580348e8ca19c03fe52f5d31dad374b824d03c359c1ba12ede  0002-Support-oneTBB-2021.patch
 "
-- 
GitLab