summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 54e5033bed96a00f030b525cc9c919e0f1e704ce (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
# Maintainer: J. Nathanael Philipp (jnphilipp) <nathanael@philipp.land>
# Contributor: Luis Martinez <luis dot martinez at disroot dot org>
# Contributor: Philip Goto <philip.goto@gmail.com>
# Contributor: Chris Brendel <cdbrendel@gmail.com>

pkgname=python-spacy
_pkg="${pkgname#python-}"
pkgver=3.8.15
pkgrel=1
pkgdesc='Free open-source library for Natural Language Processing in Python'
arch=('x86_64' 'aarch64')
url='https://github.com/explosion/spacy'
license=('MIT')
depends=(
    'python-catalogue'
    'python-click'
    'python-cymem'
    'python-jinja'
    'python-langcodes'
    'python-murmurhash'
    'python-numpy'
    'python-preshed'
    'python-pydantic'
    'python-requests'
    'python-spacy-loggers'
    'python-srsly'
    'python-thinc'
    'python-tqdm'
    'python-typer'
    'python-wasabi'
    'python-weasel')
makedepends=(
    'cython'
    'python-build'
    'python-installer'
    'python-setuptools'
    'python-wheel')
source=("$pkgname-$pkgver.tar.gz::${url}/archive/refs/tags/release-v${pkgver}.tar.gz")
sha256sums=('07d237a3de7197b668bf953f3d8c001ece89f003356f8104322e7d2b7679906b')

prepare() {
    _dirname=$(bsdtar -tf "${source[0]%%::*}" | awk -F / '{print $1; exit}')
    ln -s "$_dirname" $_pkg-$pkgver
    cd "$_pkg-$pkgver"
    sed -i '/PACKAGES =/c\PACKAGES = find_packages(exclude=["spacy.tests*"])' setup.py
    rm -rf "$_pkg.egg-info"
}

build() {
	cd "$_pkg-$pkgver"
	## skip dependency check because of pinned deps
	python -m build --wheel --no-isolation --skip-dependency-check
}

package() {
	cd "$_pkg-$pkgver"
	python -m installer --destdir="$pkgdir" dist/*.whl
	local _site="$(python -c 'import site; print(site.getsitepackages()[0])')"
	install -dv "$pkgdir/usr/share/licenses/$pkgname/"
	ln -sv "$_site/$_pkg-$pkgver.dist-info/licenses/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/"
}