-
Notifications
You must be signed in to change notification settings - Fork 15
/
sensor-kinect.rb
49 lines (39 loc) · 1.81 KB
/
sensor-kinect.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
class SensorKinect < Formula
desc "Kinect sensor module for OpenNI"
homepage "https://github.com/ruedigerH2/SensorKinect/"
url "https://github.com/ruedigerH2/SensorKinect.git", :revision => "97a258a4ae0f2e4c4565adec74f917847a3ab1dd"
version "0.94"
head "https://github.com/ruedigerH2/SensorKinect.git"
conflicts_with "sensor"
option :universal
depends_on "openni" => build.universal? ? ["universal"] : []
def install
ENV.universal_binary if build.universal?
# Fix build files
inreplace "Source/Utils/XnSensorServer/SensorServer.cpp", "/var/log/primesense/XnSensorServer/", "#{var}/log/primesense/XnSensorServer/"
inreplace "Platform/Linux/Build/EngineLibMakefile", "/usr/include/ni", "#{HOMEBREW_PREFIX}/include/ni"
inreplace "Platform/Linux/Build/Utils/EngineUtilMakefile", "/usr/include/ni", "#{HOMEBREW_PREFIX}/include/ni"
inreplace "Platform/Linux/CreateRedist/RedistMaker", "echo $((N_CORES*2))", "echo $((1))"
inreplace "Platform/Linux/Build/Common/CommonJavaMakefile", "/usr/share/java", "#{share}/java"
# Build SensorKinect
cd "Platform/Linux/CreateRedist"
chmod 0755, "RedistMaker"
system "./RedistMaker"
cd Dir.glob("../Redist/Sensor-Bin-MacOSX-v*")[0]
bin.install Dir["Bin/*"]
lib.install Dir["Lib/*"]
(etc+"primesense").install "Config/GlobalDefaultsKinect.ini"
end
def post_install
system "#{HOMEBREW_PREFIX}/bin/niReg", "#{lib}/libXnDeviceSensorV2KM.dylib", "#{etc}/primesense"
system "#{HOMEBREW_PREFIX}/bin/niReg", "#{lib}/libXnDeviceFile.dylib", "#{etc}/primesense"
mkpath "#{var}/log/primesense/XnSensorServer"
chmod 0777, "#{var}/log/primesense/XnSensorServer"
end
def caveats; <<~EOS
OpenNI formula is now provided by brewsci/science.
Tap brewsci/science in advance.
`brew tap brewsci/science`
EOS
end
end