Skip to content

Commit

Permalink
Merge #352
Browse files Browse the repository at this point in the history
352: Add prebuilt bindings for GDAL 3.6 and document how to do it r=lnicola a=ttencate

Fixes #351

- [x] I agree to follow the project's [code of conduct](https://github.com/georust/gdal/blob/master/CODE_OF_CONDUCT.md).
- [x] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users.
---



Co-authored-by: Thomas ten Cate <[email protected]>
  • Loading branch information
bors[bot] and ttencate authored Dec 15, 2022
2 parents 8cdf63e + 49d76c7 commit 6e07805
Show file tree
Hide file tree
Showing 5 changed files with 13,593 additions and 2 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,46 @@ env:
RUST_BACKTRACE: 1

jobs:
gdal_36:
name: "ci gdal-36"
runs-on: ubuntu-latest
container:
image: osgeo/gdal:ubuntu-full-3.6.0

strategy:
matrix:
features: ["", "--all-features"]

steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install build deps
shell: bash
run: |
apt-get update -y
apt-get install build-essential curl pkg-config libclang-dev -y
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --profile minimal --default-toolchain none -y
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
- name: Setup building
run: |
export CC="clang-9"
export CXX="clang++-9"
- name: Install stable
run: |
rustup install --no-self-update --profile minimal stable
rustup component add rustfmt clippy
- name: Check with Rustfmt
run: cargo fmt --all --check
- name: Check with Clippy
run: cargo clippy --all-targets ${{ matrix.features }} -- -D warnings
- name: Build
run: cargo build ${{ matrix.features }} --verbose
- name: Run tests
run: cargo test ${{ matrix.features }} --verbose

gdal_35:
name: "ci gdal-35"
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

- <https://github.com/georust/gdal/pull/347>

- Added prebuilt bindings for GDAL 3.6 (released 6 November 2022).

## 0.14

- Added new content to `README.md` and the root docs.
Expand Down
9 changes: 9 additions & 0 deletions gdal-sys/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,12 @@ attempt to use prebuilt bindings corresponding to that version. Alternatively,
you can generate your own bindings from your libgdal installation by specifying
the `bindgen` feature.

## Creating prebuilt bindings

If a new version of GDAL is released, you (as a `gdal` contributor) can
generate new bindings for inclusion in the `gdal-sys` source distribution by
building with the `bindgen` feature, and then copying the generated file. For
example (the hash will differ in your build):

$ cargo build --features bindgen
$ cp target/debug/build/gdal-sys-db833e3088b78e57/out/bindings.rs gdal-sys/prebuilt-bindings/gdal_3.6.rs
6 changes: 4 additions & 2 deletions gdal-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ pub fn write_bindings(include_paths: Vec<String>, out_path: &Path) {
.allowlist_function("VSI.*");

for path in include_paths {
builder = builder.clang_arg("-I");
builder = builder.clang_arg(path);
builder = builder
.clang_arg("-I")
.clang_arg(path)
.clang_arg("-fretain-comments-from-system-headers");
}

builder
Expand Down
Loading

0 comments on commit 6e07805

Please sign in to comment.