SHARE
TWEET

Arch Linux python-scipy

invik Nov 5th, 2017 378 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Maintainer: Thomas Dziedzic < gostrc at gmail >
  2. # Contributor: Angel 'angvp' Velasquez <angvp[at]archlinux.com.ve>
  3. # Contributor: Ray Rashif <schiv@archlinux.org>
  4. # Contributor: Douglas Soares de Andrade <dsa@aur.archlinux.org>
  5. # Contributor: Bodor Dávid Gábor <david.gabor.bodor@gmail.com>
  6. # Contributor: Andrzej Giniewicz <gginiu@gmail.com>
  7.  
  8. pkgname=('python-scipy-mkl' 'python2-scipy-mkl')
  9. pkgver=1.0.0
  10. pkgrel=1
  11. pkgdesc="SciPy is open-source software for mathematics, science, and engineering."
  12. arch=('i686' 'x86_64')
  13. url="http://www.scipy.org/"
  14. license=('BSD')
  15. makedepends=('gcc-fortran' 'python-numpy' 'python2-numpy' 'python-setuptools' 'python2-setuptools')
  16. checkdepends=('python-nose' 'python2-nose')
  17. source=("https://github.com/scipy/scipy/releases/download/v${pkgver}/scipy-${pkgver}.tar.xz")
  18. sha256sums=('06b23f2a5db5418957facc86ead86b7752147c0461f3156f88a3da87f3dc6739')
  19.  
  20. build() {
  21.     export LDFLAGS="-Wall -shared"
  22.  
  23.     # set by hand this flag if you want to compile with gcc
  24.     export force_gcc=false
  25.  
  26.     if hash icc; then
  27.         export use_intel_cc=true
  28.         export use_gcc=false
  29.     else
  30.         export use_intel_cc=false
  31.         export use_gcc=true
  32.     fi
  33.  
  34.     if [ "$force_gcc" = true ]; then
  35.         export use_intel_cc=false
  36.         export use_gcc=true
  37.     fi
  38.  
  39.     # 2 builds
  40.     cp -r scipy-${pkgver} scipy-${pkgver}-py2
  41.  
  42.     # build for python3
  43.     cd scipy-${pkgver}
  44.     if [ "$use_gcc" = true ]; then
  45.         python3 setup.py config_fc --fcompiler=gnu95 build
  46.     fi
  47.  
  48.     if [ "$use_intel_cc" = true ]; then
  49.         for i in $(seq 5); do
  50.             __INTEL_PRE_CFLAGS=" -D_Float128=__float128" python3 setup.py config --compiler=intelem --fcompiler=intelem build_clib --compiler=intelem --fcompiler=intelem build_ext --compiler=intelem --fcompiler=intelem || true
  51.             python3 setup.py config --compiler=intelem --fcompiler=intelem build_clib --compiler=intelem --fcompiler=intelem build_ext --compiler=intelem --fcompiler=intelem || true
  52.         done
  53.     fi
  54.  
  55.     # build for python2
  56.     cd ../scipy-${pkgver}-py2
  57.  
  58.     for file in $(find . -name '*.py' -print); do
  59.         sed -i 's_^#!.*/usr/bin/python_#!/usr/bin/python2_' $file
  60.         sed -i 's_^#!.*/usr/bin/env.*python_#!/usr/bin/env python2_' $file
  61.     done
  62.  
  63.     if [ "$use_gcc" = true ]; then
  64.         python2 setup.py config_fc --fcompiler=gnu95 build
  65.     fi
  66.  
  67.     if [ "$use_intel_cc" = true ]; then
  68.         for i in $(seq 5); do
  69.             __INTEL_PRE_CFLAGS=" -D_Float128=__float128" python2 setup.py config --compiler=intelem --fcompiler=intelem build_clib --compiler=intelem --fcompiler=intelem build_ext --compiler=intelem --fcompiler=intelem || true
  70.             python2 setup.py config --compiler=intelem --fcompiler=intelem build_clib --compiler=intelem --fcompiler=intelem build_ext --compiler=intelem --fcompiler=intelem || true
  71.         done
  72.     fi
  73.  
  74. }
  75.  
  76. check() {
  77.     # we need to do a temp install so we can import scipy
  78.     # also, the tests must not be run from the scipy source directory
  79.     export LDFLAGS="-Wall -shared"
  80.  
  81.     #   cd ${srcdir}/scipy-${pkgver}
  82.     #   python3 setup.py config_fc --fcompiler=gnu95 install \
  83.     #     --prefix=/usr --root=${srcdir}/test --optimize=1
  84.     #   export PYTHONPATH=${srcdir}/test/usr/lib/python3.6/site-packages
  85.     #   cd ${srcdir}
  86.     #   python -c "from scipy import test; test('full')"
  87.     #
  88.     #   cd ${srcdir}/scipy-${pkgver}-py2
  89.     #   python2 setup.py config_fc --fcompiler=gnu95 install \
  90.     #     --prefix=/usr --root=${srcdir}/test --optimize=1
  91.     #   export PYTHONPATH=${srcdir}/test/usr/lib/python2.7/site-packages
  92.     #   cd ${srcdir}
  93.     #   python2 -c "from scipy import test; test('full')"
  94. }
  95.  
  96. package_python-scipy-mkl() {
  97.  
  98.     depends=('python-numpy-mkl' 'qhull' 'python-nose')
  99.     provides=('python3-scipy=${pkgver}' 'python-scipy=${pkgver}' 'scipy=${pkgver}')
  100.     replaces=('python-scipy')
  101.     conflicts=('python-scipy')
  102.     optdepends=('python-pillow: for image saving module')
  103.  
  104.     cd scipy-${pkgver}
  105.     export LDFLAGS="-Wall -shared"
  106.  
  107.     if [ "$use_gcc" = true ]; then
  108.         python3 setup.py config_fc --fcompiler=gnu95 install --prefix=/usr --root=${pkgdir} --optimize=1
  109.     fi
  110.  
  111.     if [ "$use_intel_cc" = true ]; then
  112.         python3 setup.py config_fc --fcompiler=intelem install --prefix=/usr --root=${pkgdir} --optimize=1
  113.     fi
  114.  
  115.     install -Dm644 LICENSE.txt \
  116.         "${pkgdir}/usr/share/licenses/python-scipy/LICENSE"
  117. }
  118.  
  119. package_python2-scipy-mkl() {
  120.  
  121.     depends=('python2-numpy-mkl' 'qhull' 'python2-nose')
  122.     provides=('python2-scipy=${pkgver}' 'python2-scipy=${pkgver}' 'scipy=${pkgver}')
  123.     replaces=('python2-scipy')
  124.     conflicts=('python2-scipy')
  125.     optdepends=('python2-pillow: for image saving module')
  126.  
  127.     cd scipy-${pkgver}-py2
  128.     export LDFLAGS="-Wall -shared"
  129.  
  130.     if [ "$use_gcc" = true ]; then
  131.         python2 setup.py config_fc --fcompiler=gnu95 install --prefix=/usr --root=${pkgdir} --optimize=1
  132.     fi
  133.  
  134.     if [ "$use_intel_cc" = true ]; then
  135.         python2 setup.py config_fc --fcompiler=intelem install --prefix=/usr --root=${pkgdir} --optimize=1
  136.     fi
  137.  
  138.     install -Dm644 LICENSE.txt \
  139.         "${pkgdir}/usr/share/licenses/python2-scipy/LICENSE"
  140. }
  141.  
  142. # vim:set ts=2 sw=2 et:
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top