summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6168c28539689400e49ca6e82b0aa508c1eaf0f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Maintainer: Konstantin Gizdov <arch at kge dot pw>

pkgbase=python-uproot
_pkgbase=uproot
pkgname=('python2-uproot' 'python-uproot')
pkgver=3.10.0
pkgrel=1
pkgdesc="Minimalist CERN ROOT I/O in pure Python and Numpy"
arch=('any')
makedepends=('python2-cachetools' 'python2-setuptools' 'python2-pytest-runner'
             'python-cachetools' 'python-setuptools' 'python-pytest-runner')
checkdepends=('python2-mock' 'python2-pandas' 'python2-pkgconfig' 'python2-uproot-methods' 'python2-xxhash'
              'python-mock' 'python-pandas' 'python-pkgconfig' 'python-uproot-methods' 'python-xxhash')
url="https://github.com/scikit-hep/uproot"
license=('BSD')

source=("${url}/archive/${pkgver}.zip")
sha256sums=('cb22c02bc53438b47b23fb26d5f726b9d6fa9818d045ddb4ceb6ee6771910ba0')

prepare() {
    cd "${srcdir}"
    cp -a "${_pkgbase}-${pkgver}" "${_pkgbase}-py2-${pkgver}"
    cd "${_pkgbase}-py2-${pkgver}"

    find . -name '*.py' -type f -exec \
        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 '{}' \; -print
}

build() {
    cd "${srcdir}/${_pkgbase}-${pkgver}"
    python setup.py build

    cd "${srcdir}/${_pkgbase}-py2-${pkgver}"
    python2 setup.py build
}

check() {
    cd "${srcdir}/${_pkgbase}-${pkgver}"
    python setup.py pytest

    cd "${srcdir}/${_pkgbase}-py2-${pkgver}"
    python2 setup.py pytest
}

package_python2-uproot() {
    depends=('python2-awkward'
             'python2-cachetools'
             'python2-lz4'
             'python2-numpy'
             'python2-uproot-methods')
    optdepends=('python2-futures: Python2 parallel processing'
                'python2-backports.lzma: LZMA compression used by some ROOT files'
                'xrootd: access remote files over XRootD')
    cd "${srcdir}/${_pkgbase}-py2-${pkgver}"

    python2 setup.py install --root="${pkgdir}/" --optimize=1

    install -D LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

    install -D README.rst "${pkgdir}/usr/share/${pkgname}/README.rst"

    install -d "${pkgdir}/usr/share/doc/${pkgname}"
    cp -r docs "${pkgdir}/usr/share/doc/${pkgname}/"
}

package_python-uproot() {
    depends=('python-awkward'
             'python-cachetools'
             'python-lz4'
             'python-numpy'
             'python-uproot-methods')
    optdepends=('xrootd: access remote files over XRootD')
    cd "${srcdir}/${_pkgbase}-${pkgver}"

    python setup.py install --root="${pkgdir}/" --optimize=1

    install -D LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

    install -D README.rst "${pkgdir}/usr/share/${pkgname}/README.rst"

    install -d "${pkgdir}/usr/share/doc/${pkgname}"
    cp -r docs "${pkgdir}/usr/share/doc/${pkgname}/"
}