Skip to content

Commit

Permalink
Prepare for 0.8.0 release
Browse files Browse the repository at this point in the history
This new release generates bindings against sfcgal 2.0.0 C API.
  • Loading branch information
mthh committed Oct 31, 2024
1 parent c6dec15 commit 6b86e46
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ env:
name: Build documentation on new release
jobs:
doc:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: |
sudo apt-get install -y libboost1.74-all-dev libmpfr-dev libgmp-dev cmake wget unzip clang libstdc++-11-dev
wget https://github.com/CGAL/cgal/releases/download/v5.6.1/CGAL-5.6.1-library.tar.xz
wget https://gitlab.com/SFCGAL/SFCGAL/-/archive/v1.5.0/SFCGAL-v1.5.0.zip
wget https://gitlab.com/SFCGAL/SFCGAL/-/archive/v2.0.0/SFCGAL-v2.0.0.zip
tar -xf CGAL-5.6.1-library.tar.xz
unzip SFCGAL-v1.5.0.zip
unzip SFCGAL-v2.0.0.zip
cd CGAL-5.6.1 && cmake . && sudo make install && cd ..
cd $(ls -d */ | grep SFC) && cmake -DCMAKE_INSTALL_PREFIX=/usr . && make && sudo make install && cd ..
- run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ on:
name: Build and run tests
jobs:
test:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: |
sudo apt-get install -y libboost1.74-all-dev libmpfr-dev libgmp-dev cmake wget unzip clang libstdc++-11-dev
wget https://github.com/CGAL/cgal/releases/download/v5.6.1/CGAL-5.6.1-library.tar.xz
wget https://gitlab.com/SFCGAL/SFCGAL/-/archive/v1.5.0/SFCGAL-v1.5.0.zip
wget https://gitlab.com/SFCGAL/SFCGAL/-/archive/v2.0.0/SFCGAL-v2.0.0.zip
tar -xf CGAL-5.6.1-library.tar.xz
unzip SFCGAL-v1.5.0.zip
unzip SFCGAL-v2.0.0.zip
cd CGAL-5.6.1 && cmake . && sudo make install && cd ..
cd $(ls -d */ | grep SFC) && cmake -DCMAKE_INSTALL_PREFIX=/usr . && make && sudo make install && cd ..
- run: cargo test --all-features
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog
All notable changes to this project will be documented in this file.

## [0.8.0] - 2024-10-31
### Changed
- Generate bindings against latest SFCGAL version `2.0.0`.
- Update `bindgen` version to `0.70`.

## [0.7.0] - 2024-04-16
### Changed
- Generate bindings against latest SFCGAL version `1.5.0`.
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sfcgal-sys"
version = "0.7.0"
version = "0.8.0"
authors = ["Matthieu Viry <[email protected]>"]
license = "MIT/Apache-2.0"
edition = "2021"
Expand All @@ -15,5 +15,5 @@ repository = "https://github.com/mthh/sfcgal-sys"
categories = ["external-ffi-bindings"]

[build-dependencies]
bindgen = "0.69"
bindgen = "0.70"
cc = "1.0"
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

[![Build](https://github.com/mthh/sfcgal-sys/actions/workflows/test.yml/badge.svg)](https://github.com/mthh/sfcgal-sys/actions/workflows/test.yml)
[![Crates.io](https://img.shields.io/crates/v/sfcgal-sys.svg)](https://crates.io/crates/sfcgal-sys)
[![Documentation](https://img.shields.io/badge/documentation-0.7.0-green)](https://mthh.github.io/sfcgal-sys/sfcgal_sys/)
[![Documentation](https://img.shields.io/badge/documentation-0.8.0-green)](https://mthh.github.io/sfcgal-sys/sfcgal_sys/)

Rust low-level FFI bindings to [`SFCGAL`](https://sfcgal.gitlab.io/SFCGAL/) 1.5.x C API.
Rust low-level FFI bindings to [`SFCGAL`](https://sfcgal.gitlab.io/SFCGAL/) 2.0.x C API.
Don't use this crate directly, prefer it's higher-level wrapper : [sfcgal-rs](https://github.com/mthh/sfcgal-rs).

> [!IMPORTANT]
> Note that the required version of SFCGAL is currently 1.5.x (latest version - 2023-10-30).
> If you want to use SFCCAL 1.4.x, you can use the 0.6.x version of this crate / of [sfcgal-rs](https://github.com/mthh/sfcgal-rs).
> Note that the required version of SFCGAL is currently 2.0.x (latest version - 2024-10-10).
> If you want to use SFCCAL 1.5.x, you can use the 0.7.x version of this crate / of [sfcgal-rs](https://github.com/mthh/sfcgal-rs).
## Internals

Expand All @@ -19,7 +19,7 @@ Then bindgen is run to generate these low-levels bindings.

In addition to all the `sfcgal_` types and functions, this crate expose :
- a Rust `initialize` function: it calls `sfcgal_init()` function then it calls a custom `w_sfcgal_init_handlers()` function which replace the error and warning handlers from `printf` to a char buffer. That `initialize` function internally uses `std::sync::Once` to ensure it's only called once.
- two C functions `w_sfcgal_get_last_error` and `w_sfcgal_get_last_warning` which repectively reads the buffer containing the error message and the buffer containing the warning message.
- two C functions `w_sfcgal_get_last_error` and `w_sfcgal_get_last_warning` which respectively reads the buffer containing the error message and the buffer containing the warning message.

In the future it could probably be improved by not requiring SFCGAL to be installed as a system library.

Expand Down

0 comments on commit 6b86e46

Please sign in to comment.