Hello community, here is the log from the commit of package ghc-GLUT for openSUSE:Factory checked in at 2016-05-17 17:15:50 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-GLUT (Old) and /work/SRC/openSUSE:Factory/.ghc-GLUT.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-GLUT" Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-GLUT/ghc-GLUT.changes 2016-04-22 16:25:21.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-GLUT.new/ghc-GLUT.changes 2016-05-17 17:15:52.000000000 +0200 @@ -1,0 +2,11 @@ +Fri May 13 12:49:19 UTC 2016 - [email protected] + +- update to 2.7.0.10 + +------------------------------------------------------------------- +Thu May 12 18:42:12 UTC 2016 - [email protected] + +- update to 2.7.0.8 +* Relaxed upper version bound for OpenGLRaw. + +------------------------------------------------------------------- Old: ---- GLUT-2.7.0.7.tar.gz New: ---- GLUT-2.7.0.10.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-GLUT.spec ++++++ --- /var/tmp/diff_new_pack.w79qQg/_old 2016-05-17 17:15:53.000000000 +0200 +++ /var/tmp/diff_new_pack.w79qQg/_new 2016-05-17 17:15:53.000000000 +0200 @@ -18,7 +18,7 @@ %global pkg_name GLUT Name: ghc-GLUT -Version: 2.7.0.7 +Version: 2.7.0.10 Release: 0 Summary: A binding for the OpenGL Utility Toolkit License: BSD-3-Clause ++++++ GLUT-2.7.0.7.tar.gz -> GLUT-2.7.0.10.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GLUT-2.7.0.7/CHANGELOG.md new/GLUT-2.7.0.10/CHANGELOG.md --- old/GLUT-2.7.0.7/CHANGELOG.md 2016-04-11 09:26:25.000000000 +0200 +++ new/GLUT-2.7.0.10/CHANGELOG.md 2016-05-12 18:47:38.000000000 +0200 @@ -1,3 +1,16 @@ +2.7.0.10 +-------- +* Mac OS X: Search public frameworks first, then system frameworks. + +2.7.0.9 +-------- +* The GLUT package compiles without any additional library/framework now. +* Windows: We search for a native freeglut DLL, a MinGW freeglut DLL and a classic GLUT DLL, in that order. + +2.7.0.8 +-------- +* Relaxed upper version bound for `OpenGLRaw`. + 2.7.0.7 ------- * Removed redundant constraints. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GLUT-2.7.0.7/GLUT.cabal new/GLUT-2.7.0.10/GLUT.cabal --- old/GLUT-2.7.0.7/GLUT.cabal 2016-04-11 09:26:30.000000000 +0200 +++ new/GLUT-2.7.0.10/GLUT.cabal 2016-05-12 18:47:38.000000000 +0200 @@ -1,5 +1,5 @@ name: GLUT -version: 2.7.0.7 +version: 2.7.0.10 synopsis: A binding for the OpenGL Utility Toolkit description: A Haskell binding for the OpenGL Utility Toolkit, a window system independent @@ -46,7 +46,7 @@ flag UseNativeWindowsLibraries description: When compiling under Windows, use the native libraries instead of e.g. the - ones coming with Cygwin. + ones coming with Cygwin or MSYS. flag BuildExamples description: Build various OpenGL/GLUT examples. @@ -100,14 +100,9 @@ else cpp-options: "-DCALLCONV=ccall" cc-options: "-DUSE_GETPROCADDRESS" - extra-libraries: glut32 else cpp-options: "-DCALLCONV=ccall" cc-options: "-DUSE_DLSYM" - if os(darwin) - frameworks: GLUT - else - extra-libraries: glut executable BOGLGP01-OnYourOwn1 if !flag(BuildExamples) @@ -240,7 +235,7 @@ if !flag(BuildExamples) buildable: False main-is: SmoothOpenGL3.hs - build-depends: base >= 3 && < 5, bytestring >= 0.9 && < 0.11, OpenGLRaw >= 1.0 && < 3.2, GLUT + build-depends: base >= 3 && < 5, bytestring >= 0.9 && < 0.11, OpenGLRaw >= 1.0 && < 3.3, GLUT hs-source-dirs: examples/Misc default-language: Haskell2010 ghc-options: -Wall diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GLUT-2.7.0.7/cbits/HsGLUT.c new/GLUT-2.7.0.10/cbits/HsGLUT.c --- old/GLUT-2.7.0.7/cbits/HsGLUT.c 2015-10-06 10:20:16.000000000 +0200 +++ new/GLUT-2.7.0.10/cbits/HsGLUT.c 2016-05-12 18:47:38.000000000 +0200 @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- * * Module : C support for Graphics.UI.GLUT.Raw - * Copyright : (c) Sven Panne 2002-2013 + * Copyright : (c) Sven Panne 2002-2016 * License : BSD3 * * Maintainer : Sven Panne <[email protected]> @@ -10,68 +10,6 @@ * * -------------------------------------------------------------------------- */ -#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__WATCOMC__) - -#define GLUT_STROKE_ROMAN ((void *)0x0000) -#define GLUT_STROKE_MONO_ROMAN ((void *)0x0001) -#define GLUT_BITMAP_9_BY_15 ((void *)0x0002) -#define GLUT_BITMAP_8_BY_13 ((void *)0x0003) -#define GLUT_BITMAP_TIMES_ROMAN_10 ((void *)0x0004) -#define GLUT_BITMAP_TIMES_ROMAN_24 ((void *)0x0005) -#define GLUT_BITMAP_HELVETICA_10 ((void *)0x0006) -#define GLUT_BITMAP_HELVETICA_12 ((void *)0x0007) -#define GLUT_BITMAP_HELVETICA_18 ((void *)0x0008) - -#else - -extern void* glutStrokeRoman; -extern void* glutStrokeMonoRoman; -extern void* glutBitmap9By15; -extern void* glutBitmap8By13; -extern void* glutBitmapTimesRoman10; -extern void* glutBitmapTimesRoman24; -extern void* glutBitmapHelvetica10; -extern void* glutBitmapHelvetica12; -extern void* glutBitmapHelvetica18; - -#define GLUT_STROKE_ROMAN ((void *)&glutStrokeRoman) -#define GLUT_STROKE_MONO_ROMAN ((void *)&glutStrokeMonoRoman) -#define GLUT_BITMAP_9_BY_15 ((void *)&glutBitmap9By15) -#define GLUT_BITMAP_8_BY_13 ((void *)&glutBitmap8By13) -#define GLUT_BITMAP_TIMES_ROMAN_10 ((void *)&glutBitmapTimesRoman10) -#define GLUT_BITMAP_TIMES_ROMAN_24 ((void *)&glutBitmapTimesRoman24) -#define GLUT_BITMAP_HELVETICA_10 ((void *)&glutBitmapHelvetica10) -#define GLUT_BITMAP_HELVETICA_12 ((void *)&glutBitmapHelvetica12) -#define GLUT_BITMAP_HELVETICA_18 ((void *)&glutBitmapHelvetica18) - -#endif - -void* -hs_GLUT_marshalBitmapFont(int fontID) -{ - switch (fontID) { - case 0 : return GLUT_BITMAP_8_BY_13; - case 1 : return GLUT_BITMAP_9_BY_15; - case 2 : return GLUT_BITMAP_TIMES_ROMAN_10; - case 3 : return GLUT_BITMAP_TIMES_ROMAN_24; - case 4 : return GLUT_BITMAP_HELVETICA_10; - case 5 : return GLUT_BITMAP_HELVETICA_12; - case 6 : return GLUT_BITMAP_HELVETICA_18; - } - return (void*)0; -} - -void* -hs_GLUT_marshalStrokeFont(int fontID) -{ - switch (fontID) { - case 0 : return GLUT_STROKE_ROMAN; - case 1 : return GLUT_STROKE_MONO_ROMAN; - } - return (void*)0; -} - -/* -------------------------------------------------------------------------- */ #if defined(USE_GETPROCADDRESS) #define WIN32_LEAN_AND_MEAN @@ -85,70 +23,126 @@ if (firstTime) { firstTime = 0; - handle = LoadLibrary(TEXT("glut32")); + + /* Try to load freeglut first, it has a few extra features compared to + classic GLUT. */ + handle = LoadLibrary(TEXT("freeglut")); + + /* The MinGW-w64 version of freeglut prefixes "lib" onto the DLL name. */ + if (!handle) { + handle = LoadLibrary(TEXT("libfreeglut")); + } + + /* If no freeglut version is found, try plain old glut32 instead. */ + if (!handle) { + handle = LoadLibrary(TEXT("glut32")); + } } return handle ? GetProcAddress(handle, name) : NULL; } /* -------------------------------------------------------------------------- */ -#elif defined(USE_NSADDRESSOFSYMBOL) +#elif defined(USE_DLSYM) -#include <mach-o/dyld.h> #include <stdlib.h> -#include <string.h> +#include <dlfcn.h> void* hs_GLUT_getProcAddress(const char *name) { - NSSymbol symbol; - - /* Prepend a '_' for the Unix C symbol mangling convention */ - char* symbolName = (char*)malloc(strlen(name) + 2); - if (!symbolName) { - return NULL; - } - symbolName[0] = '_'; - strcpy(symbolName + 1, name); + static int firstTime = 1; + static void *handle = NULL; - if (!NSIsSymbolNameDefined(symbolName)) { - free(symbolName); - return NULL; - } + if (firstTime) { + firstTime = 0; - symbol = NSLookupAndBindSymbol(symbolName); - free(symbolName); - if (!symbol) { - return NULL; +#ifdef __APPLE__ + /* Try public framework path first. */ + handle = dlopen("/Library/Frameworks/GLUT.framework/GLUT", RTLD_LAZY | RTLD_GLOBAL); + + /* If the public path failed, try the system framework path. */ + if (!handle) { + handle = dlopen("/System/Library/Frameworks/GLUT.framework/GLUT", RTLD_LAZY | RTLD_GLOBAL); + } +#else + handle = dlopen("libglut.so", RTLD_LAZY | RTLD_GLOBAL); +#endif } - return NSAddressOfSymbol(symbol); + return handle ? dlsym(handle, name) : NULL; } /* -------------------------------------------------------------------------- */ -#elif defined(USE_DLSYM) +#else -#include <stdlib.h> -#include <dlfcn.h> +#error "Don't know how to retrieve GLUT entries" + +#endif + +/* -------------------------------------------------------------------------- */ + +/* Note: This #if below is in sync with freeglut_std.h, classic GLUT simply used + #if defined(_WIN32). */ +#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__WATCOMC__) +#define INIT_FONT(name,num) hs_##name = ((void*)(num)) +#else +#define INIT_FONT(name,num) hs_##name = hs_GLUT_getProcAddress(#name) +#endif void* -hs_GLUT_getProcAddress(const char *name) +hs_GLUT_marshalBitmapFont(int fontID) { static int firstTime = 1; - static void *handle = NULL; + static void *hs_glutBitmap9By15 = NULL; + static void *hs_glutBitmap8By13 = NULL; + static void *hs_glutBitmapTimesRoman10 = NULL; + static void *hs_glutBitmapTimesRoman24 = NULL; + static void *hs_glutBitmapHelvetica10 = NULL; + static void *hs_glutBitmapHelvetica12 = NULL; + static void *hs_glutBitmapHelvetica18 = NULL; if (firstTime) { firstTime = 0; - /* Get a handle for our executable. */ - handle = dlopen(NULL, RTLD_LAZY); + + INIT_FONT(glutBitmap9By15, 0x0002); + INIT_FONT(glutBitmap8By13, 0x0003); + INIT_FONT(glutBitmapTimesRoman10, 0x0004); + INIT_FONT(glutBitmapTimesRoman24, 0x0005); + INIT_FONT(glutBitmapHelvetica10, 0x0006); + INIT_FONT(glutBitmapHelvetica12, 0x0007); + INIT_FONT(glutBitmapHelvetica18, 0x0008); } - return handle ? dlsym(handle, name) : NULL; + switch (fontID) { + case 0 : return hs_glutBitmap8By13; + case 1 : return hs_glutBitmap9By15; + case 2 : return hs_glutBitmapTimesRoman10; + case 3 : return hs_glutBitmapTimesRoman24; + case 4 : return hs_glutBitmapHelvetica10; + case 5 : return hs_glutBitmapHelvetica12; + case 6 : return hs_glutBitmapHelvetica18; + } + return (void*)0; } -/* -------------------------------------------------------------------------- */ -#else +void* +hs_GLUT_marshalStrokeFont(int fontID) +{ + static int firstTime = 1; + static void *hs_glutStrokeRoman = NULL; + static void *hs_glutStrokeMonoRoman = NULL; -#error "Don't know how to retrieve GLUT entries" + if (firstTime) { + firstTime = 0; -#endif + INIT_FONT(glutStrokeRoman, 0x0000); + INIT_FONT(glutStrokeMonoRoman, 0x0001); + } + + switch (fontID) { + case 0 : return hs_glutStrokeRoman; + case 1 : return hs_glutStrokeMonoRoman; + } + return (void*)0; +}
