aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/babl.rb
blob: c46d9e8c9b81fafe2ad042d4a7b03ba127d660ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
require 'formula'

class Babl < Formula
  url 'ftp://ftp.gimp.org/pub/babl/0.1/babl-0.1.6.tar.bz2'
  homepage 'http://www.gegl.org/babl/'
  md5 'dc960981a5ec5330fc1c177be9f59068'

  head 'git://git.gnome.org/babl'

  depends_on 'pkg-config' => :build

  def options
  [
    ["--universal", "Builds a universal binary"],
  ]
  end

  def patches
    # Fixes an error when compiling with clang
    # The fix was found on macports: https://trac.macports.org/browser/trunk/dports/graphics/babl/files/clang.patch
    { :p0 => DATA }
  end

  def install
    if ARGV.build_universal?
      ENV.universal_binary
      opoo 'Compilation may fail at babl-cpuaccel.c using gcc for a universal build' if ENV.compiler == :gcc
    end

    argv = ["--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}"]

    system "./configure", *argv
    system "/usr/bin/make install"
  end
end

__END__
Index: extensions/sse-fixups.c
===================================================================
--- extensions/sse-fixups.c.orig 2011-06-28 20:01:39.000000000 -0700
+++ extensions/sse-fixups.c 2011-06-28 20:01:29.000000000 -0700
@@ -21,7 +21,7 @@
 
 #include "config.h"
 
-#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(USE_SSE) && defined(USE_MMX)
+#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 4) && defined(USE_SSE) && defined(USE_MMX)
 
 #include <stdint.h>
 #include <stdlib.h>
@@ -173,7 +173,7 @@
 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)
 
   Babl *rgbaF_linear = babl_format_new (
     babl_model ("RGBA"),