Skip to content

Commit

Permalink
add libtree_sitter_highlight (#4694)
Browse files Browse the repository at this point in the history
* add libtree_sitter_highlight

* Update T/tree_sitter_highlight/build_tarballs.jl

Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com>

* Remove vvvv to avoid confusion

* fix for windows build

* Update build_tarballs.jl

Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com>
  • Loading branch information
Pangoraw and giordano authored Mar 30, 2022
1 parent 340c9fb commit c346753
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions T/tree_sitter_highlight/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder

name = "tree_sitter_highlight"
version = v"0.20.6"

# Collection of sources required to complete build
sources = [
GitSource("https://github.com/tree-sitter/tree-sitter/",
"ccd6bf554d922596ce905730d98a77af368bba5c"),
]

# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir/
# Use cargo-rustc to build tree-sitter-highlight as a dynamic library here
cargo rustc --release --manifest-path highlight/Cargo.toml -- --crate-type=cdylib
install -Dvm 755 target/${rust_target}/release/deps/*tree_sitter_highlight-*.${dlext} "${libdir}/libtree_sitter_highlight.${dlext}"
"""

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = supported_platforms()
# Rust toolchain is unusable on i686-w64-mingw32
filter!(p -> !(Sys.iswindows(p) && arch(p) == "i686"), platforms)
# Also, can't build cdylib for Musl systems
filter!(p -> libc(p) != "musl", platforms)

# The products that we will ensure are always built
products = [
LibraryProduct("libtree_sitter_highlight", :libtree_sitter_highlight),
]

# Dependencies that must be installed before this package can be built
dependencies = Dependency[
]

# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies;
compilers=[:c, :rust], julia_compat="1.6", lock_microarchitecture=false)

0 comments on commit c346753

Please sign in to comment.