summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 45017ddb4fb83c166f6e284fbf1c693f76570ab1 (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
# Maintainer: Byeonghoon Yoo <bhyoo@bhyoo.com>

_name=tree-sitter-php
pkgname=python-tree-sitter-php
pkgver=0.24.2
pkgrel=6
pkgdesc="Php grammar for tree-sitter"
arch=('any')
url="https://github.com/tree-sitter/tree-sitter-php"
license=('MIT')
depends=('python' 'python-tree-sitter')
makedepends=(
    'python-build'
    'python-installer'
    'python-wheel'
    'python-setuptools'
)
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/tree-sitter/tree-sitter-php/archive/refs/tags/v0.24.2.tar.gz")
sha256sums=('0e73ad63dda67ac12c0e012726a4e1a9811c26b020a0a2dea3e889f8246d9cf4')


prepare() {
    cd "${_name}-${pkgver}"
    # Upstream pyproject.toml has invalid 'license = "LICENSE"' (neither SPDX nor table form),
    # which fails setuptools >=82 strict validation. Normalize to SPDX.
    sed -i 's/^license = "LICENSE"$/license = "MIT"/' pyproject.toml
}

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

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