-
Notifications
You must be signed in to change notification settings - Fork 2
/
openni2.rb
67 lines (53 loc) · 2.11 KB
/
openni2.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
require 'formula'
class Openni2 < Formula
homepage 'http://structure.io/openni'
url 'https://github.com/occipital/OpenNI2/archive/2.2-beta2.tar.gz'
version '2.2.0.33'
sha1 '8c9a57de7224cd0a0a4c4bb03a7637bd179df34c'
head 'https://github.com/occipital/OpenNI2.git'
option :universal
option 'with-docs', 'Build documentation using javadoc (might fail with Java 1.8)'
depends_on :python
depends_on 'libusb' => (build.universal?) ? ['universal'] : []
depends_on 'doxygen' => :build if build.with? 'docs'
def patches
# disables javadoc documentation build by default because of errors with Java 8.
DATA if build.without? 'docs'
end
def install
ENV.universal_binary if build.universal?
# stdlib of clang changed since mavericks
ENV.cxx += ' -stdlib=libstdc++' if ENV.compiler == :clang && MacOS.version >= :mavericks
system 'make', 'all'
system 'make', 'doc' if build.with? 'docs'
mkdir 'out'
arch = (MacOS.version <= :leopard && !build.universal?) ? 'x86' :'x64'
system 'python', 'Packaging/Harvest.py', 'out', arch
cd 'out'
(lib+'ni2').install Dir['Redist/*']
(include+'ni2').install Dir['Include/*']
(share+'openni2/tools').install Dir['Tools/*']
(share+'openni2/samples').install Dir['Samples/*']
doc.install Dir['Documentation'] if build.with? 'docs'
end
def caveats; <<-EOS.undent
Add the recommended variables to your dotfiles.
* On Bash, add them to `~/.bash_profile`.
* On Zsh, add them to `~/.zprofile` instead.
export OPENNI2_INCLUDE=#{HOMEBREW_PREFIX}/include/ni2
export OPENNI2_REDIST=#{HOMEBREW_PREFIX}/lib/ni2
EOS
end
end
__END__
diff --git a/Packaging/Harvest.py b/Packaging/Harvest.py
index 4ce9ed2..fad7017 100755
--- a/Packaging/Harvest.py
+++ b/Packaging/Harvest.py
@@ -312,7 +312,7 @@ $(OUTPUT_FILE): copy-redist
# Documentation
docDir = os.path.join(self.outDir, 'Documentation')
- self.copyDocumentation(docDir)
+ #self.copyDocumentation(docDir)
# Include
shutil.copytree(os.path.join(rootDir, 'Include'), os.path.join(self.outDir, 'Include'))