[arch-commits] Commit in (4 files)

Bruno Pagani archange at archlinux.org
Wed May 23 22:07:50 UTC 2018


    Date: Wednesday, May 23, 2018 @ 22:07:49
  Author: archange
Revision: 328489

Initial addition of OpenMPI build of python-netcdf4

Added:
  python-netcdf4-openmpi/
  python-netcdf4-openmpi/repos/
  python-netcdf4-openmpi/trunk/
  python-netcdf4-openmpi/trunk/PKGBUILD

----------+
 PKGBUILD |   58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

Added: python-netcdf4-openmpi/trunk/PKGBUILD
===================================================================
--- python-netcdf4-openmpi/trunk/PKGBUILD	                        (rev 0)
+++ python-netcdf4-openmpi/trunk/PKGBUILD	2018-05-23 22:07:49 UTC (rev 328489)
@@ -0,0 +1,58 @@
+# Maintainer: Bruno Pagani <archange at archlinux.org>
+
+_pkg=netCDF4
+_mpi=openmpi
+pkgbase=python-${_pkg,,}
+pkgname=("python-${_pkg,,}" "python2-${_pkg,,}")
+pkgver=1.4.0
+pkgrel=1
+pkgdesc="Python/NumPy interface to the netCDF C library (${_mpi} version)"
+arch=('x86_64')
+url="https://unidata.github.io/${_pkg,,}-python"
+license=('MIT')
+makedepends=('cython' 'python-setuptools' 'cython2' 'python2-setuptools' 'python-numpy' 'python-cftime' 'python-mpi4py' 'python2-numpy' 'python2-cftime' 'python2-mpi4py' "netcdf-${_mpi}")
+source=("https://pypi.io/packages/source/n/${_pkg}/${_pkg}-${pkgver}.tar.gz")
+sha256sums=('a6c0b46f410f101c09d60b8cc460aafec06732f0130c6cb2730717bcc605b388')
+
+prepare() {
+    cp -a ${_pkg}-${pkgver}{,-py2}
+}
+
+build() {
+    cd ${_pkg}-${pkgver}
+    USE_NCCONFIG=1 python setup.py build
+
+    cd ../${_pkg}-${pkgver}-py2
+    USE_NCCONFIG=1 python2 setup.py build
+}
+
+check() {
+    cd ${_pkg}-${pkgver}/test
+    PYTHONPATH="../build/lib.linux-${CARCH}-3.6" python -B ./run_all.py || warning "Tests failed"
+
+    cd ../../${_pkg}-${pkgver}-py2/test
+    PYTHONPATH="../build/lib.linux-${CARCH}-2.7" python2 -B ./run_all.py || warning "Tests failed"
+}
+
+package_python-netcdf4() {
+    depends=('python-numpy' 'python-cftime' 'python-mpi4py' "netcdf-${_mpi}")
+
+    cd ${_pkg}-${pkgver}
+    USE_NCCONFIG=1 python setup.py install --prefix=/usr --root="${pkgdir}" --skip-build --optimize=2
+
+    install -Dm644 docs/netCDF4/* -t "${pkgdir}"/usr/share/doc/${pkgname}/docs/netCDF4
+    install -Dm644 COPYING -t "${pkgdir}"/usr/share/licenses/${pkgname}
+}
+
+package_python2-netcdf4() {
+    depends=('python2-numpy' 'python2-cftime' 'python2-mpi4py' "netcdf-${_mpi}")
+
+    cd ${_pkg}-${pkgver}-py2
+    USE_NCCONFIG=1 python2 setup.py install --prefix=/usr --root="${pkgdir}" --skip-build --optimize=2
+
+    for binary in "${pkgdir}"/usr/bin/* ;
+        do mv ${binary}{,-py2} ;
+    done
+    install -Dm644 docs/netCDF4/* -t "${pkgdir}"/usr/share/doc/${pkgname}/docs/netCDF4
+    install -Dm644 COPYING -t "${pkgdir}"/usr/share/licenses/${pkgname}
+}



More information about the arch-commits mailing list