# $Id$ # Maintainer (ArchLinux): Alexander Rødseth # Contributor (ArchLinux): William Rea # Contributor (ArchLinux): Stefan Husmann # Maintainer (MSYS2): Ray Donnelly _realname=arpack pkgbase=mingw-w64-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}" $([[ "${CARCH}" == "i686" ]] || echo "${MINGW_PACKAGE_PREFIX}-${_realname}64")) pkgver=3.9.1 pkgrel=1 arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64') pkgdesc="Fortran77 subroutines designed to solve large scale eigenvalue problems (mingw-w64)" url='https://forge.scilab.org/index.php/p/arpack-ng/' license=('spdx:BSD-3-Clause') depends=($([[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]] || echo "${MINGW_PACKAGE_PREFIX}-gcc-libgfortran")) makedepends=("${MINGW_PACKAGE_PREFIX}-fc" "${MINGW_PACKAGE_PREFIX}-cmake" "${MINGW_PACKAGE_PREFIX}-ninja" "${MINGW_PACKAGE_PREFIX}-openblas" $([[ "${CARCH}" == "i686" ]] || echo "${MINGW_PACKAGE_PREFIX}-openblas64")) provides=("${MINGW_PACKAGE_PREFIX}-${_realname}-ng") options=('!buildflags') source=(https://github.com/opencollab/arpack-ng/archive/${pkgver}/${_realname}-${pkgver}.tar.gz) sha256sums=('f6641deb07fa69165b7815de9008af3ea47eb39b2bb97521fbf74c97aba6e844') # Helper macros to help make tasks easier # apply_patch_with_msg() { for _fname in "$@" do msg2 "Applying ${_fname}" patch -Nbp1 -i "${srcdir}"/${_fname} done } _build_arpack() { _idx_opt=$1 declare -a _build_type if check_option "debug" "n"; then _build_type+=("Release") else _build_type+=("Debug") fi MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ ${MINGW_PREFIX}/bin/cmake \ -GNinja \ -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ -DCMAKE_BUILD_TYPE=${_build_type} \ -DICB=ON \ ${_idx_opt} \ ../${_realname}-ng-${pkgver} ${MINGW_PREFIX}/bin/cmake --build . } build() { mkdir -p "${srcdir}/build-${MSYSTEM}-static-32" && cd "${srcdir}/build-${MSYSTEM}-static-32" msg2 "Build static ARPACK with 32-bit indexing" _build_arpack "-DBUILD_SHARED_LIBS=OFF -DTESTS=OFF" mkdir -p "${srcdir}/build-${MSYSTEM}-shared-32" && cd "${srcdir}/build-${MSYSTEM}-shared-32" msg2 "Build shared ARPACK with 32-bit indexing" _build_arpack "-DTESTS=OFF" if [ "${CARCH}" != "i686" ]; then mkdir -p "${srcdir}/build-${MSYSTEM}-static-64" && cd "${srcdir}/build-${MSYSTEM}-static-64" msg2 "Build static ARPACK with 64-bit indexing" _build_arpack "-DINTERFACE64=1 -DITF64SUFFIX=_64 -DBUILD_SHARED_LIBS=OFF -DBLAS_LIBRARIES=openblas_64 -DTESTS=OFF" mkdir -p "${srcdir}/build-${MSYSTEM}-shared-64" && cd "${srcdir}/build-${MSYSTEM}-shared-64" msg2 "Build shared ARPACK with 64-bit indexing" _build_arpack "-DINTERFACE64=1 -DITF64SUFFIX=_64 -DBLAS_LIBRARIES=openblas_64 -DTESTS=OFF ${_flang_int_64}" fi } check() { cd "${srcdir}/build-${MSYSTEM}-static-32" msg2 "Static check with 32-bit indexing" _build_arpack "-DTESTS=ON" ${MINGW_PREFIX}/bin/cmake --build . --target test || true cd "${srcdir}/build-${MSYSTEM}-shared-32" msg2 "Shared check with 32-bit indexing" _build_arpack "-DTESTS=ON" ${MINGW_PREFIX}/bin/cmake --build . --target test || true if [ "${CARCH}" != "i686" ]; then cd "${srcdir}/build-${MSYSTEM}-static-64" msg2 "Static check with 64-bit indexing" _build_arpack "-DTESTS=ON" ${MINGW_PREFIX}/bin/cmake --build . --target test || true cd "${srcdir}/build-${MSYSTEM}-shared-64" msg2 "Shared check with 64-bit indexing" _build_arpack "-DTESTS=ON" ${MINGW_PREFIX}/bin/cmake --build . --target test || true fi } package_arpack() { pkgdesc="Fortran77 subroutines designed to solve large scale eigenvalue problems (mingw-w64)" depends+=("${MINGW_PACKAGE_PREFIX}-openblas") #Static Install cd "${srcdir}/build-${MSYSTEM}-static-32" DESTDIR=${pkgdir} ${MINGW_PREFIX}/bin/cmake --install . #Shared Install cd "${srcdir}/build-${MSYSTEM}-shared-32" DESTDIR=${pkgdir} ${MINGW_PREFIX}/bin/cmake --install . install -Dm644 ${srcdir}/${_realname}-ng-${pkgver}/COPYING ${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX}) for _f in "${pkgdir}${MINGW_PREFIX}"/lib/cmake/${_realname}ng/*.cmake; do sed -e "s|${PREFIX_WIN}|\$\{_IMPORT_PREFIX\}|g" -i ${_f} sed -e "s|${MINGW_PREFIX}|\$\{_IMPORT_PREFIX\}|g" -i ${_f} done } package_arpack64() { pkgdesc="Fortran77 subroutines designed to solve large scale eigenvalue problems with 64-bit indexing (mingw-w64)" depends+=("${MINGW_PACKAGE_PREFIX}-openblas64") provides=() conflicts=() replaces=() #Static Install cd "${srcdir}/build-${MSYSTEM}-static-64" DESTDIR=${pkgdir} ${MINGW_PREFIX}/bin/cmake --install . #Shared Install cd "${srcdir}/build-${MSYSTEM}-shared-64" DESTDIR=${pkgdir} ${MINGW_PREFIX}/bin/cmake --install . install -Dm644 ${srcdir}/${_realname}-ng-${pkgver}/COPYING ${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}64/COPYING local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX}) for _f in "${pkgdir}${MINGW_PREFIX}"/lib/cmake/${_realname}ng_64/*.cmake; do sed -e "s|${PREFIX_WIN}|\$\{_IMPORT_PREFIX\}|g" -i ${_f} sed -e "s|${MINGW_PREFIX}|\$\{_IMPORT_PREFIX\}|g" -i ${_f} done } # template start; name=mingw-w64-splitpkg-wrappers; version=1.0; # vim: set ft=bash : # generate wrappers for _name in "${pkgname[@]}"; do _short="package_${_name#${MINGW_PACKAGE_PREFIX}-}" _func="$(declare -f "${_short}")" eval "${_func/#${_short}/package_${_name}}" done # template end;