Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #10194 - emilio:stylo-fixes-and-doc, r=bholley
geckolib: Add style structs bindings and documentation See the description of 6c851c8 to see which incorrect bindings remain. They're just nine types. cc @bholley @SimonSapin @pcwalton (I don't know who should review this actually) <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10194) <!-- Reviewable:end -->
- Loading branch information
Showing
7 changed files
with
4,667 additions
and
45 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
llvm/ | ||
rust-bindgen/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# GeckoLib tools | ||
|
||
This directory contains mostly simple tools for working with | ||
[stylo](https://public.etherpad-mozilla.org/p/stylo). | ||
|
||
Some scripts require [multirust](https://github.com/brson/multirust) in order to | ||
work. | ||
|
||
You can see a description of them below. | ||
|
||
## `build_custom_clang.sh` | ||
|
||
Download a patched LLVM which is needed to use bindgen properly with C++. | ||
|
||
## `setup_bindgen.sh` | ||
|
||
This uses downloads a custom version of bindgen, up to date to generate the | ||
bindings, and uses the custom `clang` to build it. | ||
|
||
It will also rebuild it if it's already downloaded. | ||
|
||
## `regen_bindings.sh` | ||
|
||
This will regenerate the bindings for the `ServoBindings.h` file in your gecko | ||
build (which are in `ports/geckolib/bindings.rs`). | ||
|
||
## `regen_style_structs.sh` | ||
|
||
This will generate the bindings for Gecko's style structs. Current bindings are | ||
actually in `ports/geckolib/gecko_style_structs.rs`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,34 @@ | ||
#!/bin/bash | ||
|
||
# Run in the tools directory. | ||
cd `dirname $0` | ||
cd "$(dirname $0)" | ||
|
||
# Setup and build bindgen. | ||
export LIBCLANG_PATH="$(pwd)/llvm/build/lib" | ||
export LD_LIBRARY_PATH="$(pwd)/llvm/build/lib" | ||
export DYLD_LIBRARY_PATH="$(pwd)/llvm/build/lib" | ||
|
||
|
||
# Make sure we have a custom clang set up. | ||
if [ ! -d llvm ]; then | ||
if [ ! -d "$LIBCLANG_PATH" ]; then | ||
echo "Custom LLVM/Clang not found. Run build_custom_clang.sh first." | ||
exit 1 | ||
fi | ||
|
||
# Don't run twice. | ||
if [ -d rust-bindgen ]; then | ||
echo "rust-bindgen directory already exists." | ||
exit 1 | ||
fi | ||
|
||
# Check for multirust | ||
if [ ! -x "$(command -v multirust)" ]; then | ||
echo 'multirust must be installed.' | ||
echo "multirust must be installed." | ||
exit 1 | ||
fi | ||
|
||
# Setup and build bindgen. | ||
export LIBCLANG_PATH=`pwd`/llvm/build/Release+Asserts/lib | ||
git clone https://github.com/bholley/rust-bindgen.git | ||
cd rust-bindgen | ||
git checkout sm-hacks | ||
# Don't try to clone twice. | ||
if [ ! -d rust-bindgen ]; then | ||
git clone https://github.com/ecoal95/rust-bindgen.git | ||
cd rust-bindgen | ||
git checkout sm-hacks-rebase-squashed | ||
else | ||
cd rust-bindgen | ||
fi | ||
|
||
multirust override nightly | ||
cargo build |