2014-10-26 00:01:28 +00:00
|
|
|
require "formula"
|
2011-11-28 09:21:43 +00:00
|
|
|
|
|
|
|
class Babl < Formula
|
2014-10-26 00:01:28 +00:00
|
|
|
homepage "http://www.gegl.org/babl/"
|
|
|
|
|
|
|
|
stable do
|
|
|
|
# The official url is unreliable. Use Debian instead.
|
|
|
|
url "https://mirrors.kernel.org/debian/pool/main/b/babl/babl_0.1.10.orig.tar.bz2"
|
|
|
|
mirror "http://ftp.gtk.org/pub/babl/0.1/babl-0.1.10.tar.bz2"
|
|
|
|
sha1 "ee60089e8e9d9390e730d3ae5e41074549928b7a"
|
|
|
|
|
|
|
|
# There are two patches.
|
|
|
|
# The first one changes an include <values.h> (deleted on Mac OS X) to <limits.h>
|
|
|
|
# The second one fixes an error when compiling with clang. See:
|
|
|
|
# https://trac.macports.org/browser/trunk/dports/graphics/babl/files/clang.patch
|
|
|
|
patch :DATA
|
|
|
|
end
|
|
|
|
|
2014-10-26 11:36:18 +00:00
|
|
|
bottle do
|
|
|
|
sha1 "d3ead1808b7c029ab864d3318d7009379cc205a5" => :yosemite
|
|
|
|
sha1 "4fcb4a9c92b59796d40ffc4312935ca756d5264f" => :mavericks
|
|
|
|
sha1 "a35994e97093d303d02d30c3369bccfd1f33af37" => :mountain_lion
|
|
|
|
end
|
|
|
|
|
2014-10-26 00:01:28 +00:00
|
|
|
head do
|
|
|
|
# Use Github instead of GNOME's git. The latter is unreliable.
|
|
|
|
url "https://github.com/GNOME/babl.git"
|
2011-11-28 09:21:43 +00:00
|
|
|
|
2014-10-26 00:01:28 +00:00
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "libtool" => :build
|
|
|
|
end
|
2011-11-28 09:21:43 +00:00
|
|
|
|
2014-10-26 00:01:28 +00:00
|
|
|
depends_on "pkg-config" => :build
|
2011-11-28 09:21:43 +00:00
|
|
|
|
2012-08-09 05:07:31 +00:00
|
|
|
option :universal
|
2011-11-28 09:21:43 +00:00
|
|
|
|
|
|
|
def install
|
2012-08-09 05:07:31 +00:00
|
|
|
if build.universal?
|
2011-11-28 09:21:43 +00:00
|
|
|
ENV.universal_binary
|
2012-03-11 02:09:15 +00:00
|
|
|
if ENV.compiler == :gcc
|
2014-10-26 00:01:28 +00:00
|
|
|
opoo "Compilation may fail at babl-cpuaccel.c using gcc for a universal build"
|
2012-03-11 02:09:15 +00:00
|
|
|
end
|
2011-11-28 09:21:43 +00:00
|
|
|
end
|
|
|
|
|
2014-10-26 00:01:28 +00:00
|
|
|
system "./autogen.sh" if build.head?
|
2012-03-11 02:09:15 +00:00
|
|
|
system "./configure", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}"
|
2014-10-26 00:01:28 +00:00
|
|
|
system "make", "install"
|
2011-11-28 09:21:43 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
__END__
|
2014-03-17 16:12:54 +00:00
|
|
|
diff --git a/babl/babl-palette.c b/babl/babl-palette.c
|
|
|
|
index 7e72eaa..2f9bf8d 100644
|
|
|
|
--- a/babl/babl-palette.c
|
|
|
|
+++ b/babl/babl-palette.c
|
|
|
|
@@ -19,7 +19,7 @@
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
-#include <values.h>
|
|
|
|
+#include <limits.h>
|
|
|
|
#include <assert.h>
|
|
|
|
#include "config.h"
|
|
|
|
#include "babl-internal.h"
|
|
|
|
diff --git a/extensions/sse-fixups.c b/extensions/sse-fixups.c
|
|
|
|
index b44bb5e..7f633d1 100644
|
|
|
|
--- a/extensions/sse-fixups.c
|
|
|
|
+++ b/extensions/sse-fixups.c
|
|
|
|
@@ -21,7 +21,7 @@
|
2014-10-26 11:36:18 +00:00
|
|
|
|
2014-03-17 16:12:54 +00:00
|
|
|
#include "config.h"
|
2014-10-26 11:36:18 +00:00
|
|
|
|
2014-03-17 16:12:54 +00:00
|
|
|
-#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(USE_SSE) && defined(USE_MMX)
|
|
|
|
+#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 4) && defined(USE_SSE) && defined(USE_MMX)
|
2014-10-26 11:36:18 +00:00
|
|
|
|
2014-03-17 16:12:54 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
@@ -177,7 +177,7 @@ int init (void);
|
|
|
|
int
|
|
|
|
init (void)
|
|
|
|
{
|
|
|
|
-#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(USE_SSE) && defined(USE_MMX)
|
|
|
|
+#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 4) && defined(USE_SSE) && defined(USE_MMX)
|
2014-10-26 11:36:18 +00:00
|
|
|
|
2014-03-17 16:12:54 +00:00
|
|
|
const Babl *rgbaF_linear = babl_format_new (
|
|
|
|
babl_model ("RGBA"),
|