blob: 101cb0d5f66d257eb10ed68ff1ffb49f7e57edcc (
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
 | require 'formula'
class Libkml < Formula
  homepage 'http://code.google.com/p/libkml/'
  stable do
    url "https://libkml.googlecode.com/files/libkml-1.2.0.tar.gz"
    sha1 "3fa5acdc2b2185d7f0316d205002b7162f079894"
    # Correct an issue where internal third-party libs (libminizip and liburiparser)
    # are installed as dylibs. liburiparser conflicts with uriparser formula.
    # libminizip conflicts with new formula, and some of its symbols have been
    # renamed with prefixes of "libkml_", i.e, can't be linked against for other builds
    # Fix just forces internal libs to be linked statically until the following
    # is addressed upstream: https://code.google.com/p/libkml/issues/detail?id=50
    patch do
      url "https://gist.githubusercontent.com/dakcarto/7419882/raw/10ae08af224b3fee0617fa6288d806d3ccf37c0f/libkml-1.2-static-deps"
      sha1 "eba47421e64e75bcf68026bbbe7c985b3bebcde5"
    end
  end
  bottle do
    cellar :any
    revision 1
    sha1 "604dafcf5fb8135e89f4636af4ecb21b404b4e4b" => :yosemite
    sha1 "61000bffb52eb852149276e37b42461fd5f710a7" => :mavericks
    sha1 "68d01ed7b9748caa23f6309c62e836cb030f673d" => :mountain_lion
  end
  head do
    url 'http://libkml.googlecode.com/svn/trunk/'
    depends_on "autoconf" => :build
    depends_on "automake" => :build
    depends_on "libtool" => :build
    # see stable patch
    patch do
      url "https://gist.githubusercontent.com/dakcarto/7420023/raw/65cdb088c91a7da844251e348eeda8df1d903f1d/libkml-svn-static-deps"
      sha1 "9ef82d73199325e63596c28c6965ec8c151bf7c5"
    end
  end
  # Fix compilation with clang and gcc 4.7+
  # https://code.google.com/p/libkml/issues/detail?id=179
  patch :DATA
  def install
    if build.head?
      # The inreplace line below is only required until the patch in #issue 186
      # is applied. http://code.google.com/p/libkml/issues/detail?id=186
      # If the patch is applied, this find and replace will be unnecessary, but also
      # harmless
      inreplace 'configure.ac', '-Werror', ''
      system "./autogen.sh"
    end
    system "./configure", "--prefix=#{prefix}"
    system "make install"
  end
end
__END__
diff --git a/src/kml/base/file_posix.cc b/src/kml/base/file_posix.cc
index 764ae55..8ee9892 100644
--- a/src/kml/base/file_posix.cc
+++ b/src/kml/base/file_posix.cc
@@ -29,6 +29,7 @@
 #include "kml/base/file.h"
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 
 |