mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 12:10:06 +02:00
mesa: Add updated 10.1.0 recipe
* Tested working on x86
This commit is contained in:
155
sys-libs/mesa/mesa-10.1.0.recipe
Normal file
155
sys-libs/mesa/mesa-10.1.0.recipe
Normal file
@@ -0,0 +1,155 @@
|
||||
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.1/MesaLib-10.1.0.tar.bz2"
|
||||
CHECKSUM_MD5="3ec43f79dbcd9aa2a4a27bf1f51655b6"
|
||||
REVISION="1"
|
||||
ARCHITECTURES="x86 x86_64"
|
||||
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 >= $haikuVersion
|
||||
"
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel >= $haikuVersion
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
libxml2_python
|
||||
llvm${secondaryArchSuffix}
|
||||
cmd:bison
|
||||
cmd:find
|
||||
cmd:flex
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:ld$secondaryArchSuffix
|
||||
cmd:scons
|
||||
cmd:sed
|
||||
"
|
||||
|
||||
SOURCE_DIR="Mesa-$portVersion"
|
||||
|
||||
PATCHES="mesa-10.1.0.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 1 0 -long "Haiku OpenGL kit"
|
||||
setversion "$addOnsDir/opengl/Software Rasterizer" -app 10 1 0 -long "Mesa software rasterization renderer"
|
||||
setversion "$addOnsDir/opengl/Software Pipe" -app 10 1 0 -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
|
||||
"
|
||||
|
||||
65
sys-libs/mesa/patches/mesa-10.1.0.patchset
Normal file
65
sys-libs/mesa/patches/mesa-10.1.0.patchset
Normal file
@@ -0,0 +1,65 @@
|
||||
From 14ba24e39946117b05fd97a077bad7eeda8790f5 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander von Gluck IV <kallisti5@unixzen.com>
|
||||
Date: Wed, 19 Mar 2014 00:58:01 +0000
|
||||
Subject: [PATCH] haiku: Fix build through scons corrections and viewport fixes
|
||||
|
||||
* Add HAVE_PTHREAD, we do have pthread support wrappers now
|
||||
for non-native Haiku APIs.
|
||||
* Viewport changed behavior recently breaking the build.
|
||||
We fix this by looking at the gl_context ViewportArray
|
||||
(Thanks Brian for the idea)
|
||||
---
|
||||
scons/gallium.py | 5 +++++
|
||||
src/gallium/targets/haiku-softpipe/GalliumContext.cpp | 12 +++++++++---
|
||||
2 files changed, 14 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/scons/gallium.py b/scons/gallium.py
|
||||
index 70ee89b..9796c78 100755
|
||||
--- a/scons/gallium.py
|
||||
+++ b/scons/gallium.py
|
||||
@@ -269,6 +269,11 @@ def generate(env):
|
||||
cppdefines += ['HAVE_ALIAS']
|
||||
else:
|
||||
cppdefines += ['GLX_ALIAS_UNSUPPORTED']
|
||||
+ if env['platform'] == 'haiku':
|
||||
+ cppdefines += [
|
||||
+ 'HAVE_PTHREAD',
|
||||
+ 'HAVE_POSIX_MEMALIGN'
|
||||
+ ]
|
||||
if platform == 'windows':
|
||||
cppdefines += [
|
||||
'WIN32',
|
||||
diff --git a/src/gallium/targets/haiku-softpipe/GalliumContext.cpp b/src/gallium/targets/haiku-softpipe/GalliumContext.cpp
|
||||
index 1078cb7..52cd764 100644
|
||||
--- a/src/gallium/targets/haiku-softpipe/GalliumContext.cpp
|
||||
+++ b/src/gallium/targets/haiku-softpipe/GalliumContext.cpp
|
||||
@@ -44,9 +44,15 @@ extern "C" {
|
||||
|
||||
|
||||
static void
|
||||
-hgl_viewport(struct gl_context* glContext, GLint x, GLint y,
|
||||
- GLsizei width, GLsizei height)
|
||||
+hgl_viewport(struct gl_context* glContext)
|
||||
{
|
||||
+ // TODO: We should try to eliminate this function
|
||||
+
|
||||
+ GLint x = glContext->ViewportArray[0].X;
|
||||
+ GLint y = glContext->ViewportArray[0].Y;
|
||||
+ GLint width = glContext->ViewportArray[0].Width;
|
||||
+ GLint height = glContext->ViewportArray[0].Height;
|
||||
+
|
||||
TRACE("%s(glContext: %p, x: %d, y: %d, w: %d, h: %d\n", __func__,
|
||||
glContext, x, y, width, height);
|
||||
|
||||
@@ -525,7 +531,7 @@ GalliumContext::ResizeViewport(int32 width, int32 height)
|
||||
for (context_id i = 0; i < CONTEXT_MAX; i++) {
|
||||
if (fContext[i] && fContext[i]->st) {
|
||||
struct st_context *stContext = (struct st_context*)fContext[i]->st;
|
||||
- _mesa_set_viewport(stContext->ctx, 0, 0, width, height);
|
||||
+ _mesa_set_viewport(stContext->ctx, 0, 0, 0, width, height);
|
||||
st_manager_validate_framebuffers(stContext);
|
||||
}
|
||||
}
|
||||
--
|
||||
1.8.3.4
|
||||
|
||||
Reference in New Issue
Block a user