Skip to content

Commit

Permalink
highfive: Fix build with boost buit with CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
MehdiChinoune committed Sep 29, 2024
1 parent 9dc1801 commit 4b9a996
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions mingw-w64-highfive/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ _realname=highfive
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=2.10.0
pkgrel=1
pkgrel=2
pkgdesc='Modern header-only C++11 friendly interface for libhdf5 (mingw-w64)'
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
Expand All @@ -29,7 +29,12 @@ source=("https://github.com/BlueBrain/HighFive/archive/v${pkgver}/${_realname}-$
sha256sums=('c29e8e1520e7298fabb26545f804e35bb3af257005c1c2df62e39986458d7c38')

build() {
mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}"
declare -a extra_config
if check_option "debug" "n"; then
extra_config+=("-DCMAKE_BUILD_TYPE=Release")
else
extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
fi

# HIGHFIVE_* options only affect tests (at package-build time),
# not what is installed
Expand All @@ -39,7 +44,7 @@ build() {
${MINGW_PREFIX}/bin/cmake \
-GNinja \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
-DCMAKE_BUILD_TYPE=Release \
"{extra_config[@]}" \
-DHIGHFIVE_USE_BOOST=ON \
-DHIGHFIVE_USE_EIGEN=ON \
-DHIGHFIVE_USE_XTENSOR=OFF \
Expand All @@ -48,22 +53,25 @@ build() {
-DHIGHFIVE_PARALLEL_HDF5=OFF \
-DHIGHFIVE_BUILD_DOCS=OFF \
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY="${srcdir}/build-${MSYSTEM}" \
-S ../HighFive-${pkgver} -B .
-DBoost_NO_BOOST_CMAKE=OFF \
-S HighFive-${pkgver} \
-B build-${MSYSTEM}

${MINGW_PREFIX}/bin/cmake --build .
${MINGW_PREFIX}/bin/cmake --build build-${MSYSTEM}
}

check() {
cd "${srcdir}/build-${MSYSTEM}"
cd "${srcdir}"/build-${MSYSTEM}

# run unit tests
${MINGW_PREFIX}/bin/ctest
}

package() {
cd "${srcdir}/build-${MSYSTEM}"
cd "${srcdir}"/build-${MSYSTEM}

DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake --install .

install -Dm644 "${srcdir}/HighFive-${pkgver}/LICENSE" -t "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/"
install -Dm644 "${srcdir}"/HighFive-${pkgver}/LICENSE \
-t "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/
}

0 comments on commit 4b9a996

Please sign in to comment.