packages feed

GLURaw 2.0.0.2 → 2.0.0.3

raw patch · 4 files changed

+22/−14 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+2.0.0.3+-------+* Fixed dynamic loading of GLU library for recent GHC versions.+ 2.0.0.2 ------- * Relaxed upper version bound for `OpenGLRaw`.
GLURaw.cabal view
@@ -1,5 +1,5 @@ name: GLURaw-version: 2.0.0.2+version: 2.0.0.3 synopsis: A raw binding for the OpenGL graphics system description:   GLURaw is a raw Haskell binding for the GLU 1.3 OpenGL utility library. It is
README.md view
@@ -1,1 +1,4 @@-[![Hackage](https://img.shields.io/hackage/v/GLURaw.svg)](https://hackage.haskell.org/package/GLURaw) [![Build Status](https://travis-ci.org/haskell-opengl/GLURaw.png?branch=master)](https://travis-ci.org/haskell-opengl/GLURaw)+[![Hackage](https://img.shields.io/hackage/v/GLURaw.svg)](https://hackage.haskell.org/package/GLURaw)+[![Stackage LTS](https://www.stackage.org/package/GLURaw/badge/lts)](https://www.stackage.org/lts/package/GLURaw)+[![Stackage nightly](https://www.stackage.org/package/GLURaw/badge/nightly)](https://www.stackage.org/nightly/package/GLURaw)+[![Build Status](https://img.shields.io/travis/haskell-opengl/GLURaw/master.svg)](https://travis-ci.org/haskell-opengl/GLURaw)
cbits/HsGLURaw.c view
@@ -69,10 +69,16 @@ #include <stdlib.h> #include <dlfcn.h> -#ifndef __APPLE__-#include <stdio.h>-#include <GL/glu.h>+static const char* libNames[] = {+#ifdef __APPLE__+  /* Try public framework path first. */+  "/Library/Frameworks/OpenGL.framework/OpenGL",+  /* If the public path failed, try the system framework path. */+  "/System/Library/Frameworks/OpenGL.framework/OpenGL"+#else+  "libGLU.so", "libGLU.so.1" #endif+};  void* hs_GLU_getProcAddress(const char *name)@@ -81,17 +87,12 @@   static void *handle = NULL;    if (firstTime) {+    int i, numNames = (int)(sizeof(libNames) / sizeof(libNames[0]));     firstTime = 0;-    /* Get a handle for our executable. */-    handle = dlopen(NULL, RTLD_LAZY);+    for (i = 0;   (!handle) && (i < numNames);   ++i) {+      handle = dlopen(libNames[i], RTLD_LAZY | RTLD_GLOBAL);+    }   }--#ifndef __APPLE__-  /* Hack to force linking of GLU on Linux */-  FILE *bitbucket = fopen("/dev/null", "w");-  fprintf(bitbucket, "%p\n", gluBeginCurve);-  fclose(bitbucket); -#endif    return handle ? dlsym(handle, name) : NULL; }