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="http://www.mesa3d.org/" COPYRIGHT="1999-2017 Brian Paul" LICENSE="MIT" REVISION="3" SOURCE_URI="https://mesa.freedesktop.org/archive/mesa-${portVersion}.tar.xz" CHECKSUM_SHA256="89ecf3bcd0f18dcca5aaa42bf36bb52a2df33be89889f94aaaad91f7a504a69d" ARCHITECTURES="!x86_gcc2 x86 x86_64 ?arm ?ppc" SECONDARY_ARCHITECTURES="x86" PROVIDES=" mesa$secondaryArchSuffix = $portVersion lib:libGL$secondaryArchSuffix lib:libEGL$secondaryArchSuffix " REQUIRES=" haiku$secondaryArchSuffix lib:libz$secondaryArchSuffix " PROVIDES_devel=" mesa${secondaryArchSuffix}_devel = $portVersion devel:libGL$secondaryArchSuffix = $portVersion devel:libEGL$secondaryArchSuffix = $portVersion " REQUIRES_devel=" mesa$secondaryArchSuffix == $portVersion base " BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel devel:libz$secondaryArchSuffix " BUILD_PREREQUIRES=" llvm${secondaryArchSuffix} mako_python cmd:bison cmd:find cmd:flex cmd:gcc$secondaryArchSuffix cmd:ld$secondaryArchSuffix cmd:scons cmd:sed " BUILD() { if [ -n "$secondaryArchSuffix" ]; then export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture" fi scons $jobArgs build=release #scons $jobArgs build=debug } INSTALL() { mesaBuildDir=build/haiku-$effectiveTargetArchitecture mkdir -p $libDir mkdir -p $developLibDir # libGL.so makes up the core of our OpenGL kit cp $(find $mesaBuildDir -name 'libGL.so') $libDir symlinkRelative -s $libDir/libGL.so $developLibDir # OpenGL ES cp $(find $mesaBuildDir -name 'libEGL.so.1') $libDir symlinkRelative -s $libDir/libEGL.so.1 $libDir/libEGL.so symlinkRelative -s $libDir/libEGL.so.1 $developLibDir/libEGL.so # Our rendering add-ons mkdir -p $addOnsDir/opengl cp $(find $mesaBuildDir -name 'libswpipe.so') \ "$addOnsDir/opengl/Software Pipe" # 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" # 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/ # Standard GL headers mkdir -p $includeDir/GL cp ./include/GL/gl.h $includeDir/GL/ cp ./include/GL/gl_mangle.h $includeDir/GL/ cp ./include/GL/glext.h $includeDir/GL/ # Create GL symlink in opengl kit symlinkRelative -s $includeDir/GL $includeDir/os/opengl/GL # Standard EGL headers mkdir -p $includeDir/EGL cp ./include/EGL/* $includeDir/EGL # Create GL symlink in opengl kit symlinkRelative -s $includeDir/EGL $includeDir/os/opengl/EGL # KHR headers for EGL mkdir -p $includeDir/KHR cp ./include/KHR/* $includeDir/KHR # Create KHR symlink in opengl kit symlinkRelative -s $includeDir/EGL $includeDir/os/opengl/KHR mkdir -p $developLibDir/pkgconfig cat > $developLibDir/pkgconfig/gl.pc << EOF prefix=${prefix} exec_prefix=${prefix} libdir=${libDir} includedir=${includeDir} Name: gl Description: Mesa OpenGL library Version: $portVersion Libs: -L${developLibDir} -lGL Libs.private: -lm EOF cat > $developLibDir/pkgconfig/egl.pc << EOF prefix=${prefix} exec_prefix=${prefix} libdir=${libDir} includedir=${includeDir} Name: egl Description: Mesa EGL library Version: $portVersion Libs: -L${developLibDir} -lEGL Libs.private: -lm EOF # devel package packageEntries devel \ $developDir # swpipe renderer package packageEntries swpipe \ "$addOnsDir/opengl/Software Pipe" } # ===== Gallium OpenGL Add-ons =============================================== # ----- swpipe package ------------------------------------------------------- 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 "