summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b33998652830a9d648f1da44316fdd1a21f8bf20 (plain)
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
# Maintainer : George Eleftheriou <eleftg>
# Contributor: orumin <dev at orum.in>

_pkgname=hdf5
pkgname=lib32-${_pkgname}
pkgver=1.10.4
pkgrel=1
pkgdesc="General purpose library and file format for storing scientific data (32-bit)"
arch=('x86_64')
url="https://portal.hdfgroup.org/display/support"
license=('custom')
depends=('lib32-zlib' 'lib32-libaec')
makedepends=('time' 'gcc-fortran-multilib')
source=("https://support.hdfgroup.org/ftp/HDF5/releases/${_pkgname}-${pkgver:0:4}/${_pkgname}-${pkgver}/src/${_pkgname}-${pkgver}.tar.bz2")
md5sums=('886148d0cc9ffd3c8e1fce0bd75ed07b')

prepare() {
    mkdir -p build
}

build() {
    cd build

    "${srcdir}/${_pkgname}-${pkgver}"/configure \
        CFLAGS="-m32 ${CFLAGS}" \
        CXXFLAGS="-m32 ${CXXFLAGS}" \
        FCFLAGS="-m32 ${FCFLAGS}" \
        FC="gfortran" \
        F9X="gfortran" \
        PKG_CONFIG_PATH="/usr/lib32/pkgconfig" \
        --prefix=/usr \
        --libdir=/usr/lib32 \
        --docdir=/usr/share/doc/hdf5 \
        --disable-static \
        --disable-sharedlib-rpath \
        --enable-build-mode=production \
        --enable-hl \
        --enable-cxx \
        --enable-fortran \
        --with-pic \
        --with-zlib \
        --with-szlib

    make
}

check() {
    cd build

    # Without exporting LD_LIBRARY_PATH, tests fail being unable to
    # locate the newly built (not installed yet) hdf5 runtime
    export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${srcdir}/build/src/.libs"
    export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${srcdir}/build/c++/src/.libs"
    export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${srcdir}/build/fortran/src/.libs"
    export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${srcdir}/build/hl/src/.libs"
    export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${srcdir}/build/hl/c++/src/.libs"
    export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${srcdir}/build/hl/fortran/src/.libs"

    make check
}

package() {
    cd build

    make DESTDIR="${pkgdir}" install

    rm -rf "${pkgdir}"/usr/{include,share,bin}
}