Crates.io | rust_jsc_sys |
lib.rs | rust_jsc_sys |
version | 0.2.2 |
source | src |
created_at | 2024-05-15 05:17:42.269648 |
updated_at | 2024-07-22 01:51:09.31789 |
description | Low-level bindings to JavaScriptCore |
homepage | |
repository | https://github.com/kevincaicedo/rust-jsc |
max_upload_size | |
id | 1240645 |
size | 1,126,511 |
This crate provides the raw bindings to the JavaScriptCore library. The bindings are generated using the bindgen
crate.
This crate for now only supports macOS and linux. and use a custom version of WebKit to generate the bindings.
Add the following to your Cargo.toml
file:
[dependencies]
rust_jsc_sys = { features = ["patches"], version = "0.2.2" }
For custom static libs, you can set the following environment variable:
export RUST_JSC_CUSTOM_BUILD_PATH=/Users/${user}/Documents/path/to/static/libs
or set the env variable in .cargo/config file.=
by default this library will try to donwload the static libraries from github mirror. If you want to build the static libraries yourself,
you can build the docker image from the Dockerfile it will build the static libraries for you. and copy the static libraries to the provide path DOCKER_BUILDKIT=1 docker build -o ./.libs -t $(IMAGE_NAME) .
this will only works on linux for macos you should build the Javascript Core static libraries running this command from the makefile make build-jsc
or WebKit/Tools/Scripts/build-webkit --jsc-only --cmakeargs="-DENABLE_STATIC_JSC=ON -DUSE_THIN_ARCHIVES=OFF"
then set the RUST_JSC_CUSTOM_BUILD_PATH
to the path of the static libraries.
Make commands:
make build-docker-jsc
- build the static libraries for linuxmake build-jsc
- build the static libraries for macosif you encounter any problem, linking the static libs trying setting the following environment variables:
# for macOS
# Example path to the JavaScriptCore static libraries
DYLD_LIBRARY_PATH=/Users/${user}/Documents/Projects/WebKit/WebKitBuild/JSCOnly/Release/lib:$DYLD_LIBRARY_PATH
# for linux
# Example path to the JavaScriptCore static libraries
LD_LIBRARY_PATH=/Users/${user}/Documents/Projects/WebKit/WebKitBuild/JSCOnly/Release/lib:$LD_LIBRARY_PATH