Files
haikuports/media-libs/qhull/qhull-8.0.2.recipe
2023-04-28 12:05:34 +02:00

98 lines
2.5 KiB
Bash

SUMMARY="A geometry library for computing convex hulls and related structures"
DESCRIPTION="Qhull computes convex hulls, Delaunay triangulations, halfspace \
intersections about a point, Voronoi diagrams, furthest-site Delaunay \
triangulations, and furthest-site Voronoi diagrams. Qhull works with 2-d, \
3-d, 4-d, 5-d, and higher dimensions. It computes volumes, surface areas, and \
approximations."
HOMEPAGE="http://www.qhull.org/"
COPYRIGHT="2009-2020 Sony Pictures Imageworks Inc."
LICENSE="BSD (3-clause)"
REVISION="3"
SOURCE_URI="$HOMEPAGE/download/qhull-2020-src-$portVersion.tgz"
CHECKSUM_SHA256="b5c2d7eb833278881b952c8a52d20179eab87766b00b865000469a45c1838b7e"
SOURCE_DIR="qhull-2020.2"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
libVersion="8.0.2"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
qhull$secondaryArchSuffix = $portVersion
cmd:qconvex$commandSuffix
cmd:qdelaunay$commandSuffix
cmd:qhalf$commandSuffix
cmd:qhull$commandSuffix
cmd:qvoronoi$commandSuffix
cmd:rbox$commandSuffix
lib:libqhull_r$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
"
PROVIDES_devel="
qhull${secondaryArchSuffix}_devel = $portVersion
devel:libqhull_r$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
qhull$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:make
"
defineDebugInfoPackage qhull$secondaryArchSuffix \
$libDir/libqhull_r.so.$libVersion
BUILD()
{
sed -i "s|set(PkgConfigLocation.*|set(PkgConfigLocation $relativeLibDir/pkgconfig)|" CMakeLists.txt
sed -i "s|set(ConfigPackageLocation.*|set(ConfigPackageLocation $relativeLibDir/cmake/Qhull)|" CMakeLists.txt
cmake -B build -S . \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=$prefix \
-DBIN_INSTALL_DIR=$commandBinDir \
-DLIB_INSTALL_DIR=$libDir \
-DINCLUDE_INSTALL_DIR=$includeDir \
-DDOC_INSTALL_DIR=$docDir \
-DMAN_INSTALL_DIR=$manDir/man1 \
-DBUILD_STATIC_LIBS=OFF \
-DLINK_APPS_SHARED=ON
make -C build $jobArgs
}
INSTALL()
{
make -C build install
prepareInstalledDevelLib libqhull_r
fixPkgconfig
packageEntries devel \
$developDir \
$libDir/cmake
}
TEST()
{
make -C build test
}