59 lines
1.9 KiB
Ruby
59 lines
1.9 KiB
Ruby
class Proj < Formula
|
|
desc "Cartographic Projections Library"
|
|
homepage "https://proj4.org/"
|
|
url "https://download.osgeo.org/proj/proj-6.2.0.tar.gz"
|
|
sha256 "b300c0f872f632ad7f8eb60725edbf14f0f8f52db740a3ab23e7b94f1cd22a50"
|
|
|
|
bottle do
|
|
sha256 "908f4bb4b562f146181b316cba0a74c9bbb786cb2cb347279d38c175f2aae78b" => :catalina
|
|
sha256 "136f63801c76a4c288ed6f520ae42fede385c65767ae9d323671ab0f00805e9b" => :mojave
|
|
sha256 "e18d22d518a9d7841815a87f29e1e56acf46d0aa3b9f1ee1740bff2537e38bb8" => :high_sierra
|
|
sha256 "2ffd7fa1cbed257c42e4d81f7f5e75ebdd81d009a0cf2eab0f3136a68f3579c2" => :sierra
|
|
end
|
|
|
|
head do
|
|
url "https://github.com/OSGeo/proj.4.git"
|
|
depends_on "autoconf" => :build
|
|
depends_on "automake" => :build
|
|
depends_on "libtool" => :build
|
|
end
|
|
|
|
depends_on "pkg-config" => :build
|
|
|
|
conflicts_with "blast", :because => "both install a `libproj.a` library"
|
|
|
|
skip_clean :la
|
|
|
|
# The datum grid files are required to support datum shifting
|
|
resource "datumgrid" do
|
|
url "https://download.osgeo.org/proj/proj-datumgrid-1.8.zip"
|
|
sha256 "b9838ae7e5f27ee732fb0bfed618f85b36e8bb56d7afb287d506338e9f33861e"
|
|
end
|
|
|
|
def install
|
|
(buildpath/"nad").install resource("datumgrid")
|
|
|
|
system "./autogen.sh" if build.head?
|
|
system "./configure", "--disable-dependency-tracking",
|
|
"--prefix=#{prefix}"
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
(testpath/"test").write <<~EOS
|
|
45d15n 71d07w Boston, United States
|
|
40d40n 73d58w New York, United States
|
|
48d51n 2d20e Paris, France
|
|
51d30n 7'w London, England
|
|
EOS
|
|
match = <<~EOS
|
|
-4887590.49\t7317961.48 Boston, United States
|
|
-5542524.55\t6982689.05 New York, United States
|
|
171224.94\t5415352.81 Paris, France
|
|
-8101.66\t5707500.23 London, England
|
|
EOS
|
|
|
|
output = shell_output("#{bin}/proj +proj=poly +ellps=clrk66 -r #{testpath}/test")
|
|
assert_equal match, output
|
|
end
|
|
end
|