aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/tree-sitter-c
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/tree-sitter-c
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/tree-sitter-c')
-rw-r--r--vcpkg/ports/tree-sitter-c/pkgconfig.diff24
-rw-r--r--vcpkg/ports/tree-sitter-c/portfile.cmake26
-rw-r--r--vcpkg/ports/tree-sitter-c/vcpkg.json18
3 files changed, 68 insertions, 0 deletions
diff --git a/vcpkg/ports/tree-sitter-c/pkgconfig.diff b/vcpkg/ports/tree-sitter-c/pkgconfig.diff
new file mode 100644
index 0000000..7073a30
--- /dev/null
+++ b/vcpkg/ports/tree-sitter-c/pkgconfig.diff
@@ -0,0 +1,24 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3771647..772f62a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -45,16 +45,16 @@ set_target_properties(tree-sitter-c
+ SOVERSION "${TREE_SITTER_ABI_VERSION}.${PROJECT_VERSION_MAJOR}"
+ DEFINE_SYMBOL "")
+
++include(GNUInstallDirs)
++
+ configure_file(bindings/c/tree-sitter-c.pc.in
+ "${CMAKE_CURRENT_BINARY_DIR}/tree-sitter-c.pc" @ONLY)
+
+-include(GNUInstallDirs)
+-
+ install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bindings/c/tree_sitter"
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
+ FILES_MATCHING PATTERN "*.h")
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tree-sitter-c.pc"
+- DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig")
++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
+ install(TARGETS tree-sitter-c
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+
diff --git a/vcpkg/ports/tree-sitter-c/portfile.cmake b/vcpkg/ports/tree-sitter-c/portfile.cmake
new file mode 100644
index 0000000..102e329
--- /dev/null
+++ b/vcpkg/ports/tree-sitter-c/portfile.cmake
@@ -0,0 +1,26 @@
+if(VCPKG_TARGET_IS_WINDOWS)
+ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+endif()
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO tree-sitter/tree-sitter-c
+ REF "v${VERSION}"
+ SHA512 51cf052230ee835d4ae5e6c5adb24aeaeba3b4f106aceefaf4000bd0e57321946f1b3e3b0f9ea71d1c17a618604c6c7269c80c3ecc5ca17e22c883ff5ce4c304
+ HEAD_REF master
+ PATCHES
+ pkgconfig.diff
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ "-DTREE_SITTER_CLI=${CURRENT_HOST_INSTALLED_DIR}/tools/tree-sitter-cli/tree-sitter${VCPKG_HOST_EXECUTABLE_SUFFIX}"
+ -DTREE_SITTER_REUSE_ALLOCATOR=ON
+)
+vcpkg_cmake_install()
+vcpkg_fixup_pkgconfig()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/tree-sitter-c/vcpkg.json b/vcpkg/ports/tree-sitter-c/vcpkg.json
new file mode 100644
index 0000000..441327b
--- /dev/null
+++ b/vcpkg/ports/tree-sitter-c/vcpkg.json
@@ -0,0 +1,18 @@
+{
+ "name": "tree-sitter-c",
+ "version": "0.24.1",
+ "description": "C grammar for tree-sitter",
+ "homepage": "https://github.com/tree-sitter/tree-sitter-c",
+ "license": "MIT",
+ "dependencies": [
+ "tree-sitter",
+ {
+ "name": "tree-sitter-cli",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ }
+ ]
+}