summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4ff6404057c48affcc8371d96e51e837f9c8d39b (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
# Maintainer: Konstantin Gizdov <arch at kge dot pw>

_pkgname='boost-histogram'
pkgname="python-${_pkgname}"
pkgver=1.7.0
pkgrel=1
pkgdesc="Python bindings for Boost's Histogram library."
arch=('x86_64')
url='https://github.com/scikit-hep/boost-histogram'
license=('BSD-3-Clause' 'BSL-1.0')
depends=('python-numpy')
makedepends=('git' 'python-build' 'python-installer' 'python-wheel' 'python-scikit-build-core' 'python-setuptools-scm' 'pybind11')
checkdepends=('python-pytest' 'python-pytest-benchmark')
source=(
  "${pkgname}::git+https://github.com/scikit-hep/boost-histogram.git#tag=v${pkgver}"
  "${pkgname}-pybind11::git+https://github.com/pybind/pybind11.git"
  "${pkgname}-histogram::git+https://github.com/boostorg/histogram.git"
  "${pkgname}-core::git+https://github.com/boostorg/core.git"
  "${pkgname}-mp11::git+https://github.com/boostorg/mp11.git"
  "${pkgname}-config::git+https://github.com/boostorg/config.git"
  "${pkgname}-throw_exception::git+https://github.com/boostorg/throw_exception.git"
  "${pkgname}-assert::git+https://github.com/boostorg/assert.git"
  "${pkgname}-variant2::git+https://github.com/boostorg/variant2.git"
)

sha256sums=('1f753c46f3de31a5dbaf3316a6758a52aaeb4b2ceb21ab5dbd7014c5de38d540'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP')

prepare() {
  cd "${srcdir}/${pkgname}"
  git submodule init

  git config submodule."pybind11".url "${srcdir}/${pkgname}"-pybind11
  git config submodule."extern/histogram".url "${srcdir}/${pkgname}"-histogram
  git config submodule."extern/core".url "${srcdir}/${pkgname}"-core
  git config submodule."extern/mp11".url "${srcdir}/${pkgname}"-mp11
  git config submodule."extern/config".url "${srcdir}/${pkgname}"-config
  git config submodule."extern/throw_exception".url "${srcdir}/${pkgname}"-throw_exception
  git config submodule."extern/assert".url "${srcdir}/${pkgname}"-assert
  git config submodule."extern/variant2".url "${srcdir}/${pkgname}"-variant2

  git -c protocol.file.allow=always submodule update --init --recursive
}

build() {
  cd "${srcdir}/${pkgname}"
  python -m build --wheel --no-isolation
}

check() {
  cd "${srcdir}/${pkgname}"
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python -m pytest -v --override-ini="filterwarnings=ignore::DeprecationWarning"
}

package() {
  cd "${srcdir}/${pkgname}"
  python -m installer --destdir="${pkgdir}" dist/*.whl
  install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}