Files
haikuports/media-libs/opensubdiv/opensubdiv-3.5.0.recipe
2023-08-12 12:30:13 +00:00

130 lines
3.4 KiB
Bash

SUMMARY="An open-source subdivision surface library"
DESCRIPTION="OpenSubdiv is a set of open source libraries that implement high \
performance subdivision surface (subdiv) evaluation on massively parallel CPU \
and GPU architectures. This codepath is optimized for drawing deforming \
subdivs with static topology at interactive framerates. The resulting limit \
surface matches Pixar's Renderman to numerical precision."
HOMEPAGE="https://graphics.pixar.com/opensubdiv/"
COPYRIGHT="2013-2020 Pixar"
LICENSE="Apache v2"
REVISION="3"
SOURCE_URI="https://github.com/PixarAnimationStudios/OpenSubdiv/archive/v${portVersion//\./_}.tar.gz"
CHECKSUM_SHA256="8f5044f453b94162755131f77c08069004f25306fd6dc2192b6d49889efb8095"
SOURCE_FILENAME="opensubdiv-v$portVersion.tar.gz"
SOURCE_DIR="OpenSubdiv-${portVersion//\./_}"
ARCHITECTURES="all !x86_gcc2 ?x86"
SECONDARY_ARCHITECTURES="x86"
libVersion="$portVersion"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
opensubdiv$secondaryArchSuffix = $portVersion
lib:libosdCPU$secondaryArchSuffix = $libVersionCompat
lib:libosdGPU$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
cmd:python3
lib:libGl$secondaryArchSuffix
lib:libglew$secondaryArchSuffix
lib:libGLU$secondaryArchSuffix
lib:libgomp$secondaryArchSuffix
lib:libopencl$secondaryArchSuffix
lib:libtbb$secondaryArchSuffix
lib:libtbbmalloc$secondaryArchSuffix
lib:libtbbmalloc_proxy$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
PROVIDES_tools="
opensubdiv${secondaryArchSuffix}_tools = $portVersion
cmd:bfr_evaluate
cmd:far_perf
cmd:far_regression
cmd:hbr_baseline
cmd:hbr_regression
cmd:stringify
"
REQUIRES_tools="
opensubdiv$secondaryArchSuffix == $portVersion
$REQUIRES
"
PROVIDES_devel="
opensubdiv${secondaryArchSuffix}_devel = $portVersion
devel:libosdCPU$secondaryArchSuffix = $libVersionCompat
devel:libosdGPU$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
opensubdiv$secondaryArchSuffix == $portVersion
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libGl$secondaryArchSuffix
devel:libglew$secondaryArchSuffix
devel:libGLU$secondaryArchSuffix
devel:libgomp$secondaryArchSuffix
devel:libopencl$secondaryArchSuffix
devel:libopencl_headers$secondaryArchSuffix
devel:libtbb$secondaryArchSuffix
devel:libtbbmalloc$secondaryArchSuffix
devel:libtbbmalloc_proxy$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:python3
"
defineDebugInfoPackage opensubdiv$secondaryArchSuffix \
$libDir/libosdCPU.so.$libVersion \
$libDir/libosdGPU.so.$libVersion
BUILD()
{
cmake -Bbuild -S. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$prefix \
-DCMAKE_BINDIR_BASE=$prefix/bin \
-DCMAKE_INCDIR_BASE=$includeDir/opensubdiv \
-DCMAKE_LIBDIR_BASE=$libDir \
-DCMAKE_INSTALL_LIBDIR=$libDir \
-DCMAKE_SKIP_RPATH=ON \
-DNO_EXAMPLES=ON \
-DNO_TUTORIALS=ON \
-DNO_GLFW_X11=ON \
-DGLEW_LIBRARY="`finddir B_SYSTEM_DIRECTORY`/$relativeLibDir" \
-DGLEW_INCLUDE_DIR="`finddir B_SYSTEM_DIRECTORY`/$relativeIncludeDir/GL"
make -C build $jobArgs
}
INSTALL()
{
make -C build install
# remove static libraries
rm $libDir/*.a
prepareInstalledDevelLibs \
libosdCPU \
libosdGPU
fixPkgconfig
packageEntries tools \
$prefix/bin
packageEntries devel \
$developDir \
$libDir/cmake
}
TEST()
{
cd build
make test
}