2012-06-10 16:22:24 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Cogl < Formula
|
2013-01-16 16:01:25 +00:00
|
|
|
homepage 'http://developer.gnome.org/cogl/'
|
2013-10-07 01:56:54 +00:00
|
|
|
url 'http://ftp.gnome.org/pub/gnome/sources/cogl/1.14/cogl-1.14.0.tar.xz'
|
|
|
|
sha256 '276e8c9f5ff0fcd57c1eaf74cc245f41ad469a95a18ac831fac2d5960baa5ae8'
|
2012-06-10 16:22:24 +00:00
|
|
|
|
2014-03-13 23:15:08 +00:00
|
|
|
head do
|
|
|
|
url "git://git.gnome.org/cogl"
|
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "libtool" => :build
|
|
|
|
end
|
2012-06-10 16:22:24 +00:00
|
|
|
|
2012-10-24 05:55:46 +00:00
|
|
|
option 'without-x', 'Build without X11 support'
|
|
|
|
|
2012-06-10 16:22:24 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2013-12-09 21:10:40 +00:00
|
|
|
depends_on 'cairo'
|
2012-08-23 05:53:09 +00:00
|
|
|
depends_on 'glib'
|
2012-06-10 16:22:24 +00:00
|
|
|
depends_on 'pango'
|
2014-03-06 20:40:26 +00:00
|
|
|
depends_on :x11 => '2.5.1' if build.with? 'x'
|
2012-06-10 16:22:24 +00:00
|
|
|
|
2013-10-07 01:56:54 +00:00
|
|
|
def patches
|
|
|
|
# Patch from MacPorts, reported upstream at https://bugzilla.gnome.org/show_bug.cgi?id=708825
|
|
|
|
# https://trac.macports.org/browser/trunk/dports/graphics/cogl/files/patch-clock_gettime.diff
|
|
|
|
DATA
|
|
|
|
end
|
|
|
|
|
2012-06-10 16:22:24 +00:00
|
|
|
def install
|
2012-08-27 05:17:49 +00:00
|
|
|
system "./autogen.sh" if build.head?
|
2012-10-24 05:55:46 +00:00
|
|
|
args = %W[
|
|
|
|
--disable-dependency-tracking
|
2013-10-07 01:56:55 +00:00
|
|
|
--disable-silent-rules
|
2012-10-24 05:55:46 +00:00
|
|
|
--prefix=#{prefix}
|
2013-10-07 01:56:55 +00:00
|
|
|
--enable-cogl-pango=yes
|
2012-10-24 05:55:46 +00:00
|
|
|
--disable-introspection
|
|
|
|
]
|
2013-07-14 03:56:45 +00:00
|
|
|
args << '--without-x' if build.without? 'x'
|
2012-10-24 05:55:46 +00:00
|
|
|
system './configure', *args
|
2012-06-10 16:22:24 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|
2013-10-07 01:56:54 +00:00
|
|
|
__END__
|
|
|
|
diff --git a/cogl/winsys/cogl-winsys-glx.c b/cogl/winsys/cogl-winsys-glx.c
|
|
|
|
--- a/cogl/winsys/cogl-winsys-glx.c
|
|
|
|
+++ b/cogl/winsys/cogl-winsys-glx.c
|
|
|
|
@@ -56,7 +56,26 @@
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
+
|
|
|
|
+#ifdef __MACH__
|
|
|
|
+#include <mach/mach_time.h>
|
|
|
|
+#define CLOCK_REALTIME 0
|
|
|
|
+#define CLOCK_MONOTONIC 0
|
2014-03-06 20:40:26 +00:00
|
|
|
+static int
|
2013-10-07 01:56:54 +00:00
|
|
|
+clock_gettime(int clk_id, struct timespec *t){
|
|
|
|
+ mach_timebase_info_data_t timebase;
|
|
|
|
+ mach_timebase_info(&timebase);
|
|
|
|
+ uint64_t time;
|
|
|
|
+ time = mach_absolute_time();
|
|
|
|
+ double nseconds = ((double)time * (double)timebase.numer)/((double)timebase.denom);
|
|
|
|
+ double seconds = ((double)time * (double)timebase.numer)/((double)timebase.denom * 1e9);
|
|
|
|
+ t->tv_sec = seconds;
|
|
|
|
+ t->tv_nsec = nseconds;
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+#else
|
|
|
|
#include <time.h>
|
|
|
|
+#endif
|
2014-03-06 20:40:26 +00:00
|
|
|
|
2013-10-07 01:56:54 +00:00
|
|
|
#include <glib/gi18n-lib.h>
|