aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/babl.rb
blob: c04a97dad4bdaad7d400a4845759528c36d3dd89 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
require 'formula'

class Babl < Formula
  homepage 'http://www.gegl.org/babl/'
  url 'ftp://ftp.gtk.org/pub/babl/0.1/babl-0.1.10.tar.bz2'
  sha1 'ee60089e8e9d9390e730d3ae5e41074549928b7a'

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

  depends_on 'pkg-config' => :build

  option :universal

  def patches
    # 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
    { :p0 => DATA }
  end

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

    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}"
    system "make install"
  end
end

__END__
diff -cr babl.ori/babl-palette.c babl/babl-palette.c
*** babl.ori/babl-palette.c	Sat Apr 14 01:31:40 2012
--- babl/babl-palette.c	Sat Apr 14 01:32:15 2012
***************
*** 19,25 ****
  #include <stdlib.h>
  #include <string.h>
  #include <stdio.h>
! #include <values.h>
  #include <assert.h>
  #include "config.h"
  #include "babl-internal.h"
--- 19,25 ----
  #include <stdlib.h>
  #include <string.h>
  #include <stdio.h>
! #include <limits.h>
  #include <assert.h>
  #include "config.h"
  #include "babl-internal.h"
diff -cr extensions.ori/sse-fixups.c extensions/sse-fixups.c
*** extensions.ori/sse-fixups.c	Sat Apr 14 01:31:40 2012
--- extensions/sse-fixups.c	Sat Apr 14 01:33:44 2012
***************
*** 21,27 ****
  
  #include "config.h"
  
! #if defined(__GNUC__) && (__GNUC__ >= 4) && defined(USE_SSE) && defined(USE_MMX)
  
  #include <stdint.h>
  #include <stdlib.h>
--- 21,27 ----
  
  #include "config.h"
  
! #if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 4) && defined(USE_SSE) && defined(USE_MMX)
  
  #include <stdint.h>
  #include <stdlib.h>
***************
*** 177,183 ****
  int
  init (void)
  {
! #if defined(__GNUC__) && (__GNUC__ >= 4) && defined(USE_SSE) && defined(USE_MMX)
  
    const Babl *rgbaF_linear = babl_format_new (
      babl_model ("RGBA"),
--- 177,183 ----
  int
  init (void)
  {
! #if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 4) && defined(USE_SSE) && defined(USE_MMX)
  
    const Babl *rgbaF_linear = babl_format_new (
      babl_model ("RGBA"),