2021-12-24 00:20:42 +01:00

36 lines
1.1 KiB
Plaintext

# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=tree-sitter-python
pkgver=0.19.1
pkgrel=0
pkgdesc="Python grammar for tree-sitter"
url="https://github.com/tree-sitter/tree-sitter-python"
arch="all"
license="MIT"
makedepends="tree-sitter-dev"
install_if="tree-sitter-grammars"
source="https://github.com/tree-sitter/tree-sitter-python/archive/rust-$pkgver/tree-sitter-python-$pkgver.tar.gz"
builddir="$srcdir/$pkgname-rust-$pkgver"
options="!check" # no tests for shared lib
build() {
cd src
cc $CFLAGS -fPIC -Wall -std=c99 -c ./*.c
c++ $CXXFLAGS -fPIC -Wall -c ./*.cc
c++ $LDFLAGS -shared -Wl,--no-undefined -o lib$pkgname.so ./*.o
}
package() {
install -D -m755 src/lib$pkgname.so -t "$pkgdir"/usr/lib/
# Create symlink for Neovim
install -d "$pkgdir"/usr/share/nvim/runtime/parser
ln -s ../../../../lib/lib$pkgname.so \
"$pkgdir"/usr/share/nvim/runtime/parser/${pkgname#tree-sitter-}.so
}
sha512sums="
4e8e4e53c61902d757940f4861e3f300ece77face47296caf7c5a7de94525a8094a3ca3d45cafddc0a6e2d251f68ddda95a672ca67594d10775d2cc44edf5494 tree-sitter-python-0.19.1.tar.gz
"