SUMMARY="Multi-platform GL implementation" DESCRIPTION="Mesa is an open-source implementation of the OpenGL \ specification. The OpenGL specification documents a system for rendering \ interactive 3D graphics. Mesa fills the role of the Haiku OpenGL kit \ providing 3D rendering to Haiku applications." HOMEPAGE="https://www.mesa3d.org/" COPYRIGHT="1999-2018 Brian Paul" LICENSE="MIT" REVISION="4" SOURCE_URI="https://mesa.freedesktop.org/archive/mesa-${portVersion}.tar.xz" CHECKSUM_SHA256="cbc0d681cc4df47d8deb5a36f45b420978128522fd665b2cd4c7096316f11bdb" PATCHES="mesa-$portVersion.patchset" ARCHITECTURES="!x86_gcc2 x86 x86_64 ?arm ?ppc" SECONDARY_ARCHITECTURES="x86" libVersion=1.0.0 libOSMesaVersion=8.0.0 libVersionCompat="$libVersion compat >= ${libVersion%%.*}" libOSMesaVersionCompat="$libOSMesaVersion compat >= ${libOSMesaVersion%%.*}" PROVIDES=" mesa$secondaryArchSuffix = $portVersion lib:libEGL$secondaryArchSuffix = $libVersionCompat lib:libGL$secondaryArchSuffix = $libVersionCompat lib:libOSMesa$secondaryArchSuffix = $libOSMesaVersionCompat " REQUIRES=" haiku$secondaryArchSuffix lib:libz$secondaryArchSuffix " PROVIDES_devel=" mesa${secondaryArchSuffix}_devel = $portVersion devel:libEGL$secondaryArchSuffix = $libVersionCompat devel:libGL$secondaryArchSuffix = $libVersionCompat devel:libOSMesa$secondaryArchSuffix = $libOSMesaVersionCompat " REQUIRES_devel=" mesa$secondaryArchSuffix == $portVersion base " SUMMARY_swpipe="The Mesa LLVM enhanced Gallium software pipe renderer" DESCRIPTION_swpipe="This 3D BGLRenderer add-on provides Gallium LLVM \ enhanced software rendering. Software pipe rendering performs all \ 3D rendering on the systems CPU and doesn't require any specialized \ hardware. The usage of LLVM over traditional rasterization gives this \ renderer a boost in performance. Gallium software pipe rendering is in an extremely early state as of \ this version of Mesa, and may not function as expected." PROVIDES_swpipe=" mesa${secondaryArchSuffix}_swpipe = $portVersion " REQUIRES_swpipe=" mesa$secondaryArchSuffix == $portVersion base lib:libLLVM_7$secondaryArchSuffix " BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel devel:libz$secondaryArchSuffix devel:libLLVM_7$secondaryArchSuffix " BUILD_PREREQUIRES=" cmd:aclocal cmd:autoconf cmd:automake cmd:llvm_config cmd:egrep cmd:gcc$secondaryArchSuffix cmd:ld$secondaryArchSuffix cmd:libtoolize$secondaryArchSuffix cmd:make cmd:pkg_config$secondaryArchSuffix cmd:which " defineDebugInfoPackage mesa$secondaryArchSuffix \ "${addOnsDir/mesa$secondaryArchSuffix/mesa${secondaryArchSuffix}_swpipe}/opengl/Software Pipe" \ "$libDir"/libEGL.so.$libVersion \ "$libDir"/libGL.so.$libVersion \ "$libDir"/libOSMesa.so.$libOSMesaVersion \ BUILD() { if [ -n "$secondaryArchSuffix" ]; then export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture" fi autoreconf -fi # for whatever reason, the llvm_require_version function is busted, so we # manually patch it here sed -i 's@"\$LLVM_VERSION_MAJOR" -gt "\$llvm_target_version_major"@true@' configure sed -i 's@-DHAVE_LLVM=0x0\$LLVM_VERSION_INT@-DHAVE_LLVM=0x0700@' configure runConfigure ./configure \ --enable-llvm \ --disable-dri \ --disable-glx \ --disable-glx-tls \ --disable-gbm \ --disable-gles1 \ --disable-gles2 \ --disable-shared-glapi \ --with-gallium-drivers=swrast \ --enable-osmesa \ --with-platforms=haiku make $jobArgs } INSTALL() { make install rm $libDir/lib*.la # Our rendering add-ons mkdir -p $addOnsDir/opengl mv $(find $libDir -name 'libswpipe.so') \ "$addOnsDir/opengl/Software Pipe" rm -rf $libDir/haiku # Set some nice version info appVersion=${portVersion//\./ } setversion "$libDir/libGL.so" -app $appVersion -long "Haiku OpenGL kit" setversion "$libDir/libEGL.so.1" -app $appVersion -long "Mesa EGL" setversion "$addOnsDir/opengl/Software Pipe" -app $appVersion -long \ "Gallium LLVM software pipe renderer" prepareInstalledDevelLibs \ libGL libEGL libOSMesa fixPkgconfig # for compatibility symlinkRelative -s $libDir/libGL.so.1 $libDir/libGL.so # OpenGL Kit mkdir -p $includeDir/os/opengl cp ./include/HaikuGL/OpenGLKit.h $includeDir/os/ cp ./include/HaikuGL/GLView.h $includeDir/os/opengl/ cp ./include/HaikuGL/GLRenderer.h $includeDir/os/opengl/ # Create GL symlink in opengl kit symlinkRelative -s $includeDir/GL $includeDir/os/opengl/GL # Create EGL symlink in opengl kit symlinkRelative -s $includeDir/EGL $includeDir/os/opengl/EGL # Create KHR symlink in opengl kit symlinkRelative -s $includeDir/KHR $includeDir/os/opengl/KHR # devel package packageEntries devel \ $developDir # swpipe renderer package packageEntries swpipe \ "$addOnsDir/opengl/Software Pipe" rmdir "$addOnsDir"/opengl } TEST() { make check }