Files
haikuports/sys-libs/vulkan/vulkan-1.4.311.recipe
2025-03-27 08:07:31 +00:00

99 lines
3.0 KiB
Bash

SUMMARY="Installable Client Driver (ICD) Loader for Vulkan"
DESCRIPTION="Vulkan is an explicit API, enabling direct control over how GPUs \
actually work. As such, Vulkan supports systems that have multiple GPUs, each \
running with a different driver, or ICD (Installable Client Driver). Vulkan \
also supports multiple global contexts (instances, in Vulkan terminology). The \
ICD loader is a library that is placed between a Vulkan application and any \
number of Vulkan drivers, in order to support multiple drivers and the \
instance-level functionality that works across these drivers. Additionally, \
the loader manages inserting Vulkan layer libraries, such as validation \
layers, between an application and the drivers."
HOMEPAGE="https://www.vulkan.org/"
COPYRIGHT="2014-2025 The Khronos Group Inc."
LICENSE="Apache v2"
REVISION="1"
SOURCE_URI="https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/v$portVersion.tar.gz"
SOURCE_FILENAME="Vulkan-Loader-$portVersion.tar.gz"
CHECKSUM_SHA256="bcebd281753384a2b019a633e6a81dca0e75414f0c8ec49f56edfcda8020ec20"
SOURCE_DIR="Vulkan-Loader-$portVersion"
SOURCE_URI_2="https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v$portVersion.tar.gz"
SOURCE_FILENAME_2="Vulkan-Headers-$portVersion.tar.gz"
CHECKSUM_SHA256_2="7989c360b870bcc2de52b9fd626fd2ba7a212fe177ade3aa3a10b2bcb61f8689"
SOURCE_DIR_2="Vulkan-Headers-$portVersion"
PATCHES="vulkan-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
libVersion="$portVersion"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
vulkan$secondaryArchSuffix = $portVersion
lib:libvulkan$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
"
PROVIDES_devel="
vulkan${secondaryArchSuffix}_devel = $portVersion
devel:libvulkan$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
vulkan$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:ninja
cmd:pkg_config$secondaryArchSuffix
"
defineDebugInfoPackage vulkan$secondaryArchSuffix \
"$libDir"/libvulkan.so.$libVersion
BUILD()
{
cd $sourceDir2
cmake -S . -B build $cmakeDirArgs \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX:PATH=$prefix \
-G Ninja
cd ../../$sourceDir
cmake -S . -B build $cmakeDirArgs \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX:PATH=$prefix \
-DBUILD_WSI_XCB_SUPPORT=OFF \
-DBUILD_WSI_XLIB_SUPPORT=OFF \
-DBUILD_WSI_WAYLAND_SUPPORT=ON \
-DVulkanHeaders_DIR=$sourceDir2/build/CMakeFiles/Export/2305fcc30b4aca20c8b0c09c18da2b50/ \
-G Ninja
ninja -C build
}
INSTALL()
{
ninja -C build install
mkdir -p $dataDir/vulkan/registry
cp $sourceDir2/registry/vk.xml $dataDir/vulkan/registry/vk.xml
mkdir -p $includeDir
cp -r $sourceDir2/include/* $includeDir
prepareInstalledDevelLib libvulkan
fixPkgconfig
# devel package
packageEntries devel \
$developDir
}