1 # Maintainer: Ronald van Haren <ronald.archlinux.org>
2 # Maintainer: Bruno Pagani <archange@archlinux.org>
3 # Contributor: Stefan Husmann <stefan-husmann@t-online.de>
4 # Contributor: damir <damir@archlinux.org>
5 # Contributor: Tom K <tomk@runbox.com>
10 pkgdesc="General purpose library and file format for storing scientific data"
12 url="https://www.hdfgroup.org/hdf5"
14 depends=(zlib libaec bash)
15 makedepends=(cmake time gcc-fortran java-environment)
18 source=(https://support.hdfgroup.org/ftp/HDF5/releases/${pkgname}-${pkgver:0:4}/${pkgname}-${pkgver/_/-}/src/${pkgname}-${pkgver/_/-}-2.tar.bz2)
19 sha256sums=('06ca141d1a3c312b5d7cc4826a12737293ae131031748861689f6a2ec8219dbd')
22 mv ${pkgname}-${pkgver/_/-}{-2,}
23 cd ${pkgname}-${pkgver/_/-}
24 # Don't mess with build flags
25 sed -e '/-Werror/d' -i configure
29 # Crazy workaround: run CMake to generate pkg-config file
30 #cmake -B build -S ${pkgname}-${pkgver/_/-} \
31 mkdir -p build && cd build
32 cmake ../${pkgname}-${pkgver/_/-} \
33 -DCMAKE_INSTALL_PREFIX=/usr \
34 -DBUILD_STATIC_LIBS=OFF \
35 -DCMAKE_BUILD_TYPE=Release \
36 -DHDF5_BUILD_HL_LIB=ON \
37 -DHDF5_BUILD_CPP_LIB=ON \
38 -DHDF5_BUILD_FORTRAN=ON \
39 -DHDF5_BUILD_JAVA=ON \
40 -DHDF5_ENABLE_Z_LIB_SUPPORT=ON \
41 -DHDF5_ENABLE_SZIP_SUPPORT=ON \
42 -DHDF5_ENABLE_SZIP_ENCODING=ON \
44 # But don’t build with it, it’s quite broken
45 cd ../${pkgname}-${pkgver/_/-}
48 --docdir=/usr/share/doc/hdf5/ \
49 --with-examplesdir=/usr/share/doc/hdf5/examples/ \
51 --disable-sharedlib-rpath \
52 --enable-build-mode=production \
64 cd ${pkgname}-${pkgver/_/-}
65 # Without this, checks are failing with messages like “error while loading shared libraries: libhdf5.so.101: cannot open shared object file: No such file or directory”
66 export LD_LIBRARY_PATH="${srcdir}"/${pkgname}-${pkgver/_/-}/src/.libs/
67 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":"${srcdir}"/${pkgname}-${pkgver/_/-}/c++/src/.libs/
68 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":"${srcdir}"/${pkgname}-${pkgver/_/-}/fortran/src/.libs/
69 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":"${srcdir}"/${pkgname}-${pkgver/_/-}/hl/src/.libs/
70 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":"${srcdir}"/${pkgname}-${pkgver/_/-}/hl/c++/src/.libs/
71 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":"${srcdir}"/${pkgname}-${pkgver/_/-}/hl/fortran/src/.libs/
76 cd ${pkgname}-${pkgver/_/-}
77 make DESTDIR="${pkgdir}" install
78 install -Dm644 COPYING -t "${pkgdir}"/usr/share/licenses/${pkgname}
80 # Install pkg-config files from CMake tree
81 install -Dm644 ../build/CMakeFiles/hdf5{,_hl}{,_cpp,_fortran}.pc -t "${pkgdir}"/usr/lib/pkgconfig/
82 # Fix version numbers in pkg-config files
83 sed -i '/Requires/ s/-/ = /g' "${pkgdir}"/usr/lib/pkgconfig/*.pc
84 # Fix bogus include path
85 sed -e "s|-I/build/hdf5/src/hdf5-$pkgver/src/H5FDsubfiling||g" -i "${pkgdir}"/usr/lib/libhdf5.settings -i "${pkgdir}"/usr/bin/*