mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
glew: add compat recipe for version 2.1
This commit is contained in:
60
media-libs/glew/glew21-2.1.0.recipe
Normal file
60
media-libs/glew/glew21-2.1.0.recipe
Normal file
@@ -0,0 +1,60 @@
|
||||
SUMMARY="The OpenGL Extension Wrangler Library"
|
||||
DESCRIPTION="The OpenGL Extension Wrangler Library (GLEW) is a cross-platform \
|
||||
open-source C/C++ extension loading library. GLEW provides efficient run-time \
|
||||
mechanisms for determining which OpenGL extensions are supported on the target \
|
||||
platform."
|
||||
HOMEPAGE="http://glew.sourceforge.net/"
|
||||
COPYRIGHT="2007 The Kronos Group Inc.
|
||||
2002-2007 Milan Ikits
|
||||
2002-2007 Marcelo E. Magallon
|
||||
2002 Lev Povalahev
|
||||
1999-2007 Brian Paul"
|
||||
LICENSE="BSD (3-clause)"
|
||||
REVISION="1"
|
||||
SOURCE_URI="http://downloads.sourceforge.net/project/glew/glew/${portVersion}/glew-${portVersion}.tgz"
|
||||
CHECKSUM_SHA256="04de91e7e6763039bc11940095cd9c7f880baba82196a7765f727ac05a993c95"
|
||||
SOURCE_DIR="glew-$portVersion"
|
||||
PATCHES="glew-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="x86_gcc2 x86 x86_64"
|
||||
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
|
||||
|
||||
PROVIDES="
|
||||
glew21$secondaryArchSuffix = $portVersion
|
||||
lib:libglew$secondaryArchSuffix = $portVersion compat >= 2.1
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
lib:libgl$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
devel:libgl$secondaryArchSuffix
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
cmd:g++$secondaryArchSuffix
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:ld$secondaryArchSuffix
|
||||
cmd:libtoolize$secondaryArchSuffix
|
||||
cmd:make
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
make $jobArgs GLEW_DEST=$prefix BINDIR=$binDir LIBDIR=$libDir \
|
||||
INCDIR=$includeDir/GL PKGDIR=$developLibDir/pkgconfig
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
make install.all GLEW_DEST=$prefix BINDIR=$binDir LIBDIR=$libDir \
|
||||
INCDIR=$includeDir/GL PKGDIR=$developLibDir/pkgconfig
|
||||
|
||||
rm $libDir/libGLEW.a
|
||||
|
||||
prepareInstalledDevelLib libGLEW
|
||||
fixPkgconfig
|
||||
|
||||
rm -rf $binDir $developDir
|
||||
}
|
||||
121
media-libs/glew/patches/glew-2.1.0.patchset
Normal file
121
media-libs/glew/patches/glew-2.1.0.patchset
Normal file
@@ -0,0 +1,121 @@
|
||||
From 5cf1b0b434baf6594f44f172c00f1721d6fcc190 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Wed, 20 Aug 2014 16:50:24 +0000
|
||||
Subject: updated Haiku patch
|
||||
|
||||
|
||||
diff --git a/src/glewinfo.c b/src/glewinfo.c
|
||||
index 882654d..e6e3456 100644
|
||||
--- a/src/glewinfo.c
|
||||
+++ b/src/glewinfo.c
|
||||
@@ -16373,7 +16373,7 @@ int main (int argc, char** argv)
|
||||
#elif defined(GLEW_EGL)
|
||||
#elif defined(_WIN32)
|
||||
fprintf(f, "Reporting capabilities of pixelformat %d\n", params.pixelformat);
|
||||
-#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
|
||||
+#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
|
||||
fprintf(f, "Reporting capabilities of display %s, visual 0x%x\n",
|
||||
params.display == NULL ? getenv("DISPLAY") : params.display, params.visual);
|
||||
#endif
|
||||
diff --git a/src/glewinfo_haiku.cpp b/src/glewinfo_haiku.cpp
|
||||
new file mode 100644
|
||||
index 0000000..3d32d00
|
||||
--- /dev/null
|
||||
+++ b/src/glewinfo_haiku.cpp
|
||||
@@ -0,0 +1,93 @@
|
||||
+/*
|
||||
+ * glewinfo Haiku glue code
|
||||
+ * Copyright 2013 Kacper Kasper <kacperkasper@gmail.com>
|
||||
+ * All rights reserved. Distributed under the terms of the MIT license.
|
||||
+ */
|
||||
+
|
||||
+#include <Application.h>
|
||||
+#include <Window.h>
|
||||
+#include <GLView.h>
|
||||
+
|
||||
+class GLEWInfoView : public BGLView {
|
||||
+public:
|
||||
+ GLEWInfoView(BRect frame, uint32 type);
|
||||
+ virtual void AttachedToWindow(void);
|
||||
+
|
||||
+ void ContextInit() { LockGL(); }
|
||||
+ void ContextDestroy() { UnlockGL(); }
|
||||
+};
|
||||
+
|
||||
+GLEWInfoView::GLEWInfoView(BRect frame, uint32 type)
|
||||
+ : BGLView(frame, "GLEWInfoView", B_FOLLOW_ALL_SIDES, 0, type)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+void GLEWInfoView::AttachedToWindow(void)
|
||||
+{
|
||||
+ LockGL();
|
||||
+ BGLView::AttachedToWindow();
|
||||
+ UnlockGL();
|
||||
+}
|
||||
+
|
||||
+class GLEWInfoWindow : public BWindow {
|
||||
+public:
|
||||
+ GLEWInfoWindow(BRect frame, uint32 type);
|
||||
+ virtual bool QuitRequested();
|
||||
+
|
||||
+private:
|
||||
+ GLEWInfoView *view;
|
||||
+};
|
||||
+
|
||||
+GLEWInfoWindow::GLEWInfoWindow(BRect frame, uint32 type)
|
||||
+ : BWindow(frame, "GLEWInfoWindow", B_TITLED_WINDOW, B_QUIT_ON_WINDOW_CLOSE)
|
||||
+{
|
||||
+ AddChild(view = new GLEWInfoView(Bounds(), type));
|
||||
+ view->ContextInit();
|
||||
+}
|
||||
+
|
||||
+bool GLEWInfoWindow::QuitRequested()
|
||||
+{
|
||||
+ view->ContextDestroy();
|
||||
+
|
||||
+ view->RemoveSelf();
|
||||
+
|
||||
+ delete view;
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+class GLEWInfoApp : public BApplication
|
||||
+{
|
||||
+public:
|
||||
+ GLEWInfoApp();
|
||||
+ ~GLEWInfoApp();
|
||||
+
|
||||
+private:
|
||||
+ GLEWInfoWindow *window;
|
||||
+};
|
||||
+
|
||||
+GLEWInfoApp::GLEWInfoApp()
|
||||
+ : BApplication("application/x-vnd.glew-GLEWInfo")
|
||||
+{
|
||||
+ BRect rect = BRect(0, 0, 1, 1);
|
||||
+ window = new GLEWInfoWindow(rect, BGL_RGB | BGL_DOUBLE);
|
||||
+}
|
||||
+
|
||||
+GLEWInfoApp::~GLEWInfoApp()
|
||||
+{
|
||||
+ window->Quit();
|
||||
+}
|
||||
+
|
||||
+GLEWInfoApp *app;
|
||||
+
|
||||
+extern "C" GLboolean glewCreateContext ()
|
||||
+{
|
||||
+ app = new GLEWInfoApp();
|
||||
+
|
||||
+ return GL_FALSE;
|
||||
+}
|
||||
+
|
||||
+extern "C" void glewDestroyContext ()
|
||||
+{
|
||||
+ delete app;
|
||||
+}
|
||||
--
|
||||
2.14.2
|
||||
|
||||
Reference in New Issue
Block a user