diff --git a/media-libs/embree/embree-2.17.6.recipe b/media-libs/embree/embree-3.6.0.recipe similarity index 76% rename from media-libs/embree/embree-2.17.6.recipe rename to media-libs/embree/embree-3.6.0.recipe index 4959cbf03..ca5b9a3c3 100644 --- a/media-libs/embree/embree-2.17.6.recipe +++ b/media-libs/embree/embree-3.6.0.recipe @@ -8,19 +8,22 @@ processors with support for SSE, AVX, AVX2, and AVX-512. Embree \ supports runtime code selection to choose the traversal and build \ algorithms that best matches the instruction set of your CPU" HOMEPAGE="https://embree.github.io" -COPYRIGHT="2013-2017 Intel Corporation" +COPYRIGHT="2013-2019 Intel Corporation" LICENSE="Apache v2" -REVISION="3" +REVISION="1" SOURCE_URI="https://github.com/embree/embree/archive/v$portVersion.tar.gz" -CHECKSUM_SHA256="29b78b13728f81ced69ad24edb0bfe3f5e0298b83648371636394c9ecbc08752" +CHECKSUM_SHA256="3c179aa09efe1f591f277cd8835e37726998f657730ca456d08f584fc8780559" PATCHES="embree-$portVersion.patchset" ARCHITECTURES="!x86_gcc2 x86 x86_64" SECONDARY_ARCHITECTURES="x86" +libVersion="$portVersion" +libVersionCompat="$libVersion compat >= ${libVersion%%.*}" + PROVIDES=" embree$secondaryArchSuffix = $portVersion - lib:libembree$secondaryArchSuffix = 2.17.6 compat >= 2 + lib:libembree3$secondaryArchSuffix = $libVersionCompat " REQUIRES=" haiku$secondaryArchSuffix @@ -33,8 +36,7 @@ REQUIRES=" PROVIDES_devel=" embree${secondaryArchSuffix}_devel = $portVersion - cmd:embree2$secondaryArchSuffix - devel:libembree$secondaryArchSuffix = 2.17.6 compat >= 2 + devel:libembree3$secondaryArchSuffix = $libVersionCompat " REQUIRES_devel=" embree$secondaryArchSuffix == $portVersion base @@ -56,16 +58,20 @@ BUILD_PREREQUIRES=" cmd:pkg_config$secondaryArchSuffix cmd:sed " +defineDebugInfoPackage embree$secondaryArchSuffix \ + "$libDir"/libembree3.so.$libVersion BUILD() { mkdir -p haiku_build cd haiku_build - cmake $cmakeDirArgs \ + cmake $cmakeDirArgs \ + .. \ + -DEMBREE_TUTORIALS=OFF \ -DEMBREE_ISPC_SUPPORT=OFF \ -DEMBREE_TASKING_SYSTEM=OFF \ - .. + -DBUILD_TESTING=ON make $jobArgs } @@ -74,13 +80,18 @@ INSTALL() cd haiku_build make install - prepareInstalledDevelLib libembree + prepareInstalledDevelLib libembree3 fixPkgconfig # devel package packageEntries devel \ $developDir \ - $binDir \ $libDir/cmake } + +TEST() +{ + cd haiku_build + make test +} diff --git a/media-libs/embree/patches/embree-2.17.6.patchset b/media-libs/embree/patches/embree-3.6.0.patchset similarity index 54% rename from media-libs/embree/patches/embree-2.17.6.patchset rename to media-libs/embree/patches/embree-3.6.0.patchset index a5f0fe2f4..d3368a84e 100644 --- a/media-libs/embree/patches/embree-2.17.6.patchset +++ b/media-libs/embree/patches/embree-3.6.0.patchset @@ -1,99 +1,11 @@ -From dbe060fad2b764cbe49812864389fdbfb1323e9e Mon Sep 17 00:00:00 2001 +From f84bf30cb06b3fb70e374415377399f966d84d98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= -Date: Sat, 11 Nov 2017 10:59:41 +0100 -Subject: Embree: Haiku platform support - - -diff --git a/common/sys/alloc.cpp b/common/sys/alloc.cpp -index e24df4e..d51fd84 100644 ---- a/common/sys/alloc.cpp -+++ b/common/sys/alloc.cpp -@@ -262,6 +262,8 @@ namespace embree - hugepages = true; - return ptr; - } -+#elif defined(__HAIKU__) -+ hugepages = false; - #else - void* ptr = mmap(0, bytes, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_HUGETLB, -1, 0); - if (ptr != MAP_FAILED) { -diff --git a/common/sys/platform.h b/common/sys/platform.h -index 4f834ef..eea43f2 100644 ---- a/common/sys/platform.h -+++ b/common/sys/platform.h -@@ -85,6 +85,13 @@ - # endif - #endif - -+/* detect Haiku platform */ -+#if defined(__HAIKU__) -+# if !defined(__UNIX__) -+# define __UNIX__ -+# endif -+#endif -+ - /* try to detect other Unix systems */ - #if defined(__unix__) || defined (unix) || defined(__unix) || defined(_unix) - # if !defined(__UNIX__) -diff --git a/common/sys/sysinfo.cpp b/common/sys/sysinfo.cpp -index 2a6dfed..9284cf6 100644 ---- a/common/sys/sysinfo.cpp -+++ b/common/sys/sysinfo.cpp -@@ -49,6 +49,10 @@ namespace embree - return "Mac OS X (32bit)"; - #elif defined(__MACOSX__) && defined(__X86_64__) - return "Mac OS X (64bit)"; -+#elif defined(__HAIKU__) && !defined(__X86_64__) -+ return "Haiku (32bit)"; -+#elif defined(__HAIKU__) && defined(__X86_64__) -+ return "Haiku (64bit)"; - #elif defined(__UNIX__) && !defined(__X86_64__) - return "Unix (32bit)"; - #elif defined(__UNIX__) && defined(__X86_64__) -@@ -406,7 +410,7 @@ namespace embree - /// Linux Platform - //////////////////////////////////////////////////////////////////////////////// - --#if defined(__LINUX__) -+#if defined(__LINUX__) || defined(__HAIKU__) - - #include - #include -diff --git a/tutorials/common/math/sampling.h b/tutorials/common/math/sampling.h -index 46444f0..1bec7b3 100644 ---- a/tutorials/common/math/sampling.h -+++ b/tutorials/common/math/sampling.h -@@ -26,6 +26,18 @@ - - namespace embree { - -+#ifdef __HAIKU__ -+/* FIXME! */ -+inline void sincosf (float x, float* sine, float* cosine) -+{ -+ #if defined(__GNUC__) && defined(__linux__) && !defined(__clang__) -+ __builtin_sincosf(x, sine, cosine); -+ #else -+ *sine = std::sin(x); -+ *cosine = std::cos(x); -+ #endif -+} -+#endif - - inline Vec3fa cartesian(const float phi, const float sinTheta, const float cosTheta) - { --- -2.19.1 - - -From 3597bd1a386a817b7ddf7a3038c4e6523bc6132e Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Sat, 24 Nov 2018 17:07:38 +0100 -Subject: fix for Haiku x86 +Date: Sat, 24 Aug 2019 09:32:55 +0200 +Subject: Applied patches diff --git a/common/math/math.h b/common/math/math.h -index bd66796..4bdfa05 100644 +index caef5aa..2007bda 100644 --- a/common/math/math.h +++ b/common/math/math.h @@ -176,7 +176,10 @@ namespace embree @@ -120,8 +32,28 @@ index bd66796..4bdfa05 100644 __forceinline size_t max(size_t a, size_t b) { return a + #include diff --git a/kernels/builders/bvh_builder_sah.h b/kernels/builders/bvh_builder_sah.h -index 307d78c..34072f0 100644 +index 6418a9b..5de64ff 100644 --- a/kernels/builders/bvh_builder_sah.h +++ b/kernels/builders/bvh_builder_sah.h -@@ -52,7 +52,7 @@ namespace embree +@@ -55,7 +55,7 @@ namespace embree { - if (RTC_BUILD_SETTINGS_HAS(settings,maxBranchingFactor)) branchingFactor = settings.maxBranchingFactor; - if (RTC_BUILD_SETTINGS_HAS(settings,maxDepth )) maxDepth = settings.maxDepth; -- if (RTC_BUILD_SETTINGS_HAS(settings,sahBlockSize )) logBlockSize = __bsr(settings.sahBlockSize); -+ if (RTC_BUILD_SETTINGS_HAS(settings,sahBlockSize )) logBlockSize = __bsr((size_t)settings.sahBlockSize); - if (RTC_BUILD_SETTINGS_HAS(settings,minLeafSize )) minLeafSize = settings.minLeafSize; - if (RTC_BUILD_SETTINGS_HAS(settings,maxLeafSize )) maxLeafSize = settings.maxLeafSize; - if (RTC_BUILD_SETTINGS_HAS(settings,travCost )) travCost = settings.travCost; + if (RTC_BUILD_ARGUMENTS_HAS(settings,maxBranchingFactor)) branchingFactor = settings.maxBranchingFactor; + if (RTC_BUILD_ARGUMENTS_HAS(settings,maxDepth )) maxDepth = settings.maxDepth; +- if (RTC_BUILD_ARGUMENTS_HAS(settings,sahBlockSize )) logBlockSize = bsr(settings.sahBlockSize); ++ if (RTC_BUILD_ARGUMENTS_HAS(settings,sahBlockSize )) logBlockSize = bsr((size_t)settings.sahBlockSize); + if (RTC_BUILD_ARGUMENTS_HAS(settings,minLeafSize )) minLeafSize = settings.minLeafSize; + if (RTC_BUILD_ARGUMENTS_HAS(settings,maxLeafSize )) maxLeafSize = settings.maxLeafSize; + if (RTC_BUILD_ARGUMENTS_HAS(settings,traversalCost )) travCost = settings.traversalCost; -- -2.19.1 +2.23.0