Created
April 26, 2019 04:54
-
-
Save daz/cd72f5a9ac6f674b72678ee46895087a to your computer and use it in GitHub Desktop.
LibLas with LasZip homebrew
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Liblas < Formula | |
desc "C/C++ library for reading and writing the LAS LiDAR format" | |
homepage "https://liblas.org/" | |
url "https://download.osgeo.org/liblas/libLAS-1.8.1.tar.bz2" | |
sha256 "9adb4a98c63b461ed2bc82e214ae522cbd809cff578f28511122efe6c7ea4e76" | |
revision 1 | |
head "https://github.com/libLAS/libLAS.git" | |
bottle do | |
rebuild 1 | |
sha256 "132fc923c89408039e5569e1a25b47faccf26e77cd2faf7557c7cb85e0a04016" => :mojave | |
sha256 "b36963b697eca8a6860e40bbab35d6b07204b8e2902946ea11bf15d3ebb26cf3" => :high_sierra | |
sha256 "04c3faa7f0aa841bc5baa731b3b1428805c3a292c8f4961952c29091c29d67a0" => :sierra | |
end | |
depends_on "cmake" => :build | |
depends_on "boost" | |
depends_on "gdal" | |
depends_on "libgeotiff" | |
depends_on "laszip" | |
# Fix build for Xcode 9 with upstream commit | |
# Remove in next version | |
patch do | |
url "https://github.com/libLAS/libLAS/commit/49606470.patch?full_index=1" | |
sha256 "5590aef61a58768160051997ae9753c2ae6fc5b7da8549707dfd9a682ce439c8" | |
end | |
# Fix compilation against GDAL 2.3 | |
# Remove in next version | |
patch do | |
url "https://github.com/libLAS/libLAS/commit/ec10e274.diff?full_index=1" | |
sha256 "3f5cc283d3e908d991b05b4dcf5cc0440824441ec270396e11738f96a0a23a9f" | |
end | |
def install | |
ENV.cxx11 | |
mkdir "macbuild" do | |
# CMake finds boost, but variables like this were set in the last | |
# version of this formula. Now using the variables listed here: | |
# https://liblas.org/compilation.html | |
ENV["Boost_INCLUDE_DIR"] = "#{HOMEBREW_PREFIX}/include" | |
ENV["Boost_LIBRARY_DIRS"] = "#{HOMEBREW_PREFIX}/lib" | |
system "cmake", "..", *std_cmake_args, | |
"-DWITH_GDAL=ON", | |
"-DWITH_LASZIP=ON", | |
"-DWITH_GEOTIFF=ON" | |
system "make" | |
system "make", "test" | |
system "make", "install" | |
end | |
end | |
test do | |
system bin/"liblas-config", "--version" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment