summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 82e0e1c06297b5f8f53447e023c89e550e90e3bf (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
# Maintainer: Butui Hu <hot123tea123@gmail.com>

_pkgname=mmlvis
pkgname=python-mmlvis
pkgver=10.5.3
pkgrel=7
pkgdesc='Python API for LVIS Dataset (openmm lab fork)'
arch=('any')
url='https://pypi.org/project/mmlvis'
license=('BSD-3-Clause')
depends=(
  opencv
  python-cycler
  python-dateutil
  python-kiwisolver
  python-matplotlib
  python-numpy
  python-pyparsing
  python-mmpycocotools
  python-six
)
makedepends=(
  python-build
  python-installer
  python-setuptools
  python-wheel
)
provides=(python-lvis)
conflicts=(python-lvis)
replaces=(python-lvis-openmm-git)

source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/${_pkgname}/${_pkgname}-${pkgver}.tar.gz"
        "https://github.com/open-mmlab/cocoapi/raw/master/license.txt"
        "https://github.com/open-mmlab/cocoapi/raw/master/lvis/requirements.txt"
)
sha512sums=('5ca9510db867dc85f34a68e5361f955259980ba75653d6076aa3013d67d3941702536d8fc62829503a1e5895ab03bc8d7a2d3fed794d7e742eafe9183eb30bf2'
            'b0dc48c4d0fa9eaa101bf94dd75df4b23a9281ba714b0c1f01204d2d48c6f1de14cbe093590b16ef614168621146c9f708f6af2543561a56c76c81b66113c435'
            '76e376c790990a4a5c1a5eb2dac93de5aa7665f5ceaf22243a73a572db6cc4e2bd2ba6d0f611103b63133c9a5b7d0f434e3c4cba5014473fbc2fa062d708ae39')

prepare() {
  # fix https://github.com/open-mmlab/cocoapi/issues/29
  sed -i "s,np.float,float,g" "${_pkgname}-${pkgver}/lvis/eval.py"
  # add missing requirements.txt
  cp -v "requirements.txt" "${_pkgname}-${pkgver}"
}

build() {
  cd ${_pkgname}-${pkgver}
  python -m build --wheel --no-isolation
}
package() {
  cd ${_pkgname}-${pkgver}
  python -m installer --destdir="${pkgdir}" dist/*.whl
  install -Dm644 "${srcdir}/license.txt" -t "${pkgdir}/usr/share/licenses/${pkgname}"
}
# vim:set ts=2 sw=2 et: