Skip to content

Commit

Permalink
Add python-mpi4py package
Browse files Browse the repository at this point in the history
  • Loading branch information
ImperatorS79 committed Oct 21, 2024
1 parent 911553f commit 05b940b
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions mingw-w64-python-mpi4py/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Maintainer: ImperatorS79 <[email protected]>

_realname=mpi4py
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
conflicts=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=4.0.1
pkgrel=1
pkgdesc="Python bindings for the Message Passing Interface (MPI) standard (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='https://mpi4py.github.io/stable/'
msys2_references=(
'pypi: mpi4py'
)
license=('BSD')
depends=("${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-msmpi")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-cython"
"${MINGW_PACKAGE_PREFIX}-python-wheel")
options=('staticlibs' 'strip' '!debug')
source=(${_realname}-${pkgver}.tar.gz::"https://github.com/mpi4py/mpi4py/releases/download/${pkgver}/mpi4py-${pkgver}.tar.gz")
sha256sums=('f3174b245775d556f4fddb32519a2066ef0592edc810c5b5a59238f9a0a40c89')

prepare() {
cd "${srcdir}/${_realname}-${pkgver}/"
export MINGW_PATH=$(cygpath -m ${MINGW_PREFIX})
sed -i 's@## mpi_dir = /usr/local/mpi@mpi_dir = '"${MINGW_PATH}"'@g' mpi.cfg
sed -i 's@## mpicc = %(mpi_dir)s/bin/mpicc@mpicc = %(mpi_dir)s/bin/mpicc.exe@g' mpi.cfg
sed -i 's@## mpicxx = %(mpi_dir)s/bin/mpicxx@mpicxx = %(mpi_dir)s/bin/mpicxx.exe@g' mpi.cfg
sed -i 's@## include_dirs = %(mpi_dir)s/include@include_dirs = %(mpi_dir)s/include@g' mpi.cfg
sed -i 's@## libraries = mpi@libraries = msmpi@g' mpi.cfg
sed -i 's@## library_dirs = %(mpi_dir)s/lib@library_dirs = %(mpi_dir)s/lib@g' mpi.cfg
#sed -i 's@## runtime_library_dirs = %(mpi_dir)s/lib@runtime_library_dirs = %(mpi_dir)s/bin@g' mpi.cfg
}

build() {
cd "${srcdir}/${_realname}-${pkgver}/"
${MINGW_PREFIX}/bin/python -m build --wheel --no-isolation
}

package() {
cd "${srcdir}/${_realname}-${pkgver}/"
MSYS2_ARG_CONV_EXCL="--prefix=" \
${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} --destdir="${pkgdir}" dist/*.whl
install -Dm644 LICENSE.rst -t "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/"
}

0 comments on commit 05b940b

Please sign in to comment.