diff --git a/sys-libs/mesa/mesa-10.5.2.recipe b/sys-libs/mesa/mesa-10.5.2.recipe new file mode 100644 index 000000000..aefdbb1c3 --- /dev/null +++ b/sys-libs/mesa/mesa-10.5.2.recipe @@ -0,0 +1,152 @@ +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 All Rights Reserved." +LICENSE="MIT" +SRC_URI="ftp://ftp.freedesktop.org/pub/mesa/10.5.2/mesa-10.5.2.tar.xz" +CHECKSUM_SHA256="2f4b6fb77c3e7d6f861558d0884a3073f575e1e673dad8d1b0624e78e9c4dd44" +REVISION="1" +ARCHITECTURES="x86 ?x86_64 ?arm ?ppc" +if [ $effectiveTargetArchitecture != x86_gcc2 ]; then + # x86_gcc2 is fine as primary target architecture as long as we're building + # for a different secondary architecture. + ARCHITECTURES="$ARCHITECTURES ?x86_gcc2" +fi +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + mesa$secondaryArchSuffix = $portVersion compat >= 10.0 + lib:libGL$secondaryArchSuffix + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libstdc++$secondaryArchSuffix + lib:libgcc_s$secondaryArchSuffix + " +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 + " + +#SOURCE_DIR="Mesa-$portVersion" +PATCHES="mesa-10.5.2.patchset" + +BUILD() +{ + if [ -n "$secondaryArchSuffix" ]; then + export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture" + fi + scons $jobArgs build=release + #scons $jobArgs build=debug +} + +INSTALL() +{ + mesaBuildDir=build/haiku-$effectiveTargetArchitecture + + # libGL.so makes up the core of our OpenGL kit + mkdir -p $libDir + cp $(find $mesaBuildDir -name 'libGL.so') $libDir + mkdir -p $developLibDir + symlinkRelative -s $libDir/libGL.so $developLibDir + + # Our rendering add-ons + mkdir -p $addOnsDir/opengl + cp $(find $mesaBuildDir -name 'libswrast.so') \ + "$addOnsDir/opengl/Software Rasterizer" + cp $(find $mesaBuildDir -name 'libswpipe.so') \ + "$addOnsDir/opengl/Software Pipe" + + # Set some nice version info + setversion "$libDir/libGL.so" -app 10 5 2 -long "Haiku OpenGL kit" + setversion "$addOnsDir/opengl/Software Rasterizer" -app 10 5 2 -long "Mesa software rasterization renderer" + setversion "$addOnsDir/opengl/Software Pipe" -app 10 5 2 -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 + + # devel package + packageEntries devel \ + $developDir + + # swpipe renderer package + packageEntries swpipe \ + "$addOnsDir/opengl/Software Pipe" + + # swrast renderer package + packageEntries swrast \ + "$addOnsDir/opengl/Software Rasterizer" +} + +# ----- devel package ------------------------------------------------------- + +PROVIDES_devel=" + mesa${secondaryArchSuffix}_devel = $portVersion + devel:libGL$secondaryArchSuffix = $portVersion + " + +REQUIRES_devel=" + mesa$secondaryArchSuffix == $portVersion base + " + +# ===== Mesa OpenGL Add-ons ================================================== +# ----- swrast package ------------------------------------------------------- + +SUMMARY_swrast="Mesa software rasterization renderer" +DESCRIPTION_swrast="This 3D BGLRenderer add-on provides Mesa software \ +rasterization on Haiku systems. Software rasterization performs all 3D \ +rendering on the systems CPU and doesn't require any specialized hardware. \ +Software rasterization is generally considered a fallback 3D rendering method \ +as performance is limited. +" +PROVIDES_swrast=" + mesa${secondaryArchSuffix}_swrast = $portVersion + " +REQUIRED_swrast=" + mesa$secondaryArchSuffix == $portVersion base + " + +# ===== Gallium OpenGL Add-ons =============================================== +# ----- swpipe package ------------------------------------------------------- + +SUMMARY_swpipe="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-10.5.2.patchset b/sys-libs/mesa/patches/mesa-10.5.2.patchset new file mode 100644 index 000000000..725cb39ec --- /dev/null +++ b/sys-libs/mesa/patches/mesa-10.5.2.patchset @@ -0,0 +1,152 @@ +From 4cf1425f9e4e1935b8660e6be0969919d37dcae8 Mon Sep 17 00:00:00 2001 +From: Alexander von Gluck IV +Date: Sat, 4 Apr 2015 11:43:28 -0500 +Subject: [PATCH 1/2] Haiku: Fix build + +* Add missing #src include for util macros +--- + src/gallium/auxiliary/util/u_math.h | 2 +- + src/hgl/SConscript | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h +index 5db5b66..d4f955d 100644 +--- a/src/gallium/auxiliary/util/u_math.h ++++ b/src/gallium/auxiliary/util/u_math.h +@@ -528,7 +528,7 @@ unsigned ffs( unsigned u ) + + return i; + } +-#elif defined(__MINGW32__) || defined(PIPE_OS_ANDROID) ++#elif defined(__MINGW32__) || defined(PIPE_OS_ANDROID) || defined(__HAIKU__) + #define ffs __builtin_ffs + #define ffsll __builtin_ffsll + #endif +diff --git a/src/hgl/SConscript b/src/hgl/SConscript +index 70db149..71881f5 100644 +--- a/src/hgl/SConscript ++++ b/src/hgl/SConscript +@@ -6,6 +6,7 @@ Import('*') + env = env.Clone() + + env.Append(CPPPATH = [ ++ '#/src', + '#/src/mapi', + '#/src/mesa', + '#/src/mesa/main', +-- +1.8.3.4 + +From 29dbd1148b6b114242586c4d619e406ae757e7ff Mon Sep 17 00:00:00 2001 +From: Alexander von Gluck IV +Date: Sat, 4 Apr 2015 11:44:21 -0500 +Subject: [PATCH 2/2] scons: Fix build by disabling OpenVG (cherry pick missed + in 10.5.2) + +--- + src/SConscript | 2 -- + src/gallium/SConscript | 1 - + src/gallium/targets/egl-static/SConscript | 11 ----------- + 3 files changed, 14 deletions(-) + +diff --git a/src/SConscript b/src/SConscript +index c25adc7..188ab08 100644 +--- a/src/SConscript ++++ b/src/SConscript +@@ -27,8 +27,6 @@ if env['platform'] in ['haiku']: + + SConscript('mesa/SConscript') + +-SConscript('mapi/vgapi/SConscript') +- + if not env['embedded']: + if env['platform'] not in ('cygwin', 'darwin', 'freebsd', 'haiku', 'windows'): + SConscript('glx/SConscript') +diff --git a/src/gallium/SConscript b/src/gallium/SConscript +index 25d0af6..baacd29 100644 +--- a/src/gallium/SConscript ++++ b/src/gallium/SConscript +@@ -62,7 +62,6 @@ SConscript([ + ]) + + if not env['embedded']: +- SConscript('state_trackers/vega/SConscript') + if env['platform'] not in ('cygwin', 'darwin', 'freebsd', 'sunos'): + SConscript([ + 'state_trackers/egl/SConscript', +diff --git a/src/gallium/targets/egl-static/SConscript b/src/gallium/targets/egl-static/SConscript +index e423d5d..bbeedaa 100644 +--- a/src/gallium/targets/egl-static/SConscript ++++ b/src/gallium/targets/egl-static/SConscript +@@ -14,7 +14,6 @@ env.Append(CPPPATH = [ + '#/src/gallium/include', + '#/src/gallium/winsys', + '#/src/gallium/state_trackers/egl', +- '#/src/gallium/state_trackers/vega', + '#/src/mesa', + ]) + +@@ -74,14 +73,6 @@ if env['gles']: + glapi_name = 'glapi' if env['platform'] != 'windows' else 'libglapi' + env.Prepend(LIBS = [glapi_name, glsl, mesa]) + +-# OpenVG +-if True: +- env.Append(CPPDEFINES = ['FEATURE_VG=1']) +- env.Prepend(LIBPATH = [openvg.dir]) +- # manually add LIBPREFIX on windows +- openvg_name = 'OpenVG' if env['platform'] != 'windows' else 'libOpenVG' +- env.Prepend(LIBS = [openvg_name, st_vega]) +- + if env['HAVE_X11']: + env.Prepend(LIBS = [ + ws_xlib, +@@ -107,8 +98,6 @@ egl_gallium = env.SharedLibrary( + source = sources, + ) + +-env.Depends(egl_gallium, [openvg]) +- + egl_gallium = env.InstallSharedLibrary(egl_gallium, version=(1, 4, 0)) + + env.Alias('egl-gallium', egl_gallium) +-- +1.8.3.4 + +From c62410aa7cb68813d83f8d40d601a382b2f0b970 Mon Sep 17 00:00:00 2001 +From: Alexander von Gluck IV +Date: Sat, 4 Apr 2015 13:33:28 -0500 +Subject: [PATCH] state_tracker/hgl: Fix missing include directory + +--- + src/egl/drivers/haiku/SConscript | 1 + + src/gallium/state_trackers/hgl/SConscript | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/src/egl/drivers/haiku/SConscript b/src/egl/drivers/haiku/SConscript +index 9dd2f70..72bac1f 100644 +--- a/src/egl/drivers/haiku/SConscript ++++ b/src/egl/drivers/haiku/SConscript +@@ -8,6 +8,7 @@ env.Append(CPPDEFINES = [ + + env.Append(CPPPATH = [ + '#/include', ++ '#/include/HaikuGL', + '#/src/egl/main', + '#/src/loader', + ]) +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 = [ +-- +1.8.3.4 +