diff options
author | hubertf <hubertf@pkgsrc.org> | 2013-10-31 21:28:07 +0000 |
---|---|---|
committer | hubertf <hubertf@pkgsrc.org> | 2013-10-31 21:28:07 +0000 |
commit | fda3351262b4bc92b66aab23449cfe4663337f1f (patch) | |
tree | db917cc20e2ba757973e1b01a0686050ca211d1d /graphics/cogl | |
parent | fd1fc75ac7d6cb1ad323b609e351b8f5f2dc6647 (diff) | |
download | pkgsrc-fda3351262b4bc92b66aab23449cfe4663337f1f.tar.gz |
Make this build on Mac OS X.
Diffstat (limited to 'graphics/cogl')
-rw-r--r-- | graphics/cogl/Makefile | 4 | ||||
-rw-r--r-- | graphics/cogl/distinfo | 3 | ||||
-rw-r--r-- | graphics/cogl/patches/patch-cogl-winsys-cogl-winsys-glx.c | 83 |
3 files changed, 87 insertions, 3 deletions
diff --git a/graphics/cogl/Makefile b/graphics/cogl/Makefile index bc61ca4597c..3a4d75abe71 100644 --- a/graphics/cogl/Makefile +++ b/graphics/cogl/Makefile @@ -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 --git a/graphics/cogl/distinfo b/graphics/cogl/distinfo index ba056bdb5d4..80e3cfa2e9d 100644 --- a/graphics/cogl/distinfo +++ b/graphics/cogl/distinfo @@ -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 --git a/graphics/cogl/patches/patch-cogl-winsys-cogl-winsys-glx.c b/graphics/cogl/patches/patch-cogl-winsys-cogl-winsys-glx.c new file mode 100644 index 00000000000..217aec2e12e --- /dev/null +++ b/graphics/cogl/patches/patch-cogl-winsys-cogl-winsys-glx.c @@ -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, + ¤t_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; + } |