summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: eb0024f9f72ce218a13dceb54fb4ded937dae0fa (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
# Maintainer: Aseem Athale <athaleaseem@gmail.com>

_base=python-crfsuite
pkgname=${_base}-git
epoch=1
pkgver=v0.9.11.r0.g77b4717
pkgrel=2
pkgdesc="A python binding for crfsuite"
arch=('x86_64')
url="https://github.com/scrapinghub/${_base}"
license=('MIT')
depends=('python')
makedepends=('python-build' 'python-wheel' 'python-installer' 'python-setuptools' 'cython' 'git')
source=("git+https://github.com/scrapinghub/python-crfsuite.git"
        "git+https://github.com/chokkan/crfsuite.git"
        "git+https://github.com/chokkan/liblbfgs.git")
sha512sums=('SKIP'
            'SKIP'
            'SKIP')
provides=('python-crfsuite')
conflicts=('python-crfsuite')

pkgver() {
  cd "${_base}"
  git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "${_base}"
  cython pycrfsuite/_pycrfsuite.pyx --cplus -a -3 -I pycrfsuite

  git submodule init

  git config submodule.crfsuite/crfsuite.url "$srcdir/crfsuite"
  git config submodule.liblbfgs/liblbfgs.url "$srcdir/liblbfgs"

  git -c protocol.file.allow=always submodule update
  git -C "${srcdir}/${_base}" clean -dfx
}

build() {
  cd "${_base}"
  python -m build --wheel --no-isolation
}

package() {
  cd "${_base}"
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm 644 LICENSE.txt -t "${pkgdir}/usr/share/licenses/${pkgname}"
}