added community/python-blosc

This commit is contained in:
Kevin Mihelich 2017-01-07 03:43:08 +00:00
parent 925b17a740
commit 63283560e7
2 changed files with 104 additions and 0 deletions

View file

@ -0,0 +1,66 @@
# $Id$
# Maintainer: Andrzej Giniewicz <gginiu@gmail.com>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - patch to fix build on AArch64
pkgbase=python-blosc
pkgname=('python2-blosc' 'python-blosc')
pkgver=1.4.4
pkgrel=2
pkgdesc="A Python wrapper for the extremely fast Blosc compression library"
arch=('i686' 'x86_64')
url="http://python-blosc.blosc.org/"
license=('MIT')
makedepends=('python-setuptools' 'python2-setuptools' 'blosc')
source=("https://github.com/Blosc/python-blosc/archive/v${pkgver}.tar.gz"
'python-blosc-alt-arch.patch')
md5sums=('8509bc06760a6a00f8a4e827302e9566'
'fabfde4dbf9e796ee620416ebd13b8da')
prepare() {
cd "$srcdir/${pkgbase}-${pkgver}"
patch -p1 -i ../python-blosc-alt-arch.patch
cd "$srcdir"
cp -a ${pkgbase}-${pkgver} ${pkgbase}-py2-${pkgver}
cd ${pkgbase}-py2-${pkgver}
sed -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
-e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
-e "s|#![ ]*/bin/env python$|#!/usr/bin/env python2|" \
-i $(find . -name '*.py')
}
build() {
msg "Building Python2"
cd "$srcdir"/${pkgbase}-py2-${pkgver}
python2 setup.py build_ext --inplace --blosc=/usr
python2 setup.py build
msg "Building Python3"
cd "$srcdir"/${pkgbase}-${pkgver}
python setup.py build_ext --inplace --blosc=/usr
python setup.py build
}
package_python2-blosc() {
depends=('python2' 'blosc')
cd "$srcdir"/${pkgbase}-py2-${pkgver}
python2 setup.py install --skip-build --root="$pkgdir" --optimize=1
install -Dm644 LICENSES/PYTHON-BLOSC.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
package_python-blosc() {
depends=('python' 'blosc')
cd "$srcdir"/${pkgbase}-${pkgver}
python setup.py install --skip-build --root="$pkgdir" --optimize=1
install -Dm644 LICENSES/PYTHON-BLOSC.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

View file

@ -0,0 +1,38 @@
diff -up python-blosc-1.4.1/setup.py.alt-arch python-blosc-1.4.1/setup.py
--- python-blosc-1.4.1/setup.py.alt-arch 2017-01-05 15:53:42.581675095 +0100
+++ python-blosc-1.4.1/setup.py 2017-01-05 15:54:06.361675095 +0100
@@ -19,7 +19,6 @@ import sys
from setuptools import Extension
from setuptools import setup
from glob import glob
-import cpuinfo
########### Check versions ##########
@@ -93,26 +93,6 @@ else:
inc_dirs += glob('c-blosc/internal-complibs/zstd*/common')
def_macros += [('HAVE_LZ4', 1), ('HAVE_SNAPPY', 1), ('HAVE_ZLIB', 1), ('HAVE_ZSTD', 1)]
- # Guess SSE2 or AVX2 capabilities
- cpu_info = cpuinfo.get_cpu_info()
- # SSE2
- if 'sse2' in cpu_info['flags']:
- print('SSE2 detected')
- CFLAGS.append('-DSHUFFLE_SSE2_ENABLED')
- sources += [f for f in glob('c-blosc/blosc/*.c') if 'sse2' in f]
- if os.name == 'posix':
- CFLAGS.append('-msse2')
- elif os.name == 'nt':
- def_macros += [('__SSE2__', 1)]
- # AVX2
- if 'avx2' in cpu_info['flags']:
- print('AVX2 detected')
- CFLAGS.append('-DSHUFFLE_AVX2_ENABLED')
- sources += [f for f in glob('c-blosc/blosc/*.c') if 'avx2' in f]
- if os.name == 'posix':
- CFLAGS.append('-mavx2')
- elif os.name == 'nt':
- def_macros += [('__AVX2__', 1)]
classifiers = """\
Development Status :: 5 - Production/Stable