forked from ahmadia/homebrew-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hdf4.rb
73 lines (64 loc) · 2.42 KB
/
hdf4.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
class Hdf4 < Formula
desc "HDF version 4"
homepage "https://www.hdfgroup.org"
url "https://www.hdfgroup.org/ftp/HDF/releases/HDF4.2.11/src/hdf-4.2.11.tar.bz2"
sha256 "bb0e900b8cc6bc89a5730abc97e654e7705e8e1fbc4e0d4477f417822428d99b"
revision 3
bottle do
cellar :any
sha256 "870c4bd97456d019e7c0bf95d54cefb03cd64e997453c550ca340cc1fb37c0ff" => :sierra
sha256 "44bbc921816b8c2002be1e814817199e59410dad2971172e62fce11cfd84d364" => :el_capitan
sha256 "534c9fd10793bc1f21517092f23edf9087c8afcce59f722ca908d39dcf051db8" => :yosemite
sha256 "d869697d1b6d08f5a50e3ae5edab34ecc3e9b79b99ffb6a6f57c26b29090eb25" => :x86_64_linux
end
depends_on "cmake" => :build
depends_on "pkg-config" => :build
depends_on "szip"
depends_on "jpeg"
# redefine library name to "df" from "hdf". this seems to be an artifact
# of using cmake that needs to be corrected for compatibility with
# anything depending on hdf4.
patch :DATA
def install
ENV["SZIP_INSTALL"] = HOMEBREW_PREFIX
args = std_cmake_args
args.concat [
"-DBUILD_SHARED_LIBS=ON",
"-DBUILD_TESTING=OFF",
"-DHDF4_BUILD_TOOLS=ON",
"-DHDF4_BUILD_UTILS=ON",
"-DHDF4_BUILD_WITH_INSTALL_NAME=ON",
"-DHDF4_ENABLE_JPEG_LIB_SUPPORT=ON",
"-DHDF4_ENABLE_NETCDF=OFF", # Conflict. Just install NetCDF for this.
"-DHDF4_ENABLE_SZIP_ENCODING=ON",
"-DHDF4_ENABLE_SZIP_SUPPORT=ON",
"-DHDF4_ENABLE_Z_LIB_SUPPORT=ON",
"-DHDF4_BUILD_FORTRAN=OFF",
]
mkdir "build" do
system "cmake", "..", *args
system "make", "install"
# Remove stray ncdump executable as it conflicts with NetCDF.
rm (bin+"ncdump")
rm (bin+"ncgen")
end
end
def caveats; <<-EOS.undent
HDF4 has been superseeded by HDF5. However, the API changed
substantially and some programs still require the HDF4 libraries in order
to function.
EOS
end
end
__END__
--- a/CMakeLists.txt 2015-02-09 11:43:05.000000000 -0500
+++ b/CMakeLists.txt 2015-06-28 14:05:35.000000000 -0400
@@ -95,7 +95,7 @@
# Set the core names of all the libraries
#-----------------------------------------------------------------------------
set (HDF4_LIB_CORENAME "hdf4")
-set (HDF4_SRC_LIB_CORENAME "hdf")
+set (HDF4_SRC_LIB_CORENAME "df")
set (HDF4_SRC_FCSTUB_LIB_CORENAME "hdf_fcstub")
set (HDF4_SRC_FORTRAN_LIB_CORENAME "hdf_fortran")
set (HDF4_MF_LIB_CORENAME "mfhdf")