From 31ff8d32b8a71a1e3869129d3c45170d33ff7294 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Sat, 26 Sep 2015 11:46:02 -0500 Subject: [PATCH] mesa: Add Mesa 11.0.1 recipe * Includes experimental EGL library * Software Rast is no longer a thing on Haiku but older mesa_swrast packages can be used on later versions of our OpenGL kit. * There are some bugs, so lets wait a few revs before using these packages in the build. --- sys-libs/mesa/mesa-11.0.1.recipe | 134 +++++++++++++++++++++ sys-libs/mesa/patches/mesa-11.0.1.patchset | 48 ++++++++ 2 files changed, 182 insertions(+) create mode 100644 sys-libs/mesa/mesa-11.0.1.recipe create mode 100644 sys-libs/mesa/patches/mesa-11.0.1.patchset diff --git a/sys-libs/mesa/mesa-11.0.1.recipe b/sys-libs/mesa/mesa-11.0.1.recipe new file mode 100644 index 000000000..5a21cf812 --- /dev/null +++ b/sys-libs/mesa/mesa-11.0.1.recipe @@ -0,0 +1,134 @@ +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-2013 Brian Paul" +LICENSE="MIT" +REVISION="1" +SOURCE_URI="ftp://ftp.freedesktop.org/pub/mesa/${portVersion}/mesa-${portVersion}.tar.xz" +CHECKSUM_SHA256="43d0dfcd1f1e36f07f8228cd76d90175d3fc74c1ed25d7071794a100a98ef2a6" +PATCHES="mesa-11.0.1.patchset" + +ARCHITECTURES="!x86_gcc2 x86 x86_64 ?arm ?ppc" +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + mesa$secondaryArchSuffix = $portVersion compat >= 10.0 + lib:libGL$secondaryArchSuffix + lib:libEGL$secondaryArchSuffix + " +REQUIRES=" + haiku$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 + " +BUILD_PREREQUIRES=" + llvm${secondaryArchSuffix} + python_mako + 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 $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 + setversion "$libDir/libGL.so" -app 11 0 1 -long "Haiku OpenGL kit" + setversion "$libDir/libEGL.so.1" -app 11 0 1 -long "Mesa EGL" + setversion "$addOnsDir/opengl/Software Pipe" -app 11 0 1 -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 + + # 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 + " +REQUIRED_swpipe=" + mesa$secondaryArchSuffix == $portVersion base + " diff --git a/sys-libs/mesa/patches/mesa-11.0.1.patchset b/sys-libs/mesa/patches/mesa-11.0.1.patchset new file mode 100644 index 000000000..3e9fb5be6 --- /dev/null +++ b/sys-libs/mesa/patches/mesa-11.0.1.patchset @@ -0,0 +1,48 @@ +From c35ec7ccdc1a308fc2dbc542bf9935302310673f Mon Sep 17 00:00:00 2001 +From: Alexander von Gluck IV +Date: Sat, 26 Sep 2015 11:39:09 -0500 +Subject: [PATCH] state_trackers/hgl: Fix missing include path + +--- + src/gallium/state_trackers/hgl/SConscript | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/gallium/state_trackers/hgl/SConscript b/src/gallium/state_trackers/hgl/SConscript +index 82a0ce0..d2389c8 100644 +--- a/src/gallium/state_trackers/hgl/SConscript ++++ b/src/gallium/state_trackers/hgl/SConscript +@@ -9,6 +9,7 @@ env.Append(CPPPATH = [ + '#/src', + '#/src/mapi', + '#/src/mesa', ++ '#/include/HaikuGL', + ]) + + sources = [ +-- +2.2.2 + +From 50c6e31d33e7aec3896b415f656f67a36729eeb9 Mon Sep 17 00:00:00 2001 +From: Alexander von Gluck IV +Date: Sat, 26 Sep 2015 11:49:36 -0500 +Subject: [PATCH] egl: Fix missing Haiku include path + +--- + src/egl/SConscript | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/egl/SConscript b/src/egl/SConscript +index f8102db..8f8b11a 100644 +--- a/src/egl/SConscript ++++ b/src/egl/SConscript +@@ -8,6 +8,7 @@ env = env.Clone() + + env.Append(CPPPATH = [ + '#/include', ++ '#/include/HaikuGL', + '#/src/egl/main', + '#/src', + ]) +-- +2.2.2 +