opencv 4.0.1

master
FX Coudert 2018-12-28 17:27:09 +01:00
parent e4b533c5d4
commit fb42060e46
2 changed files with 8 additions and 7 deletions

View File

@ -1,9 +1,8 @@
class Opencv < Formula
desc "Open source computer vision library"
homepage "https://opencv.org/"
url "https://github.com/opencv/opencv/archive/3.4.5.tar.gz"
sha256 "0c57d9dd6d30cbffe68a09b03f4bebe773ee44dc8ff5cd6eaeb7f4d5ef3b428e"
revision 1
url "https://github.com/opencv/opencv/archive/4.0.1.tar.gz"
sha256 "7b86a0ee804244e0c407321f895b15e4a7162e9c5c0d2efc85f1cadec4011af4"
bottle do
sha256 "1d5b539888b6163e9e8b5e6944bafdfec126cae714a0f14dc914af6f810975dd" => :mojave
@ -25,8 +24,8 @@ class Opencv < Formula
depends_on "tbb"
resource "contrib" do
url "https://github.com/opencv/opencv_contrib/archive/3.4.5.tar.gz"
sha256 "8f73d029887c726fed89c69a2b0fcb1d098099fcd81c1070e1af3b452669fbe2"
url "https://github.com/opencv/opencv_contrib/archive/4.0.1.tar.gz"
sha256 "0d8acbad4b7074cfaafd906a7419c23629179d5e98894714402090b192ef8237"
end
needs :cxx11
@ -62,6 +61,7 @@ class Opencv < Formula
-DBUILD_opencv_text=OFF
-DOPENCV_ENABLE_NONFREE=ON
-DOPENCV_EXTRA_MODULES_PATH=#{buildpath}/opencv_contrib/modules
-DOPENCV_GENERATE_PKGCONFIG=ON
-DWITH_1394=OFF
-DWITH_CUDA=OFF
-DWITH_EIGEN=ON
@ -103,14 +103,15 @@ class Opencv < Formula
test do
(testpath/"test.cpp").write <<~EOS
#include <opencv/cv.h>
#include <opencv2/opencv.hpp>
#include <iostream>
int main() {
std::cout << CV_VERSION << std::endl;
return 0;
}
EOS
system ENV.cxx, "test.cpp", "-I#{include}", "-L#{lib}", "-o", "test"
system ENV.cxx, "-std=c++11", "test.cpp", "-I#{include}/opencv4",
"-o", "test"
assert_equal `./test`.strip, version.to_s
["python2.7", "python3"].each do |python|