homebrew-core/Formula/grib-api.rb
nibbles 2bits a97c71080b grib-api: update url + patch for clang
grib-api changed their Homepage and download URLs, plus there is
a continuing build error with clang that's fixable.

- Update the `homepage` and `url`
- Add the patch for missing symbols from Fink
- Remove `fails_with :clang`

Fixes Homebrew/homebrew#15473

Closes Homebrew/homebrew#15489.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-10-20 08:42:11 -07:00

65 lines
2 KiB
Ruby

require 'formula'
class GribApi < Formula
homepage 'https://software.ecmwf.int/wiki/display/GRIB/Home'
url 'https://software.ecmwf.int/wiki/download/attachments/3473437/grib_api-1.9.16.tar.gz'
sha1 'baff7ad8de71d5e81a90595a0b4650c77f8bd6cf'
depends_on 'jasper' => :recommended
depends_on 'openjpeg' => :optional
# Fixes undefined symbols _stdio_read with clang. Patch from Fink.
def patches; DATA; end
def install
ENV.deparallelize
ENV.no_optimization
ENV.fortran
system "./configure", "--prefix=#{prefix}"
system "make"
system "make install"
end
end
__END__
--- a/src/grib_io.c 2012-03-06 10:00:51.000000000 -0800
+++ b/src/grib_io.c 2012-10-16 10:47:44.000000000 -0700
@@ -548,19 +548,19 @@
}
-GRIB_INLINE off_t stdio_tell(void* data) {
+GRIB_INLINE static off_t stdio_tell(void* data) {
FILE* f = (FILE*)data;
return ftello(f);
}
-GRIB_INLINE int stdio_seek(void* data,off_t len) {
+GRIB_INLINE static int stdio_seek(void* data,off_t len) {
FILE* f = (FILE*)data;
int err=0;
if (fseeko(f,len,SEEK_CUR)) err=GRIB_IO_PROBLEM;
return err;
}
-GRIB_INLINE int stdio_read(void* data,void* buf,int len,int* err)
+GRIB_INLINE static int stdio_read(void* data,void* buf,int len,int* err)
{
FILE* f = (FILE*)data;
int n;
--- a/src/grib_api_prototypes.h 2012-03-06 10:00:51.000000000 -0800
+++ b/src/grib_api_prototypes.h 2012-10-16 10:49:35.000000000 -0700
@@ -785,9 +785,9 @@
int grib_hash_keys_get_size(grib_itrie *t);
/* grib_io.c */
-GRIB_INLINE off_t stdio_tell(void *data);
-GRIB_INLINE int stdio_seek(void *data, off_t len);
-GRIB_INLINE int stdio_read(void *data, void *buf, int len, int *err);
+GRIB_INLINE static off_t stdio_tell(void *data);
+GRIB_INLINE static int stdio_seek(void *data, off_t len);
+GRIB_INLINE static int stdio_read(void *data, void *buf, int len, int *err);
int wmo_read_any_from_file(FILE *f, void *buffer, size_t *len);
int wmo_read_grib_from_file(FILE *f, void *buffer, size_t *len);
int wmo_read_bufr_from_file(FILE *f, void *buffer, size_t *len);