forked from ahmadia/homebrew-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bioformats-cpp.rb
102 lines (85 loc) · 3.63 KB
/
bioformats-cpp.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
class BioformatsCpp < Formula
desc "Microscopy file formats including OME-TIFF"
homepage "http://www.openmicroscopy.org/site/products/bio-formats"
url "http://downloads.openmicroscopy.org/bio-formats/5.1.5/artifacts/bioformats-dfsg-5.1.5.zip"
sha256 "eac9cbc3b0dc4223a0c71742988799e933b258d65f4d088169c9d756862570b6"
head "https://github.com/openmicroscopy/bioformats.git", :branch => "develop", :shallow => false
bottle do
sha256 "46496d56d07cc8f344b90ad81c2527e3f803c67d69f5f8229598323a1ef0dce7" => :el_capitan
sha256 "0a09197a6070aecfb1a2be3456eccb677703f5c812f1bb222da0af954aaa4dad" => :yosemite
sha256 "07a6548d14987ac3a5a9401aa4abe532d37d49b963016688353eaf507585e4c6" => :mavericks
end
option "without-check", "Skip build time tests (not recommended)"
option "with-qt5", "Build with Qt5 (used for OpenGL image rendering)"
option "without-docs", "Build API reference and manual pages"
depends_on "boost"
depends_on "cmake" => :build
depends_on "libpng"
depends_on "libtiff"
depends_on "xerces-c"
depends_on "graphicsmagick" => :optional # For unit tests only
depends_on "qt5" => :optional
depends_on "glm" => :build if build.with? "qt5"
depends_on "doxygen" => :build if build.with? "docs"
depends_on "graphviz" => :build if build.with? "docs"
# Needs clang/libc++ toolchain; mountain lion is too broken
depends_on :macos => :mavericks
# Required python modules for docs
resource "sphinx" do
url "https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.2.3.tar.gz"
sha256 "94933b64e2fe0807da0612c574a021c0dac28c7bd3c4a23723ae5a39ea8f3d04"
end
resource "docutils" do
url "https://pypi.python.org/packages/source/d/docutils/docutils-0.12.tar.gz"
sha256 "c7db717810ab6965f66c8cf0398a98c9d8df982da39b4cd7f162911eb89596fa"
end
resource "pygments" do
url "https://pypi.python.org/packages/source/P/Pygments/Pygments-2.0.2.tar.gz"
sha256 "7320919084e6dac8f4540638a46447a3bd730fca172afc17d2c03eed22cf4f51"
end
resource "jinja2" do
url "https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.7.3.tar.gz"
sha256 "2e24ac5d004db5714976a04ac0e80c6df6e47e98c354cb2c0d82f8879d4f8fdb"
end
resource "markupsafe" do
url "https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-0.23.tar.gz"
sha256 "a4ec1aff59b95a14b45eb2e23761a0179e98319da5a7eb76b56ea8cdc7b871c3"
end
# Required python module for main build
resource "genshi" do
url "https://pypi.python.org/packages/source/G/Genshi/Genshi-0.7.tar.gz"
sha256 "1d154402e68bc444a55bcac101f96cb4e59373100cc7a2da07fbf3e5cc5d7352"
end
def install
# Set up python modules
ENV.prepend_create_path "PYTHONPATH", buildpath/"python/lib/python2.7/site-packages"
ENV.prepend_path "PATH", buildpath/"python/bin"
ENV.prepend_create_path "CMAKE_PROGRAM_PATH", buildpath/"python/bin"
resources.each do |r|
next unless r.name == "genshi" || build.with?("docs")
r.stage do
system "python", *Language::Python.setup_install_args(buildpath/"python")
end
end
args = ["-DCMAKE_INSTALL_PREFIX=#{prefix}",
"-DCMAKE_BUILD_TYPE=Release",
"-DCMAKE_VERBOSE_MAKEFILE=ON",
"-Wno-dev",
"-Dsphinx-pdf=OFF"]
args << "-Dtest=OFF" if build.without? "check"
args << "-Dsphinx=OFF" if build.without? "docs"
args << "-DQt5Core_FOUND=OFF" if build.without? "qt5"
mkdir "build" do
system "cmake", "..", *args
system "make"
if build.with? "check"
system "ctest", "-V"
end
system "make", "install"
end
end
test do
system "bf-test", "--usage"
system "bf-test", "info", "--usage"
end
end