summaryrefslogtreecommitdiff
path: root/textproc/py-tree-sitter-language-pack
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--textproc/py-tree-sitter-language-pack/Makefile28
-rw-r--r--textproc/py-tree-sitter-language-pack/distinfo3
-rw-r--r--textproc/py-tree-sitter-language-pack/files/patch-pyproject.toml35
-rw-r--r--textproc/py-tree-sitter-language-pack/files/patch-setup.py50
-rw-r--r--textproc/py-tree-sitter-language-pack/files/patch-tree__sitter__language__pack_____init____.py39
-rw-r--r--textproc/py-tree-sitter-language-pack/pkg-descr2
6 files changed, 157 insertions, 0 deletions
diff --git a/textproc/py-tree-sitter-language-pack/Makefile b/textproc/py-tree-sitter-language-pack/Makefile
new file mode 100644
index 000000000000..1f8b50a300d5
--- /dev/null
+++ b/textproc/py-tree-sitter-language-pack/Makefile
@@ -0,0 +1,28 @@
+PORTNAME= tree-sitter-language-pack
+DISTVERSION= 0.9.1
+CATEGORIES= textproc python
+MASTER_SITES= PYPI
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+DISTNAME= ${PORTNAME:S/-/_/g}-${PORTVERSION}
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Tree-sitter: Collection of 160+ tree-sitter language parsers
+WWW= https://github.com/Goldziher/tree-sitter-language-pack
+
+LICENSE= APACHE20
+
+BUILD_DEPENDS= ${PY_SETUPTOOLS} \
+ ${PYTHON_PKGNAMEPREFIX}typing-extensions>0:devel/py-typing-extensions@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR}
+RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}tree-sitter023==0.23.2:devel/py-tree-sitter023@${PY_FLAVOR}
+
+USES= python
+USE_PYTHON= pep517 cython3 autoplist pytest
+
+TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
+TEST_WRKSRC= ${WRKSRC}/tests
+
+post-install:
+ @${FIND} ${STAGEDIR}${PYTHON_SITELIBDIR} -name '*.so' -exec ${STRIP_CMD} {} +
+
+.include <bsd.port.mk>
diff --git a/textproc/py-tree-sitter-language-pack/distinfo b/textproc/py-tree-sitter-language-pack/distinfo
new file mode 100644
index 000000000000..975ee711c618
--- /dev/null
+++ b/textproc/py-tree-sitter-language-pack/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1758702264
+SHA256 (tree_sitter_language_pack-0.9.1.tar.gz) = 2da539751ecc50b9e6bbfca38b57501a3c55e67186a939d5bf149d9cb7220974
+SIZE (tree_sitter_language_pack-0.9.1.tar.gz) = 49489962
diff --git a/textproc/py-tree-sitter-language-pack/files/patch-pyproject.toml b/textproc/py-tree-sitter-language-pack/files/patch-pyproject.toml
new file mode 100644
index 000000000000..c87baf8b1e95
--- /dev/null
+++ b/textproc/py-tree-sitter-language-pack/files/patch-pyproject.toml
@@ -0,0 +1,35 @@
+- adjust version requirements
+- remove "unimportant" tree-sitter-* dependencies that aren't yet ported
+
+--- pyproject.toml.orig 2025-09-23 06:46:36 UTC
++++ pyproject.toml
+@@ -1,7 +1,7 @@ build-backend = "setuptools.build_meta"
+ [build-system]
+ build-backend = "setuptools.build_meta"
+
+-requires = [ "cython>=3.0.12", "setuptools>=80.9.0", "typing-extensions>=4.15.0" ]
++requires = [ "cython", "setuptools", "typing-extensions>=4.15.0" ]
+
+ [project]
+ name = "tree-sitter-language-pack"
+@@ -17,7 +17,6 @@ keywords = [
+ "text-processing",
+ "tree-sitter",
+ ]
+-license = "MIT OR Apache-2.0"
+
+ authors = [ { name = "Na'aman Hirschfeld", email = "nhirschfeld@gmail.com" } ]
+ requires-python = ">=3.9.0"
+@@ -37,9 +36,9 @@ dependencies = [
+ ]
+ dependencies = [
+ "tree-sitter==0.23.2",
+- "tree-sitter-c-sharp==0.23.1",
+- "tree-sitter-embedded-template==0.23.2",
+- "tree-sitter-yaml==0.7.0",
++ #"tree-sitter-c-sharp==0.23.1",
++ #"tree-sitter-embedded-template==0.23.2",
++ #"tree-sitter-yaml==0.7.0",
+ ]
+
+ urls.documentation = "https://github.com/Goldziher/tree-sitter-language-pack#readme"
diff --git a/textproc/py-tree-sitter-language-pack/files/patch-setup.py b/textproc/py-tree-sitter-language-pack/files/patch-setup.py
new file mode 100644
index 000000000000..815327e24373
--- /dev/null
+++ b/textproc/py-tree-sitter-language-pack/files/patch-setup.py
@@ -0,0 +1,50 @@
+--- setup.py.orig 2025-09-24 08:43:32 UTC
++++ setup.py
+@@ -4,7 +4,7 @@ from setuptools import Extension, find_packages, setup
+ from platform import system
+
+ from setuptools import Extension, find_packages, setup
+-from setuptools.command.bdist_wheel import bdist_wheel
++#from setuptools.command.bdist_wheel import bdist_wheel
+ from setuptools.command.build_ext import build_ext
+
+ MIN_PYTHON_VERSION = 39
+@@ -99,19 +99,19 @@ class BuildExt(build_ext):
+ super().build_extension(ext)
+
+
+-class BdistWheel(bdist_wheel):
+- """Custom bdist_wheel command to handle Python 3.9+ ABI tag."""
++#class BdistWheel(bdist_wheel):
++# """Custom bdist_wheel command to handle Python 3.9+ ABI tag."""
++#
++# def get_tag(self) -> tuple[str, str, str]:
++# """Get the tag for the wheel."""
++# python, abi, platform = super().get_tag()
++# platform = platform.replace("linux", "manylinux2014")
++# if python.startswith("cp") and int(python[2:]) >= MIN_PYTHON_VERSION:
++# # Support all Python versions >= 3.9 using abi3
++# return "cp39", "abi3", platform
++# return python, abi, platform
+
+- def get_tag(self) -> tuple[str, str, str]:
+- """Get the tag for the wheel."""
+- python, abi, platform = super().get_tag()
+- platform = platform.replace("linux", "manylinux2014")
+- if python.startswith("cp") and int(python[2:]) >= MIN_PYTHON_VERSION:
+- # Support all Python versions >= 3.9 using abi3
+- return "cp39", "abi3", platform
+- return python, abi, platform
+
+-
+ setup(
+ packages=find_packages(include=["tree_sitter_language_pack", "tree_sitter_language_pack.bindings"]),
+ package_data={"tree_sitter_language_pack": ["py.typed"]},
+@@ -120,7 +120,6 @@ setup(
+ include_package_data=True,
+ cmdclass={
+ "build_ext": BuildExt,
+- "bdist_wheel": BdistWheel,
+ },
+ options={"build_ext": {"inplace": True}},
+ )
diff --git a/textproc/py-tree-sitter-language-pack/files/patch-tree__sitter__language__pack_____init____.py b/textproc/py-tree-sitter-language-pack/files/patch-tree__sitter__language__pack_____init____.py
new file mode 100644
index 000000000000..caef2a8a713b
--- /dev/null
+++ b/textproc/py-tree-sitter-language-pack/files/patch-tree__sitter__language__pack_____init____.py
@@ -0,0 +1,39 @@
+--- tree_sitter_language_pack/__init__.py.orig 2025-09-23 06:46:36 UTC
++++ tree_sitter_language_pack/__init__.py
+@@ -6,9 +6,9 @@ from typing import Literal, cast
+ from pathlib import Path
+ from typing import Literal, cast
+
+-import tree_sitter_c_sharp
+-import tree_sitter_embedded_template
+-import tree_sitter_yaml
++#import tree_sitter_c_sharp
++#import tree_sitter_embedded_template
++#import tree_sitter_yaml
+ from tree_sitter import Language, Parser
+
+ SupportedLanguage = Literal[
+@@ -35,7 +35,6 @@ SupportedLanguage = Literal[
+ "commonlisp",
+ "cpon",
+ "cpp",
+- "csharp",
+ "css",
+ "csv",
+ "cuda",
+@@ -47,7 +46,6 @@ SupportedLanguage = Literal[
+ "elisp",
+ "elixir",
+ "elm",
+- "embeddedtemplate",
+ "erlang",
+ "fennel",
+ "firrtl",
+@@ -179,7 +177,6 @@ SupportedLanguage = Literal[
+ "wgsl",
+ "xcompose",
+ "xml",
+- "yaml",
+ "yuck",
+ "zig",
+ "magik",
diff --git a/textproc/py-tree-sitter-language-pack/pkg-descr b/textproc/py-tree-sitter-language-pack/pkg-descr
new file mode 100644
index 000000000000..5258a36730f1
--- /dev/null
+++ b/textproc/py-tree-sitter-language-pack/pkg-descr
@@ -0,0 +1,2 @@
+py-tree-sitter-language-pack contains a comprehensive collection of 160+
+tree-sitter language parsers.