forked from ahmadia/homebrew-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathosgearth.rb
147 lines (126 loc) · 4.76 KB
/
osgearth.rb
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
require "formula"
class Osgearth < Formula
homepage "http://osgearth.org"
url "https://github.com/gwaldron/osgearth/archive/osgearth-2.5.tar.gz"
sha1 "97ed0075422c3efcb7b958f89ae02b32d670c48e"
head "https://github.com/gwaldron/osgearth.git", :branch => "master"
option "without-minizip", "Build without Google KMZ file access support"
option "with-v8", "Build with Google's V8 JavaScript engine support"
option "with-tinyxml", "Use external libtinyxml, instead of internal"
option "with-docs-examples", "Build and install html documentation and examples"
depends_on "cmake" => :build
depends_on "open-scene-graph"
depends_on "gdal"
depends_on "sqlite"
depends_on "qt" => :recommended
depends_on "minizip" => :recommended
depends_on "v8" => :optional
depends_on "tinyxml" => :optional
resource "sphinx" do
url "https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.2.1.tar.gz"
sha1 "448cdb89d96c85993e01fe793ce7786494cbcda7"
end
# all merged upstream, remove on next version
# find a v8 lib: https://github.com/gwaldron/osgearth/pull/434
# find JavaScriptCore lib: https://github.com/gwaldron/osgearth/pull/435
# find libnoise lib: https://github.com/gwaldron/osgearth/pull/436
patch :DATA
def install
if build.with? "docs-examples" and not which("sphinx-build")
# temporarily vendor a local sphinx install
sphinx_dir = prefix/"sphinx"
sphinx_site = sphinx_dir/"lib/python2.7/site-packages"
sphinx_site.mkpath
ENV.prepend_create_path "PYTHONPATH", sphinx_site
resource("sphinx").stage {quiet_system "python2.7", "setup.py", "install", "--prefix=#{sphinx_dir}"}
ENV.prepend_path "PATH", sphinx_dir/"bin"
end
args = std_cmake_args
if MacOS.prefer_64_bit?
args << "-DCMAKE_OSX_ARCHITECTURES=#{Hardware::CPU.arch_64_bit}"
else
args << "-DCMAKE_OSX_ARCHITECTURES=i386"
end
args << "-DOSGEARTH_USE_QT=OFF" if build.without? "qt"
args << "-DWITH_EXTERNAL_TINYXML=ON" if build.with? "tinyxml"
# v8 and minizip options should have empty values if not defined '--with'
if build.without? "v8"
args << "-DV8_INCLUDE_DIR=''" << "-DV8_BASE_LIBRARY=''" << "-DV8_SNAPSHOT_LIBRARY=''"
args << "-DV8_ICUI18N_LIBRARY=''" << "-DV8_ICUUC_LIBRARY=''"
end
# define libminizip paths (skips the only pkconfig dependency in cmake modules)
mzo = Formula["minizip"].opt_prefix
args << "-DMINIZIP_INCLUDE_DIR=#{(build.with? "minizip") ? mzo/"include/minizip" : "''"}"
args << "-DMINIZIP_LIBRARY=#{(build.with? "minizip") ? mzo/"lib/libminizip.dylib" : "''"}"
mkdir "build" do
system "cmake", "..", *args
system "make", "install"
end
if build.with? "docs-examples"
cd "docs" do
system "make", "html"
doc.install "build/html" => "html"
end
doc.install "data"
doc.install "tests" => "examples"
rm_r prefix/"sphinx" if File.exist?(prefix/"sphinx")
end
end
def caveats
osg = Formula["open-scene-graph"]
osgver = (osg.linked_keg.exist?) ? osg.version : "#.#.# (version)"
<<-EOS.undent
This formula installs Open Scene Graph plugins. To ensure access when using
the osgEarth toolset, set the OSG_LIBRARY_PATH enviroment variable to:
#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osgver}
EOS
end
test do
system "#{bin}/osgearth_version"
end
end
__END__
diff --git a/CMakeModules/FindV8.cmake b/CMakeModules/FindV8.cmake
index 9f5684d..94cf4c4 100644
--- a/CMakeModules/FindV8.cmake
+++ b/CMakeModules/FindV8.cmake
@@ -21,7 +21,7 @@ FIND_PATH(V8_INCLUDE_DIR v8.h
)
FIND_LIBRARY(V8_BASE_LIBRARY
- NAMES v8_base v8_base.ia32 libv8_base
+ NAMES v8_base v8_base.ia32 v8_base.x64 libv8_base
PATHS
${V8_DIR}
${V8_DIR}/lib
@@ -40,7 +40,7 @@ FIND_LIBRARY(V8_BASE_LIBRARY
)
FIND_LIBRARY(V8_BASE_LIBRARY_DEBUG
- NAMES v8_base v8_base.ia32 libv8_base
+ NAMES v8_base v8_base.ia32 v8_base.x64 libv8_base
PATHS
${V8_DIR}
${V8_DIR}/lib
diff --git a/CMakeModules/FindJavaScriptCore.cmake b/CMakeModules/FindJavaScriptCore.cmake
index 1bca250..3877cd5 100644
--- a/CMakeModules/FindJavaScriptCore.cmake
+++ b/CMakeModules/FindJavaScriptCore.cmake
@@ -21,7 +21,7 @@ FIND_PATH(JAVASCRIPTCORE_INCLUDE_DIR JavaScriptCore.h
)
FIND_LIBRARY(JAVASCRIPTCORE_LIBRARY
- NAMES libJavaScriptCore
+ NAMES libJavaScriptCore JavaScriptCore
PATHS
${JAVASCRIPTCORE_DIR}
${JAVASCRIPTCORE_DIR}/lib
diff --git a/CMakeModules/FindLibNoise.cmake b/CMakeModules/FindLibNoise.cmake
index 99d006b..0051b51 100644
--- a/CMakeModules/FindLibNoise.cmake
+++ b/CMakeModules/FindLibNoise.cmake
@@ -43,7 +43,7 @@ FIND_LIBRARY(LIBNOISE_LIBRARY
)
FIND_LIBRARY(LIBNOISE_LIBRARY
- NAMES libnoise
+ NAMES libnoise noise
PATHS
~/Library/Frameworks
/Library/Frameworks