From 0e91d76e8b0bfa5c68355123fb2ed289d315e0d2 Mon Sep 17 00:00:00 2001 From: Dustin Rodrigues Date: Tue, 4 Aug 2020 14:10:51 -0400 Subject: [PATCH 1/2] pcl 1.11.1 --- Formula/pcl.rb | 67 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 54 insertions(+), 13 deletions(-) diff --git a/Formula/pcl.rb b/Formula/pcl.rb index 32288c8e968d6..15ddca291b63c 100644 --- a/Formula/pcl.rb +++ b/Formula/pcl.rb @@ -1,10 +1,9 @@ class Pcl < Formula desc "Library for 2D/3D image and point cloud processing" homepage "https://pointclouds.org/" - url "https://github.com/PointCloudLibrary/pcl/archive/pcl-1.9.1.tar.gz" - sha256 "0add34d53cd27f8c468a59b8e931a636ad3174b60581c0387abb98a9fc9cddb6" + url "https://github.com/PointCloudLibrary/pcl/archive/pcl-1.11.1.tar.gz" + sha256 "a61558e53abafbc909e0996f91cfd2d7a400fcadf6b8cfb0ea3172b78422c74e" license "BSD-3-Clause" - revision 9 head "https://github.com/PointCloudLibrary/pcl.git" bottle do @@ -13,23 +12,19 @@ class Pcl < Formula sha256 "d14889b636e81d1427a7d0300c028b571ac038e54b3760eba8900a7175d210c1" => :high_sierra end - depends_on "cmake" => :build + depends_on "cmake" => [:build, :test] depends_on "pkg-config" => :build depends_on "boost" depends_on "cminpack" depends_on "eigen" depends_on "flann" depends_on "glew" + depends_on "libomp" + depends_on "libpcap" depends_on "libusb" depends_on "qhull" depends_on "vtk" - # Upstream patch for boost 1.70.0 - patch do - url "https://github.com/PointCloudLibrary/pcl/commit/648932bc.diff?full_index=1" - sha256 "23f2cced7786715c59b49a48e4037eb9dea9abee099c4c5c92d95a647636b5ec" - end - def install args = std_cmake_args + %w[ -DBUILD_SHARED_LIBS:BOOL=ON @@ -37,13 +32,12 @@ def install -DBUILD_apps_3d_rec_framework=AUTO_OFF -DBUILD_apps_cloud_composer=AUTO_OFF -DBUILD_apps_in_hand_scanner=AUTO_OFF - -DBUILD_apps_optronic_viewer=AUTO_OFF -DBUILD_apps_point_cloud_editor=AUTO_OFF - -DBUILD_examples:BOOL=ON + -DBUILD_examples:BOOL=OFF -DBUILD_global_tests:BOOL=OFF -DBUILD_outofcore:BOOL=AUTO_OFF -DBUILD_people:BOOL=AUTO_OFF - -DBUILD_simulation:BOOL=AUTO_OFF + -DBUILD_simulation:BOOL=ON -DWITH_CUDA:BOOL=OFF -DWITH_DOCS:BOOL=OFF -DWITH_QT:BOOL=FALSE @@ -65,5 +59,52 @@ def install test do assert_match "tiff files", shell_output("#{bin}/pcl_tiff2pcd -h", 255) + # inspired by https://pointclouds.org/documentation/tutorials/writing_pcd.html + (testpath/"CMakeLists.txt").write <<~EOS + cmake_minimum_required(VERSION 2.8 FATAL_ERROR) + project(pcd_write) + find_package(PCL 1.2 REQUIRED) + include_directories(${PCL_INCLUDE_DIRS}) + link_directories(${PCL_LIBRARY_DIRS}) + add_definitions(${PCL_DEFINITIONS}) + add_executable (pcd_write pcd_write.cpp) + target_link_libraries (pcd_write ${PCL_LIBRARIES}) + EOS + (testpath/"pcd_write.cpp").write <<~EOS + #include + #include + #include + + int main (int argc, char** argv) + { + pcl::PointCloud cloud; + + // Fill in the cloud data + cloud.width = 2; + cloud.height = 1; + cloud.is_dense = false; + cloud.points.resize (cloud.width * cloud.height); + int i = 1; + for (auto& point: cloud) + { + point.x = i++; + point.y = i++; + point.z = i++; + } + + pcl::io::savePCDFileASCII ("test_pcd.pcd", cloud); + return (0); + } + EOS + mkdir "build" do + system "cmake", "..", *std_cmake_args + system "make" + system "./pcd_write" + assert_predicate (testpath/"build/test_pcd.pcd"), :exist? + output = File.read("test_pcd.pcd") + assert_match "POINTS 2", output + assert_match "1 2 3", output + assert_match "4 5 6", output + end end end From 7e08ace2e4d8a99da7f87d5d36aefcc8af087bdf Mon Sep 17 00:00:00 2001 From: Dustin Rodrigues Date: Tue, 4 Aug 2020 14:16:43 -0400 Subject: [PATCH 2/2] visp: revision bump for pcl --- Formula/visp.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Formula/visp.rb b/Formula/visp.rb index 5c3ed6644969b..25a03910a0f3f 100644 --- a/Formula/visp.rb +++ b/Formula/visp.rb @@ -3,7 +3,7 @@ class Visp < Formula homepage "https://visp.inria.fr/" url "https://gforge.inria.fr/frs/download.php/latestfile/475/visp-3.3.0.tar.gz" sha256 "f2ed11f8fee52c89487e6e24ba6a31fa604b326e08fb0f561a22c877ebdb640d" - revision 7 + revision 8 livecheck do url "https://visp.inria.fr/download/" @@ -27,6 +27,12 @@ class Visp < Formula depends_on "pcl" depends_on "zbar" + # from first commit at https://github.com/lagadic/visp/pull/768 - remove in next release + patch do + url "https://github.com/lagadic/visp/commit/61c8beb8442f9e0fe7df8966e2e874929af02344.patch?full_index=1" + sha256 "429bf02498fc03fff7bc2a2ad065dea6d8a8bfbde6bb1adb516fa821b1e5c96f" + end + # Fixes build on OpenCV >= 4.4.0 # Extracted from https://github.com/lagadic/visp/pull/795 patch :DATA