Files
haikuports/dev-qt/qt6-3d/qt6_3d-6.9.0.recipe
2025-05-15 05:40:39 +00:00

154 lines
5.0 KiB
Bash

SUMMARY="C++ and QML APIs for easy inclusion of 3D graphics"
DESCRIPTION="Qt is a cross-platform application framework that is widely \
used for developing software with a graphical user interface, and also used \
for developing non-GUI programs such as command-line tools and consoles for \
servers."
HOMEPAGE="https://qt.io/"
COPYRIGHT="2015-2025 The Qt Company Ltd."
LICENSE="GNU LGPL v2.1
GNU LGPL v3
GNU FDL v1"
REVISION="1"
QT_MIRROR_URI="https://qt-mirror.dannhauer.de/archive"
SOURCE_URI="$QT_MIRROR_URI/qt/${portVersion%.*}/$portVersion/submodules/qt3d-everywhere-src-$portVersion.tar.xz"
CHECKSUM_SHA256="521dd56d40873d37b2dd9ca95181037b833a07c48aed5db44efcba83a4716cc2"
SOURCE_DIR="qt3d-everywhere-src-$portVersion"
ARCHITECTURES="?all !x86_gcc2"
SECONDARY_ARCHITECTURES="?x86"
PROVIDES="
qt6_3d$secondaryArchSuffix = $portVersion compat >= 6
lib:libQt63DAnimation$secondaryArchSuffix = $portVersion compat >= 6
lib:libQt63DCore$secondaryArchSuffix = $portVersion compat >= 6
lib:libQt63DExtras$secondaryArchSuffix = $portVersion compat >= 6
lib:libQt63DInput$secondaryArchSuffix = $portVersion compat >= 6
lib:libQt63DLogic$secondaryArchSuffix = $portVersion compat >= 6
lib:libQt63DQuick$secondaryArchSuffix = $portVersion compat >= 6
lib:libQt63DQuickAnimation$secondaryArchSuffix = $portVersion compat >= 6
lib:libQt63DQuickExtras$secondaryArchSuffix = $portVersion compat >= 6
lib:libQt63DQuickInput$secondaryArchSuffix = $portVersion compat >= 6
lib:libQt63DQuickRender$secondaryArchSuffix = $portVersion compat >= 6
lib:libQt63DQuickScene2D$secondaryArchSuffix = $portVersion compat >= 6
lib:libQt63DQuickScene3D$secondaryArchSuffix = $portVersion compat >= 6
lib:libQt63DRender$secondaryArchSuffix = $portVersion compat >= 6
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libcrypto$secondaryArchSuffix
lib:libGL$secondaryArchSuffix
lib:libQt6Core$secondaryArchSuffix
lib:libQt6Gui$secondaryArchSuffix
lib:libQt6Qml$secondaryArchSuffix
lib:libQt6QmlModels$secondaryArchSuffix
lib:libQt6Quick$secondaryArchSuffix
lib:libQt6ShaderTools$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
PROVIDES_devel="
qt6_3d${secondaryArchSuffix}_devel = $portVersion compat >= 6
devel:libQt63DAnimation$secondaryArchSuffix = $portVersion compat >= 6
devel:libQt63DCore$secondaryArchSuffix = $portVersion compat >= 6
devel:libQt63DExtras$secondaryArchSuffix = $portVersion compat >= 6
devel:libQt63DInput$secondaryArchSuffix = $portVersion compat >= 6
devel:libQt63DLogic$secondaryArchSuffix = $portVersion compat >= 6
devel:libQt63DQuick$secondaryArchSuffix = $portVersion compat >= 6
devel:libQt63DQuickAnimation$secondaryArchSuffix = $portVersion compat >= 6
devel:libQt63DQuickExtras$secondaryArchSuffix = $portVersion compat >= 6
devel:libQt63DQuickInput$secondaryArchSuffix = $portVersion compat >= 6
devel:libQt63DQuickRender$secondaryArchSuffix = $portVersion compat >= 6
devel:libQt63DQuickScene2D$secondaryArchSuffix = $portVersion compat >= 6
devel:libQt63DQuickScene3D$secondaryArchSuffix = $portVersion compat >= 6
devel:libQt63DRender$secondaryArchSuffix = $portVersion compat >= 6
"
REQUIRES_devel="
qt6_3d$secondaryArchSuffix == $portVersion base
qt6_base${secondaryArchSuffix}_devel
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libcrypto$secondaryArchSuffix >= 3
devel:libGL$secondaryArchSuffix
devel:libQt6Core$secondaryArchSuffix == $portVersion
devel:libQt6Gui$secondaryArchSuffix == $portVersion
devel:libQt6Qml$secondaryArchSuffix == $portVersion
devel:libQt6QmlModels$secondaryArchSuffix == $portVersion
devel:libQt6Quick$secondaryArchSuffix == $portVersion
devel:libQt6ShaderTools$secondaryArchSuffix == $portVersion
devel:libssl$secondaryArchSuffix >= 3
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:awk
cmd:cmake
cmd:find
cmd:g++$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:make
cmd:ninja
cmd:perl
cmd:pkg_config$secondaryArchSuffix
cmd:python3
cmd:sed
cmd:xargs
"
BUILD()
{
export DISABLE_ASLR=1
local cmakeFlags
# disable simd code for x86_gcc2
if [ $targetArchitecture == x86_gcc2 ]; then
cmakeFlags="-DFEATURE_sse2=OFF -DFEATURE_avx2=OFF"
fi
cmake -B build -S $sourceDir -G Ninja $cmakeFlags \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS=-fPIC \
-DQT_GENERATE_SBOM=ON \
-Wno-dev
find -name cmake_install.cmake -exec sed -i "s|set(CMAKE_INSTALL_PREFIX.*|set(CMAKE_INSTALL_PREFIX \"$prefix\")|" {} \;
ninja -v -C build $jobArgs
}
INSTALL()
{
ninja -C build install
prepareInstalledDevelLibs \
libQt63DAnimation \
libQt63DCore \
libQt63DExtras \
libQt63DInput \
libQt63DLogic \
libQt63DQuick \
libQt63DQuickAnimation \
libQt63DQuickExtras \
libQt63DQuickInput \
libQt63DQuickRender \
libQt63DQuickScene2D \
libQt63DQuickScene3D \
libQt63DRender
# fix pkgconfig files
fixPkgconfig
sed -i "s|includedir=.*|includedir=$includeDir/Qt6|" \
$developLibDir/pkgconfig/*.pc
cd $libDir
for i in lib*.so.6.*;do
ln -fs $i $(echo $i | cut -f1,2 -d.)
done
packageEntries devel \
$developDir \
$libDir/cmake \
$dataDir/Qt6/mkspecs
}