aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/tree-sitter
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/tree-sitter')
-rw-r--r--vcpkg/ports/tree-sitter/portfile.cmake24
-rw-r--r--vcpkg/ports/tree-sitter/unofficial-cmake.diff17
-rw-r--r--vcpkg/ports/tree-sitter/vcpkg.json17
3 files changed, 58 insertions, 0 deletions
diff --git a/vcpkg/ports/tree-sitter/portfile.cmake b/vcpkg/ports/tree-sitter/portfile.cmake
new file mode 100644
index 0000000..5117ea0
--- /dev/null
+++ b/vcpkg/ports/tree-sitter/portfile.cmake
@@ -0,0 +1,24 @@
+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
+ REF "v${VERSION}"
+ SHA512 f0465a2fabe303c1b62f1f55ed08aa57372ac11370d229adcccd99b5e8067be53e92da281cdfbcd034e2ecefb33ac90a119eeac9035670ac8fbaa4242cb87a11
+ HEAD_REF master
+ PATCHES
+ unofficial-cmake.diff
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}/lib"
+)
+vcpkg_cmake_install()
+vcpkg_fixup_pkgconfig()
+vcpkg_cmake_config_fixup(PACKAGE_NAME "unofficial-tree-sitter")
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/tree-sitter/unofficial-cmake.diff b/vcpkg/ports/tree-sitter/unofficial-cmake.diff
new file mode 100644
index 0000000..7b431c7
--- /dev/null
+++ b/vcpkg/ports/tree-sitter/unofficial-cmake.diff
@@ -0,0 +1,17 @@
+diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
+index 4b44cc1..1b99f08 100644
+--- a/lib/CMakeLists.txt
++++ b/lib/CMakeLists.txt
+@@ -92,4 +92,12 @@ install(FILES include/tree_sitter/api.h
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tree-sitter.pc"
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
+ install(TARGETS tree-sitter
++ EXPORT unofficial-tree-sitter-config
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
++
++target_include_directories(tree-sitter PUBLIC "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
++install(
++ EXPORT unofficial-tree-sitter-config
++ NAMESPACE unofficial::tree-sitter::
++ DESTINATION share/unofficial-tree-sitter
++)
diff --git a/vcpkg/ports/tree-sitter/vcpkg.json b/vcpkg/ports/tree-sitter/vcpkg.json
new file mode 100644
index 0000000..219f9df
--- /dev/null
+++ b/vcpkg/ports/tree-sitter/vcpkg.json
@@ -0,0 +1,17 @@
+{
+ "name": "tree-sitter",
+ "version-semver": "0.25.10",
+ "description": "An incremental parsing system for programming tools.",
+ "homepage": "https://github.com/tree-sitter/tree-sitter",
+ "license": "MIT",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}