مهدي شينون (Mehdi Chinoune) fd809aec6c rebuild packages against numpy-2.0.0
2024-08-01 17:35:38 +01:00

114 lines
4.2 KiB
Bash

# Maintainer: Martin Diehl <aur@martin-diehl.net>
# Contributor: Alad Wenter <alad@archlinux.org>
# Contributor: Jingbei Li <i@jingbei.li>
# Contributor: Simon Pintarelli <simon.pintarelli@gmail.com>
# Contributor: Feng Wang <wanng.fenng@gmail.com>
# Contributor (msys): Rafal Brzegowy <rafal.brzegowy@yahoo.com>
_realname=trilinos
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=16.0.0
_pkgver=${pkgver//./-}
pkgrel=2
pkgdesc='Algorithms for the solution of large-scale scientific problems" (mingw-w64)'
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64')
url="http://trilinos.org"
msys2_repository_url="https://github.com/trilinos/Trilinos"
license=('spdx:BSD-3-Clause AND LGPL-2.1-or-later')
depends=("${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-openblas"
"${MINGW_PACKAGE_PREFIX}-boost"
"${MINGW_PACKAGE_PREFIX}-netcdf"
"${MINGW_PACKAGE_PREFIX}-matio"
"${MINGW_PACKAGE_PREFIX}-hdf5"
"${MINGW_PACKAGE_PREFIX}-msmpi")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-ninja"
"${MINGW_PACKAGE_PREFIX}-fc"
"${MINGW_PACKAGE_PREFIX}-perl"
"${MINGW_PACKAGE_PREFIX}-bc"
"${MINGW_PACKAGE_PREFIX}-python-numpy"
"unzip")
optdepends=("${MINGW_PACKAGE_PREFIX}-seacas")
source=("https://github.com/${_realname}/Trilinos/archive/${_realname}-release-${_pkgver}.tar.gz")
sha256sums=('46bfc40419ed2aa2db38c144fb8e61d4aa8170eaa654a88d833ba6b92903f309')
noextract=(${_realname}-release-${_pkgver}.tar.gz)
prepare(){
plain "Extract ${_realname}-release-${_pkgver}.tar.gz"
tar -xzf ${_realname}-release-${_pkgver}.tar.gz || true
}
build() {
declare -a extra_config
if check_option "debug" "n"; then
extra_config+=("-DCMAKE_BUILD_TYPE=Release")
else
extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
fi
#Static Build
mkdir -p "${srcdir}/build-${MSYSTEM}-static" && cd "${srcdir}/build-${MSYSTEM}-static"
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake \
-GNinja \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
"${extra_config[@]}" \
-DBLAS_LIBRARY_NAMES="openblas" \
-DLAPACK_LIBRARY_NAMES="openblas" \
-DTrilinos_ENABLE_Fortran=$([[ ${MINGW_PACKAGE_PREFIX} != *-clang-* ]] && echo "ON" || echo "OFF") \
-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=ON \
-DTrilinos_ENABLE_ALL_PACKAGES=ON \
-DTPL_ENABLE_DLlib=OFF \
-DTrilinos_ENABLE_Xpetra=OFF \
-DTrilinos_ENABLE_Epetra=ON \
-DTrilinos_ENABLE_Intrepid2=OFF \
-DTrilinos_ENABLE_SEACAS=OFF \
-DCMAKE_Fortran_FLAGS="$FCFLAGS -fallow-argument-mismatch" \
../Trilinos-${_realname}-release-${_pkgver}
${MINGW_PREFIX}/bin/cmake --build .
#Shared Build
mkdir -p "${srcdir}/build-${MSYSTEM}-shared" && cd "${srcdir}/build-${MSYSTEM}-shared"
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake \
-GNinja \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
"${extra_config[@]}" \
-DBUILD_SHARED_LIBS=ON \
-DBLAS_LIBRARY_NAMES="openblas" \
-DLAPACK_LIBRARY_NAMES="openblas" \
-DTrilinos_ENABLE_Fortran=$([[ ${MINGW_PACKAGE_PREFIX} != *-clang-* ]] && echo "ON" || echo "OFF") \
-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=ON \
-DTrilinos_ENABLE_ALL_PACKAGES=ON \
-DTPL_ENABLE_DLlib=OFF \
-DTrilinos_ENABLE_Xpetra=OFF \
-DTrilinos_ENABLE_Epetra=ON \
-DTrilinos_ENABLE_Intrepid2=OFF \
-DTrilinos_ENABLE_SEACAS=OFF \
-DCMAKE_Fortran_FLAGS="$FCFLAGS -fallow-argument-mismatch" \
../Trilinos-${_realname}-release-${_pkgver}
${MINGW_PREFIX}/bin/cmake --build .
}
package() {
#Static Install
cd "${srcdir}/build-${MSYSTEM}-static"
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake --install .
#Shared Install
cd "${srcdir}/build-${MSYSTEM}-shared"
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake --install .
install -Dm644 "${srcdir}"/Trilinos-${_realname}-release-${_pkgver}/LICENSE "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE
# Remove conflict with seacas package
#rm -r "${pkgdir}"${MINGW_PREFIX}/lib/external_packages/DLlib
}