2010-08-12 04:58:14 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Libkml < Formula
|
2010-08-12 04:58:14 +00:00
|
|
|
homepage 'http://code.google.com/p/libkml/'
|
2014-03-05 07:22:08 +00:00
|
|
|
url 'https://libkml.googlecode.com/files/libkml-1.2.0.tar.gz'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 '3fa5acdc2b2185d7f0316d205002b7162f079894'
|
2010-08-12 04:58:14 +00:00
|
|
|
|
2013-09-22 01:47:11 +00:00
|
|
|
head do
|
|
|
|
url 'http://libkml.googlecode.com/svn/trunk/'
|
2012-10-29 01:43:57 +00:00
|
|
|
|
2013-11-13 17:01:29 +00:00
|
|
|
depends_on :autoconf
|
2012-10-29 01:43:57 +00:00
|
|
|
depends_on :automake
|
|
|
|
depends_on :libtool
|
|
|
|
end
|
|
|
|
|
2013-11-14 01:43:30 +00:00
|
|
|
def patches
|
|
|
|
p = []
|
|
|
|
# Fix compilation with clang and gcc 4.7+
|
|
|
|
# https://code.google.com/p/libkml/issues/detail?id=179
|
|
|
|
p << DATA
|
2013-11-12 15:43:47 +00:00
|
|
|
|
2013-11-14 01:43:30 +00:00
|
|
|
# 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
|
|
|
|
if build.head?
|
2013-11-25 19:22:03 +00:00
|
|
|
p << "https://gist.github.com/dakcarto/7420023/raw/65cdb088c91a7da844251e348eeda8df1d903f1d/libkml-svn-static-deps"
|
2013-11-14 01:43:30 +00:00
|
|
|
else
|
2013-11-25 19:22:03 +00:00
|
|
|
p << "https://gist.github.com/dakcarto/7419882/raw/10ae08af224b3fee0617fa6288d806d3ccf37c0f/libkml-1.2-static-deps"
|
2013-11-14 01:43:30 +00:00
|
|
|
end
|
|
|
|
return p
|
|
|
|
end
|
2013-11-09 04:45:03 +00:00
|
|
|
|
2010-08-12 04:58:14 +00:00
|
|
|
def install
|
2012-10-29 01:43:57 +00:00
|
|
|
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', ''
|
2013-02-09 02:11:22 +00:00
|
|
|
|
|
|
|
# Compatibility with Automake 1.13 and newer.
|
|
|
|
inreplace 'configure.ac', 'AM_CONFIG_HEADER', 'AC_CONFIG_HEADER'
|
|
|
|
|
2012-10-29 01:43:57 +00:00
|
|
|
system "./autogen.sh"
|
|
|
|
end
|
|
|
|
|
2010-08-12 04:58:14 +00:00
|
|
|
system "./configure", "--prefix=#{prefix}"
|
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|
2013-11-09 04:45:03 +00:00
|
|
|
|
|
|
|
__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>
|
|
|
|
|