From 47a59544dc92725a9582cbb1b9b7f8492746d153 Mon Sep 17 00:00:00 2001 From: extrowerk Date: Sun, 5 Nov 2017 19:18:58 +0100 Subject: [PATCH] GLEW: bump version, recipe cleanup (#1766) --- media-libs/glew/glew-1.13.0.recipe | 26 ++--- media-libs/glew/glew-2.1.0.recipe | 81 +++++++++++++ media-libs/glew/patches/glew-2.1.0.patchset | 121 ++++++++++++++++++++ 3 files changed, 213 insertions(+), 15 deletions(-) create mode 100644 media-libs/glew/glew-2.1.0.recipe create mode 100644 media-libs/glew/patches/glew-2.1.0.patchset diff --git a/media-libs/glew/glew-1.13.0.recipe b/media-libs/glew/glew-1.13.0.recipe index e5c4deaeb..bf2b287ab 100644 --- a/media-libs/glew/glew-1.13.0.recipe +++ b/media-libs/glew/glew-1.13.0.recipe @@ -1,26 +1,22 @@ 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. -" -LICENSE="BSD (3-clause)" -COPYRIGHT=" - 2007 The Kronos Group Inc. +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 - " -HOMEPAGE="http://glew.sourceforge.net" -SOURCE_URI="http://downloads.sourceforge.net/project/glew/glew/${portVersion}/glew-${portVersion}.tgz" -CHECKSUM_SHA256="aa25dc48ed84b0b64b8d41cdd42c8f40f149c37fa2ffa39cd97f42c78d128bc7" + 2002 Lev Povalahev" +LICENSE="BSD (3-clause)" REVISION="5" +SOURCE_URI="http://downloads.sourceforge.net/project/glew/glew/${portVersion}/glew-${portVersion}.tgz" +CHECKSUM_SHA256="04de91e7e6763039bc11940095cd9c7f880baba82196a7765f727ac05a993c95" +PATCHES="glew-$portVersion.patchset" ARCHITECTURES="x86 x86_gcc2 x86_64" SECONDARY_ARCHITECTURES="x86_gcc2 x86" -PATCHES="glew-$portVersion.patchset" - PROVIDES=" glew$secondaryArchSuffix = $portVersion lib:libglew$secondaryArchSuffix = $portVersion compat >= 1 diff --git a/media-libs/glew/glew-2.1.0.recipe b/media-libs/glew/glew-2.1.0.recipe new file mode 100644 index 000000000..109bf9c99 --- /dev/null +++ b/media-libs/glew/glew-2.1.0.recipe @@ -0,0 +1,81 @@ +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" +PATCHES="glew-$portVersion.patchset" + +ARCHITECTURES="x86_gcc2 x86 x86_64" +SECONDARY_ARCHITECTURES="x86_gcc2 x86" + + +PROVIDES=" + glew$secondaryArchSuffix = $portVersion + cmd:glewinfo = $portVersion + cmd:visualinfo = $portVersion + lib:libglew$secondaryArchSuffix = $portVersion compat >= 2 + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libgl$secondaryArchSuffix + " + +PROVIDES_devel=" + glew${secondaryArchSuffix}_devel = $portVersion + devel:libglew$secondaryArchSuffix = $portVersion compat >= 2 + " +REQUIRES_devel=" + glew$secondaryArchSuffix == $portVersion base + devel:libGL$secondaryArchSuffix + devel:libGLU$secondaryArchSuffix + " + +PROVIDES_util=" + glew${secondaryArchSuffix}_util = $portVersion + cmd:glewinfo$secondaryArchSuffix + cmd:visualinfo$secondaryArchSuffix + " +REQUIRES_util=" + glew$secondaryArchSuffix == $portVersion base + haiku$secondaryArchSuffix + lib:libGL$secondaryArchSuffix + lib:libglew$secondaryArchSuffix + " + +BUILD_REQUIRES=" + devel:libgl$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel + cmd:gcc$secondaryArchSuffix + cmd:g++$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:libtoolize$secondaryArchSuffix + cmd:make + " + +BUILD() +{ + make $jobArgs GLEW_DEST=$prefix BINDIR=$binDir LIBDIR=$libDir INCDIR=$includeDir/GL +} + +INSTALL() +{ + make install.all GLEW_DEST=$prefix BINDIR=$binDir LIBDIR=$libDir INCDIR=$includeDir/GL + + prepareInstalledDevelLib libGLEW + fixPkgconfig + + packageEntries devel $developDir + packageEntries util $binDir +} diff --git a/media-libs/glew/patches/glew-2.1.0.patchset b/media-libs/glew/patches/glew-2.1.0.patchset new file mode 100644 index 000000000..0ef502dbd --- /dev/null +++ b/media-libs/glew/patches/glew-2.1.0.patchset @@ -0,0 +1,121 @@ +From 5cf1b0b434baf6594f44f172c00f1721d6fcc190 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +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 ++ * All rights reserved. Distributed under the terms of the MIT license. ++ */ ++ ++#include ++#include ++#include ++ ++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 +