From 7d325a720c9a7914bbed8004dbf56993b2d91805 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Mon, 23 Dec 2013 01:38:17 +0000 Subject: [PATCH] mesa: Add Mesa 10.0.1 for x86 * Drop 10.0.0 as it didn't include the OpenGL kit headers and wasn't used yet --- ...{mesa-10.0.0.recipe => mesa-10.0.1.recipe} | 28 +- sys-libs/mesa/patches/mesa-10.0.1.patchset | 354 ++++++++++++++++++ 2 files changed, 374 insertions(+), 8 deletions(-) rename sys-libs/mesa/{mesa-10.0.0.recipe => mesa-10.0.1.recipe} (85%) create mode 100644 sys-libs/mesa/patches/mesa-10.0.1.patchset diff --git a/sys-libs/mesa/mesa-10.0.0.recipe b/sys-libs/mesa/mesa-10.0.1.recipe similarity index 85% rename from sys-libs/mesa/mesa-10.0.0.recipe rename to sys-libs/mesa/mesa-10.0.1.recipe index 493995545..3167cd28c 100644 --- a/sys-libs/mesa/mesa-10.0.0.recipe +++ b/sys-libs/mesa/mesa-10.0.1.recipe @@ -7,9 +7,9 @@ DESCRIPTION="Mesa is an open-source implementation of the OpenGL specification. HOMEPAGE="http://www.mesa3d.org/" COPYRIGHT="1999-2013 Brian Paul All Rights Reserved." LICENSE="MIT" -SRC_URI="ftp://ftp.freedesktop.org/pub/mesa/10.0/MesaLib-10.0.0.tar.bz2" -CHECKSUM_MD5="f3fe55d9735bea158bbe97ed9a0da819" -REVISION="2" +SRC_URI="ftp://ftp.freedesktop.org/pub/mesa/10.0.1/MesaLib-10.0.1.tar.bz2" +CHECKSUM_MD5="0a72ca5b36046a658bf6038326ff32ed" +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 @@ -28,6 +28,8 @@ REQUIRES=" BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel >= $haikuVersion " + +PATCHES="mesa-10.0.1.patchset" # We're locked to LLVM 3.2 as 3.3 is broken at the moment on Haiku. # Mesa should build with any newer LLVM version however. @@ -60,11 +62,6 @@ INSTALL() { mesaBuildDir=build/haiku-$effectiveTargetArchitecture - 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/ - # libGL.so makes up the core of our OpenGL kit mkdir -p $libDir cp $(find $mesaBuildDir -name 'libGL.so') $libDir @@ -76,6 +73,21 @@ INSTALL() cp $(find $mesaBuildDir -name 'libswpipe.so') \ "$addOnsDir/opengl/Software Pipe" + # OpenGL Kit + mkdir -p $includeDir/os/opengl/GL + 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 + cp ./include/GL/gl.h $includeDir/os/opengl/GL/ + cp ./include/GL/gl_mangle.h $includeDir/os/opengl/GL/ + cp ./include/GL/glext.h $includeDir/os/opengl/GL/ + + # Symlink GL in kit to system GL directory + cd $includeDir + ln -snf os/opengl/GL GL + # devel package packageEntries devel \ $developDir diff --git a/sys-libs/mesa/patches/mesa-10.0.1.patchset b/sys-libs/mesa/patches/mesa-10.0.1.patchset new file mode 100644 index 000000000..9aed3f820 --- /dev/null +++ b/sys-libs/mesa/patches/mesa-10.0.1.patchset @@ -0,0 +1,354 @@ +From dfe5d4f383c16208d32c498e2c3e92095422d532 Mon Sep 17 00:00:00 2001 +From: Alexander von Gluck IV +Date: Sat, 14 Dec 2013 11:46:05 -0600 +Subject: [PATCH] Haiku: Add in public GL kit headers + +* These make up the base of what C++ GL Haiku + applications use for 3D rendering. +* Not placed in includes/GL to prevent Haiku headers + from getting installed on non-Haiku systems +--- + include/HaikuGL/GLRenderer.h | 76 +++++++++++++++++ + include/HaikuGL/GLView.h | 193 +++++++++++++++++++++++++++++++++++++++++++ + include/HaikuGL/OpenGLKit.h | 10 +++ + include/HaikuGL/README | 28 +++++++ + 4 files changed, 307 insertions(+) + create mode 100644 include/HaikuGL/GLRenderer.h + create mode 100644 include/HaikuGL/GLView.h + create mode 100644 include/HaikuGL/OpenGLKit.h + create mode 100644 include/HaikuGL/README + +diff --git a/include/HaikuGL/GLRenderer.h b/include/HaikuGL/GLRenderer.h +new file mode 100644 +index 0000000..7ffcc34 +--- /dev/null ++++ b/include/HaikuGL/GLRenderer.h +@@ -0,0 +1,76 @@ ++/* ++ * Copyright 2006, Philippe Houdoin. All rights reserved. ++ * Distributed under the terms of the MIT License. ++ ++ * This header defines BGLRenderer, the base class making up ++ * the Haiku GL renderer add-ons (essentially selfcontained C++ ++ * shared libraries that do the actual rendering such as ++ * libswpipe.so and libswrast.so) ++ */ ++#ifndef GLRENDERER_H ++#define GLRENDERER_H ++ ++ ++#include ++#include ++ ++ ++class BGLDispatcher; ++class GLRendererRoster; ++ ++typedef unsigned long renderer_id; ++ ++class BGLRenderer ++{ ++ // Private unimplemented copy constructors ++ BGLRenderer(const BGLRenderer &); ++ BGLRenderer & operator=(const BGLRenderer &); ++ ++public: ++ BGLRenderer(BGLView *view, ulong bgl_options, ++ BGLDispatcher *dispatcher); ++ virtual ~BGLRenderer(); ++ ++ void Acquire(); ++ void Release(); ++ ++ virtual void LockGL(); ++ virtual void UnlockGL(); ++ ++ virtual void SwapBuffers(bool VSync = false); ++ virtual void Draw(BRect updateRect); ++ virtual status_t CopyPixelsOut(BPoint source, BBitmap *dest); ++ virtual status_t CopyPixelsIn(BBitmap *source, BPoint dest); ++ ++ virtual void FrameResized(float width, float height); ++ ++ virtual void DirectConnected(direct_buffer_info *info); ++ virtual void EnableDirectMode(bool enabled); ++ ++ inline int32 ReferenceCount() const { return fRefCount; }; ++ inline ulong Options() const { return fOptions; }; ++ inline BGLView* GLView() { return fView; }; ++ inline BGLDispatcher* GLDispatcher() { return fDispatcher; }; ++ ++private: ++ friend class GLRendererRoster; ++ ++ virtual status_t _Reserved_Renderer_0(int32, void *); ++ virtual status_t _Reserved_Renderer_1(int32, void *); ++ virtual status_t _Reserved_Renderer_2(int32, void *); ++ virtual status_t _Reserved_Renderer_3(int32, void *); ++ virtual status_t _Reserved_Renderer_4(int32, void *); ++ ++ volatile int32 fRefCount; // How much we're still usefull? ++ BGLView* fView; // Never forget who is the boss! ++ ulong fOptions; // Keep that tune in memory ++ BGLDispatcher* fDispatcher;// Our personal GL API call dispatcher ++ ++ GLRendererRoster* fOwningRoster; ++ renderer_id fID; ++}; ++ ++extern "C" _EXPORT BGLRenderer* instantiate_gl_renderer(BGLView *view, ulong options, BGLDispatcher *dispatcher); ++ ++ ++#endif // GLRENDERER_H +diff --git a/include/HaikuGL/GLView.h b/include/HaikuGL/GLView.h +new file mode 100644 +index 0000000..b848578 +--- /dev/null ++++ b/include/HaikuGL/GLView.h +@@ -0,0 +1,193 @@ ++/* ++ * Copyright 2008-2013, Haiku, Inc. All Rights Reserved. ++ * Distributed under the terms of the MIT License. ++ * ++ * This header defines BGLView, the base class making up ++ * the Haiku GL Kit. ++ * ++ */ ++#ifndef BGLVIEW_H ++#define BGLVIEW_H ++ ++ ++#include ++ ++#define BGL_RGB 0 ++#define BGL_INDEX 1 ++#define BGL_SINGLE 0 ++#define BGL_DOUBLE 2 ++#define BGL_DIRECT 0 ++#define BGL_INDIRECT 4 ++#define BGL_ACCUM 8 ++#define BGL_ALPHA 16 ++#define BGL_DEPTH 32 ++#define BGL_OVERLAY 64 ++#define BGL_UNDERLAY 128 ++#define BGL_STENCIL 512 ++ ++#ifdef __cplusplus ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++ ++struct glview_direct_info; ++class BGLRenderer; ++class GLRendererRoster; ++ ++class BGLView : public BView { ++public: ++ BGLView(BRect rect, const char* name, ++ ulong resizingMode, ulong mode, ++ ulong options); ++ virtual ~BGLView(); ++ ++ void LockGL(); ++ void UnlockGL(); ++ void SwapBuffers(); ++ void SwapBuffers(bool vSync); ++ ++ BView* EmbeddedView(); // deprecated, returns NULL ++ void* GetGLProcAddress(const char* procName); ++ ++ status_t CopyPixelsOut(BPoint source, BBitmap *dest); ++ status_t CopyPixelsIn(BBitmap *source, BPoint dest); ++ ++ // Mesa's GLenum is uint where Be's ones was ulong! ++ virtual void ErrorCallback(unsigned long errorCode); ++ ++ virtual void Draw(BRect updateRect); ++ virtual void AttachedToWindow(); ++ virtual void AllAttached(); ++ virtual void DetachedFromWindow(); ++ virtual void AllDetached(); ++ ++ virtual void FrameResized(float newWidth, float newHeight); ++ virtual status_t Perform(perform_code d, void *arg); ++ ++ virtual status_t Archive(BMessage *data, bool deep = true) const; ++ ++ virtual void MessageReceived(BMessage *message); ++ virtual void SetResizingMode(uint32 mode); ++ ++ virtual void Show(); ++ virtual void Hide(); ++ ++ virtual BHandler* ResolveSpecifier(BMessage *msg, int32 index, ++ BMessage *specifier, int32 form, ++ const char *property); ++ virtual status_t GetSupportedSuites(BMessage *data); ++ ++ void DirectConnected(direct_buffer_info *info); ++ void EnableDirectMode(bool enabled); ++ ++ void* getGC() { return fGc; } // ??? ++ ++ virtual void GetPreferredSize(float* width, float* height); ++ ++private: ++ ++ virtual void _ReservedGLView1(); ++ virtual void _ReservedGLView2(); ++ virtual void _ReservedGLView3(); ++ virtual void _ReservedGLView4(); ++ virtual void _ReservedGLView5(); ++ virtual void _ReservedGLView6(); ++ virtual void _ReservedGLView7(); ++ virtual void _ReservedGLView8(); ++ ++ BGLView(const BGLView &); ++ BGLView &operator=(const BGLView &); ++ ++ void _DitherFront(); ++ bool _ConfirmDither(); ++ void _Draw(BRect rect); ++ void _CallDirectConnected(); ++ ++ void* fGc; ++ uint32 fOptions; ++ uint32 fDitherCount; ++ BLocker fDrawLock; ++ BLocker fDisplayLock; ++ glview_direct_info* fClipInfo; ++ ++ BGLRenderer* fRenderer; ++ GLRendererRoster* fRoster; ++ ++ BBitmap* fDitherMap; ++ BRect fBounds; ++ int16* fErrorBuffer[2]; ++ uint64 _reserved[8]; ++ ++ void _LockDraw(); ++ void _UnlockDraw(); ++ ++// BeOS compatibility ++private: ++ BGLView(BRect rect, char* name, ++ ulong resizingMode, ulong mode, ++ ulong options); ++}; ++ ++ ++class BGLScreen : public BWindowScreen { ++public: ++ BGLScreen(char* name, ++ ulong screenMode, ulong options, ++ status_t *error, bool debug=false); ++ ~BGLScreen(); ++ ++ void LockGL(); ++ void UnlockGL(); ++ void SwapBuffers(); ++ // Mesa's GLenum is uint where Be's ones was ulong! ++ virtual void ErrorCallback(unsigned long errorCode); ++ ++ virtual void ScreenConnected(bool connected); ++ virtual void FrameResized(float width, float height); ++ virtual status_t Perform(perform_code code, void *arg); ++ ++ virtual status_t Archive(BMessage *data, bool deep = true) const; ++ virtual void MessageReceived(BMessage *message); ++ ++ virtual void Show(); ++ virtual void Hide(); ++ ++ virtual BHandler* ResolveSpecifier(BMessage *message, ++ int32 index, ++ BMessage *specifier, ++ int32 form, ++ const char *property); ++ virtual status_t GetSupportedSuites(BMessage *data); ++ ++private: ++ ++ virtual void _ReservedGLScreen1(); ++ virtual void _ReservedGLScreen2(); ++ virtual void _ReservedGLScreen3(); ++ virtual void _ReservedGLScreen4(); ++ virtual void _ReservedGLScreen5(); ++ virtual void _ReservedGLScreen6(); ++ virtual void _ReservedGLScreen7(); ++ virtual void _ReservedGLScreen8(); ++ ++ BGLScreen(const BGLScreen &); ++ BGLScreen &operator=(const BGLScreen &); ++ ++ void* fGc; ++ long fOptions; ++ BLocker fDrawLock; ++ ++ int32 fColorSpace; ++ uint32 fScreenMode; ++ ++ uint64 _reserved[7]; ++}; ++ ++#endif // __cplusplus ++ ++#endif // BGLVIEW_H +diff --git a/include/HaikuGL/OpenGLKit.h b/include/HaikuGL/OpenGLKit.h +new file mode 100644 +index 0000000..f482871 +--- /dev/null ++++ b/include/HaikuGL/OpenGLKit.h +@@ -0,0 +1,10 @@ ++/* ++ * Master include file for the Haiku OpenGL Kit. ++ */ ++ ++#include ++#include ++ ++// Projects needing GL/glu.h and GL/glut.h should now ++// include these headers independently as glu and glut ++// are no longe core parts of mesa +diff --git a/include/HaikuGL/README b/include/HaikuGL/README +new file mode 100644 +index 0000000..0f8503f +--- /dev/null ++++ b/include/HaikuGL/README +@@ -0,0 +1,28 @@ ++These headers make up the Haiku Op*nGL kit. ++ ++Headers in this directory preserve some BeOS™ compatibility ++compatibility, so changes should be mentioned to the Haiku ++project mailing list. ++ ++http://haiku-os.org ++ ++Normal Haiku Op*enGL layout: ++ ++ * headers/os/OpenGLKit.h ++ * headers/os/opengl/GLView.h ++ * headers/os/opengl/GLRenderer.h ++ * headers/os/opengl/GL/gl.h ++ * headers/os/opengl/GL/gl_mangle.h ++ * headers/os/opengl/GL/glext.h ++ * headers/os/opengl/GL/osmesa.h (needed?) ++ ++Extras: ++ ++ * headers/os/opengl/GL/glu.h ++ * headers/os/opengl/GL/glut.h ++ ++OpenGL™ is a trademark of SGI. The usage of this trademark ++in the Haiku GL Kit is not a sign of any certification or ++endorsement by SGI or its affiliates. Usage is purely to ++allow legacy compatibility with the BeOS™ and its 3D GL ++rendering subsystem. +-- +1.8.3.4 +