forked from ahmadia/homebrew-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openalpr.rb
55 lines (45 loc) · 1.55 KB
/
openalpr.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
class Openalpr < Formula
desc "Automatic License Plate Recognition library"
homepage "https://github.com/openalpr/openalpr"
url "https://github.com/openalpr/openalpr/archive/v2.3.0.tar.gz"
sha256 "1cfcaab6f06e9984186ee19633a949158c0e2aacf9264127e2f86bd97641d6b9"
head "https://github.com/openalpr/openalpr.git", :branch => "master"
revision 1
bottle do
sha256 "cd3d6e1244ac3177a112ab6b74d223d0cded37e4aaff38d3087be3a5a85abf6c" => :sierra
sha256 "bc02f2fa2a9d9aae3bfe8dc25a9b01ed595e5e23c91a1db68758288c1be8aa54" => :el_capitan
sha256 "73e78841953e9ae4a1a5f128955d91826232b92d778c8cf9f8b915b7789b87a7" => :yosemite
end
option "without-daemon", "Do not include the alpr daemon (alprd)"
depends_on "cmake" => :build
depends_on "leptonica"
depends_on "libtiff"
depends_on "tesseract"
depends_on "opencv@2"
if build.with? "daemon"
depends_on "log4cplus"
depends_on "beanstalkd"
end
def install
mkdir "src/build" do
args = std_cmake_args
# v2.2.0 require CMAKE_MACOSX_RPATH
args << "-DCMAKE_MACOSX_RPATH=true"
args << "-DCMAKE_INSTALL_SYSCONFDIR=#{etc}"
if build.without? "daemon"
if build.head?
args << "-DWITH_DAEMON=NO"
else
args << "-DWITHOUT_DAEMON=YES"
end
end
args << "-DCMAKE_INSTALL_SYSCONFDIR:PATH=#{etc}"
system "cmake", "..", *args
system "make", "install"
end
end
test do
output = shell_output("#{bin}/alpr #{test_fixtures("test.jpg")}")
assert_equal "No license plates found.", output.chomp
end
end