Skip to content

Commit e93d83b

Browse files
committed
Squashed commit of the following:
commit e2305bd Author: Jan Range <[email protected]> Date: Wed Apr 30 12:52:46 2025 +0200 build deps before linting commit 2b234af Author: Jan Range <[email protected]> Date: Wed Apr 30 12:50:36 2025 +0200 update readme commit f805230 Author: Jan Range <[email protected]> Date: Wed Apr 30 12:47:08 2025 +0200 remove iconv macos part commit 1726b52 Author: Jan Range <[email protected]> Date: Wed Apr 30 12:33:47 2025 +0200 use `expat` and `zlib` only commit 96032c3 Merge: 020d8c4 f30c353 Author: Jan Range <[email protected]> Date: Wed Apr 30 12:21:48 2025 +0200 Merge branch 'cargo-vcpkg-port' of https://github.com/EnzymeML/sbml-rs into cargo-vcpkg-port commit 020d8c4 Author: Jan Range <[email protected]> Date: Wed Apr 30 12:21:32 2025 +0200 link bcrypt commit f30c353 Author: Jan Range <[email protected]> Date: Wed Apr 30 12:02:37 2025 +0200 Use static-md triplet commit 8753f60 Author: Jan Range <[email protected]> Date: Wed Apr 30 11:27:01 2025 +0200 use specific triplet for msvc commit 4ce2452 Author: Jan Range <[email protected]> Date: Wed Apr 30 10:38:51 2025 +0200 set `static` and hack `Target` variable commit 7ec99a1 Author: Jan Range <[email protected]> Date: Wed Apr 30 04:14:10 2025 +0200 remove unused commit 3a40380 Author: Jan Range <[email protected]> Date: Wed Apr 30 04:13:25 2025 +0200 build explicit commit d11b70c Author: Jan Range <[email protected]> Date: Wed Apr 30 03:49:55 2025 +0200 Update build.rs commit d4ec3a2 Author: Jan Range <[email protected]> Date: Wed Apr 30 03:45:45 2025 +0200 remove extra steps commit 025dae1 Author: Jan Range <[email protected]> Date: Wed Apr 30 03:45:19 2025 +0200 check for dyn triplet commit ab87bed Author: Jan Range <[email protected]> Date: Wed Apr 30 03:29:51 2025 +0200 check if target is built as expected commit 53bc3f1 Author: Jan Range <[email protected]> Date: Wed Apr 30 03:29:24 2025 +0200 explicitly build for static windows commit d569cb0 Author: Jan Range <[email protected]> Date: Wed Apr 30 03:12:56 2025 +0200 remove automatic part commit 1b474c7 Author: Jan Range <[email protected]> Date: Wed Apr 30 03:12:47 2025 +0200 install vcpkg dep commit 465fe9a Author: Jan Range <[email protected]> Date: Wed Apr 30 03:12:31 2025 +0200 remove flag commit db99676 Author: Jan Range <[email protected]> Date: Wed Apr 30 02:49:51 2025 +0200 set correct vcpkg dir commit dcb0fe8 Author: Jan Range <[email protected]> Date: Wed Apr 30 02:49:42 2025 +0200 install `libiconv` only on apple commit 7de0100 Author: Jan Range <[email protected]> Date: Wed Apr 30 02:18:05 2025 +0200 remove `sscache` commit 4be3d90 Author: Jan Range <[email protected]> Date: Wed Apr 30 02:17:31 2025 +0200 remove manual building and simply run tests commit 1b98707 Author: Jan Range <[email protected]> Date: Wed Apr 30 02:17:19 2025 +0200 use `vcpkg` to build cpp deps commit 732f92f Author: Jan Range <[email protected]> Date: Wed Apr 30 02:17:05 2025 +0200 set lib as `staticlib` and add `vcpkg` deps
1 parent aa9b119 commit e93d83b

File tree

9 files changed

+116
-223
lines changed

9 files changed

+116
-223
lines changed

.cargo/config.toml

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,11 @@ jobs:
2020
with:
2121
submodules: recursive
2222

23+
- name: Install dependencies
24+
run: cargo install cargo-vcpkg
25+
26+
- name: Build dependencies
27+
run: cargo vcpkg build
28+
2329
- name: Run Clippy
2430
run: cargo clippy --all-targets --all-features

.github/workflows/test-build.yml

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
workflow_dispatch:
55
push:
66
paths:
7+
- 'build.rs'
8+
- '.github/**/*.yml'
79
- 'src/**/*.rs'
810
- 'tests/**/*.rs'
911
- 'Cargo.toml'
@@ -12,7 +14,6 @@ on:
1214
env:
1315
CARGO_TERM_COLOR: always
1416
CARGO_NET_RETRY: 10
15-
RUSTC_WRAPPER: sccache
1617
RUST_BACKTRACE: 1
1718
RUSTC_PARALLEL_COMPILER: true
1819

@@ -37,35 +38,15 @@ jobs:
3738

3839
steps:
3940
- uses: actions/checkout@v4
40-
with:
41-
submodules: recursive
42-
43-
- name: Install Ubuntu dependencies
44-
if: matrix.os == 'ubuntu-latest'
45-
run: sudo apt-get update && sudo apt-get install -y zlib1g-dev libbz2-dev libexpat1-dev
46-
47-
# Install and setup sccache
48-
- name: Install sccache
49-
uses: mozilla-actions/[email protected]
5041

51-
# Setup Rust toolchain with caching
52-
- name: Setup Rust
53-
uses: actions-rs/toolchain@v1
42+
- name: Install cargo-vcpkg
43+
uses: actions-rs/cargo@v1
5444
with:
55-
profile: minimal
56-
toolchain: stable
45+
command: install
46+
args: cargo-vcpkg
5747

58-
# Cache dependencies and build outputs
59-
- name: Cache cargo registry
60-
uses: actions/cache@v3
61-
with:
62-
path: |
63-
~/.cargo/registry
64-
~/.cargo/git
65-
target
66-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
67-
restore-keys: |
68-
${{ runner.os }}-cargo-
48+
- name: Build vcpkg
49+
run: cargo vcpkg -v build
6950

7051
- name: Run tests
7152
uses: actions-rs/cargo@v1

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"rust-analyzer.checkOnSave": true
3+
}

Cargo.lock

Lines changed: 14 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,37 @@ name = "sbml"
33
version = "0.1.0"
44
edition = "2021"
55

6+
[lib]
7+
name = "sbml"
8+
path = "src/lib.rs"
9+
crate-type = ["staticlib", "rlib"]
10+
611
[dependencies]
712
autocxx = "0.28.0"
813
cxx = "1.0.140"
914
paste = "1.0.15"
1015
quick-xml = { version = "0.37.2", features = ["serialize"] }
1116
serde = { version = "1.0.217", features = ["derive"] }
1217

13-
1418
[build-dependencies]
1519
autocxx-build = "0.28.0"
1620
cmake = "0.1.54"
1721
miette = { version = "5", features = ["fancy"] }
22+
vcpkg = "0.2.15"
1823

1924
[dev-dependencies]
2025
pretty_assertions = "1.4.1"
2126

2227
[lints.clippy]
2328
needless-lifetimes = "allow"
2429
macro-metavars-in-unsafe = "allow"
30+
31+
[package.metadata.vcpkg]
32+
git = "https://github.com/microsoft/vcpkg"
33+
rev = "ce613c41372b23b1f51333815feb3edd87ef8a8b"
34+
dependencies = ["libsbml[core,expat,zlib]"]
35+
36+
[package.metadata.vcpkg.target]
37+
x86_64-pc-windows-msvc = { dependencies = [
38+
"libsbml[core,expat,zlib]",
39+
], triplet = "x64-windows-static-md" }

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,27 @@ Built as an ergonomic wrapper around the `libsbml` C++ library with type-safe Ru
1414

1515
- Type-safe builder pattern API for SBML model creation
1616
- Seamless serialization/deserialization of annotations using `serde`
17-
- Bundled `libsbml` library - no external installation required
18-
- Cross-platform support (macOS and Windows)
17+
- C++ dependency via `cargo-vcpkg`
18+
- Cross-platform support (macOS, Windows, Linux)
1919
- Comprehensive error handling and type safety
2020

2121
## 📦 Installation
2222

2323
Currently available through Git:
2424

2525
```bash
26+
# Install dependencies
27+
cargo install cargo-vcpkg
28+
cargo vcpkg build
29+
30+
# Add the crate to your project
2631
cargo add --git https://github.com/EnzymeML/sbml-rs
2732
```
2833

34+
Please note, the C++ dependency `libsbml` is required to be installed before building the crate. This is done automatically when using the `cargo-vcpkg` tool. You dont need to link the library manually. The dependency is installed in the `target/vcpkg` directory.
35+
2936
### System Requirements
3037

31-
- **CMake**: Required for building the bundled `libsbml` library
3238
- **Rust**: 1.70 or higher (recommended)
3339

3440
### Platform Support
@@ -39,8 +45,6 @@ cargo add --git https://github.com/EnzymeML/sbml-rs
3945
- Windows (x86_64)
4046
- Linux (x86_64)
4147

42-
Please note, due to ongoing development to support platforms, the crate is currently only available as a static library for Windows and Linux. MacOS is available as a dynamic library. We will update this section as we add more support.
43-
4448
## 💡 Usage
4549

4650
The crate follows SBML's hierarchical structure, with all operations flowing through the root `SBMLDocument`. We offer two API styles:

0 commit comments

Comments
 (0)