pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics/cogl Make this build on Mac OS X.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/4eeed2d68320
branches:  trunk
changeset: 626082:4eeed2d68320
user:      hubertf <hubertf%pkgsrc.org@localhost>
date:      Thu Oct 31 21:28:07 2013 +0000

description:
Make this build on Mac OS X.

diffstat:

 graphics/cogl/Makefile                                    |   4 +-
 graphics/cogl/distinfo                                    |   3 +-
 graphics/cogl/patches/patch-cogl-winsys-cogl-winsys-glx.c |  83 +++++++++++++++
 3 files changed, 87 insertions(+), 3 deletions(-)

diffs (112 lines):

diff -r 8780d1b618a5 -r 4eeed2d68320 graphics/cogl/Makefile
--- a/graphics/cogl/Makefile    Thu Oct 31 15:58:30 2013 +0000
+++ b/graphics/cogl/Makefile    Thu Oct 31 21:28:07 2013 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.3 2013/10/10 14:42:12 ryoon Exp $
+# $NetBSD: Makefile,v 1.4 2013/10/31 21:28:07 hubertf Exp $
 #
 
 DISTNAME=      cogl-1.14.0
-PKGREVISION=   2
+PKGREVISION=   3
 CATEGORIES=    graphics
 MASTER_SITES=  ${MASTER_SITE_GNOME:=sources/cogl/1.14/}
 EXTRACT_SUFX=  .tar.xz
diff -r 8780d1b618a5 -r 4eeed2d68320 graphics/cogl/distinfo
--- a/graphics/cogl/distinfo    Thu Oct 31 15:58:30 2013 +0000
+++ b/graphics/cogl/distinfo    Thu Oct 31 21:28:07 2013 +0000
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.1 2013/07/15 01:19:04 obache Exp $
+$NetBSD: distinfo,v 1.2 2013/10/31 21:28:07 hubertf Exp $
 
 SHA1 (cogl-1.14.0.tar.xz) = ff9a60b54fe79eb336af9c1b686f71f6af6f84f9
 RMD160 (cogl-1.14.0.tar.xz) = 69a87d46c21999bde675a518ab3cbb5dfa159131
 Size (cogl-1.14.0.tar.xz) = 1656520 bytes
+SHA1 (patch-cogl-winsys-cogl-winsys-glx.c) = fcb293eabeaac7037b77a5f7be0fd3e4e79cccd8
diff -r 8780d1b618a5 -r 4eeed2d68320 graphics/cogl/patches/patch-cogl-winsys-cogl-winsys-glx.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/cogl/patches/patch-cogl-winsys-cogl-winsys-glx.c Thu Oct 31 21:28:07 2013 +0000
@@ -0,0 +1,83 @@
+$NetBSD: patch-cogl-winsys-cogl-winsys-glx.c,v 1.1 2013/10/31 21:28:07 hubertf Exp $
+
+--- cogl/winsys/cogl-winsys-glx.c.orig 2013-02-21 15:41:08.000000000 +0000
++++ cogl/winsys/cogl-winsys-glx.c
+@@ -58,6 +58,12 @@
+ #include <fcntl.h>
+ #include <time.h>
+ 
++/* HF: From http://stackoverflow.com/questions/5167269/clock-gettime-alternative-in-mac-os-x */
++#ifdef __MACH__
++#include <mach/clock.h>
++#include <mach/mach.h>
++#endif
++
+ #include <glib/gi18n-lib.h>
+ 
+ #include <GL/glx.h>
+@@ -214,7 +220,20 @@ ensure_ust_type (CoglRenderer *renderer,
+ 
+   /* This is the time source that the newer (fixed) linux drm
+    * drivers use (Linux >= 3.8) */
+-  clock_gettime (CLOCK_MONOTONIC, &ts);
++/* HF: From http://stackoverflow.com/questions/5167269/clock-gettime-alternative-in-mac-os-x */
++#ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time
++  {
++    clock_serv_t cclock;
++    mach_timespec_t mts;
++    host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
++    clock_get_time(cclock, &mts);
++    mach_port_deallocate(mach_task_self(), cclock);
++    ts.tv_sec = mts.tv_sec;
++    ts.tv_nsec = mts.tv_nsec;
++  }
++#else
++  clock_gettime(CLOCK_REALTIME, &ts);
++#endif
+   current_monotonic_time = (ts.tv_sec * G_GINT64_CONSTANT (1000000)) +
+     (ts.tv_nsec / G_GINT64_CONSTANT (1000));
+ 
+@@ -294,7 +313,20 @@ _cogl_winsys_get_clock_time (CoglContext
+       {
+         struct timespec ts;
+ 
+-        clock_gettime (CLOCK_MONOTONIC, &ts);
++/* HF: From http://stackoverflow.com/questions/5167269/clock-gettime-alternative-in-mac-os-x */
++#ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time
++        {
++          clock_serv_t cclock;
++          mach_timespec_t mts;
++          host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
++          clock_get_time(cclock, &mts);
++          mach_port_deallocate(mach_task_self(), cclock);
++          ts.tv_sec = mts.tv_sec;
++          ts.tv_nsec = mts.tv_nsec;
++        }
++#else
++        clock_gettime(CLOCK_REALTIME, &ts);
++#endif
+         return ts.tv_sec * G_GINT64_CONSTANT (1000000000) + ts.tv_nsec;
+       }
+     }
+@@ -1500,7 +1532,20 @@ _cogl_winsys_wait_for_vblank (CoglOnscre
+                                           (current_count + 1) % 2,
+                                           &current_count);
+ 
+-          clock_gettime (CLOCK_MONOTONIC, &ts);
++/* HF: From http://stackoverflow.com/questions/5167269/clock-gettime-alternative-in-mac-os-x */
++#ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time
++          {
++            clock_serv_t cclock;
++            mach_timespec_t mts;
++            host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
++            clock_get_time(cclock, &mts);
++            mach_port_deallocate(mach_task_self(), cclock);
++            ts.tv_sec = mts.tv_sec;
++            ts.tv_nsec = mts.tv_nsec;
++          }
++#else
++          clock_gettime(CLOCK_REALTIME, &ts);
++#endif
+           info->presentation_time =
+             ts.tv_sec * G_GINT64_CONSTANT (1000000000) + ts.tv_nsec;
+         }



Home | Main Index | Thread Index | Old Index