libgeotiff 1.4.2

Closes #12657.

Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
Robert Jones 2017-04-20 11:35:24 +10:00 committed by FX Coudert
parent 9134cf0878
commit 9f6bb364b3

View file

@ -1,9 +1,9 @@
class Libgeotiff < Formula class Libgeotiff < Formula
desc "Library and tools for dealing with GeoTIFF" desc "Library and tools for dealing with GeoTIFF"
homepage "https://geotiff.osgeo.org/" homepage "https://geotiff.osgeo.org/"
url "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-1.4.1.tar.gz" url "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-1.4.2.tar.gz"
sha256 "acfc76ee19b3d41bb9c7e8b780ca55d413893a96c09f3b27bdb9b2573b41fd23" sha256 "ad87048adb91167b07f34974a8e53e4ec356494c29f1748de95252e8f81a5e6e"
revision 2 head "https://svn.osgeo.org/metacrs/geotiff/trunk/libgeotiff"
bottle do bottle do
sha256 "e132dbc428f2ab5fb85099983b1558954f6bcf71e9acf2c65beb02b4c9cda198" => :sierra sha256 "e132dbc428f2ab5fb85099983b1558954f6bcf71e9acf2c65beb02b4c9cda198" => :sierra
@ -16,13 +16,56 @@ class Libgeotiff < Formula
depends_on "jpeg" depends_on "jpeg"
depends_on "proj" depends_on "proj"
if build.head?
depends_on "automake" => :build
depends_on "autoconf" => :build
depends_on "libtool" => :build
end
def install def install
args = ["--disable-dependency-tracking", "--prefix=#{prefix}", args = ["--disable-dependency-tracking", "--prefix=#{prefix}",
"--with-libtiff=#{HOMEBREW_PREFIX}", "--with-libtiff=#{HOMEBREW_PREFIX}",
"--with-zlib=#{HOMEBREW_PREFIX}", "--with-zlib=#{HOMEBREW_PREFIX}",
"--with-jpeg=#{HOMEBREW_PREFIX}"] "--with-jpeg=#{HOMEBREW_PREFIX}"]
if build.head?
system "./autogen.sh"
end
system "./configure", *args system "./configure", *args
system "make" # Separate steps or install fails system "make" # Separate steps or install fails
system "make", "install" system "make", "install"
end end
test do
(testpath/"test.c").write <<-EOS.undent
#include "geotiffio.h"
#include "xtiffio.h"
#include <stdlib.h>
#include <string.h>
int main(int argc, char* argv[])
{
TIFF *tif = XTIFFOpen(argv[1], "w");
GTIF *gtif = GTIFNew(tif);
TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, (uint32) 10);
GTIFKeySet(gtif, GeogInvFlatteningGeoKey, TYPE_DOUBLE, 1, (double)123.456);
int i;
char buffer[20L];
memset(buffer,0,(size_t)20L);
for (i=0;i<20L;i++){
TIFFWriteScanline(tif, buffer, i, 0);
}
GTIFWriteKeys(gtif);
GTIFFree(gtif);
XTIFFClose(tif);
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-ltiff", "-lgeotiff", "-o", "test"
system "./test", "test.tif"
assert_match(/GeogInvFlatteningGeoKey.*123.456/, shell_output("#{bin}/listgeo test.tif"))
end
end end