You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-5Lines changed: 34 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,29 @@
6
6
7
7
Rust FFI bindings to [libversion](https://github.com/repology/libversion), an advanced version string comparison library.
8
8
9
-
The C source is included and compiled from source via CMake -- no system-level installation of libversion is required.
9
+
By default the crate vendors the C source and builds it directly, so no system-level installation of libversion is required. If you prefer linking an installed system copy, disable default features and make sure `pkg-config` can find `libversion`.
10
10
11
11
## Usage
12
12
13
13
Add to `Cargo.toml`:
14
14
15
15
```toml
16
16
[dependencies]
17
-
libversion-sys = "0.1"
17
+
libversion-sys = "0.2"
18
+
```
19
+
20
+
Use the default vendored build:
21
+
22
+
```toml
23
+
[dependencies]
24
+
libversion-sys = "0.2"
25
+
```
26
+
27
+
Or link a system-installed `libversion`:
28
+
29
+
```toml
30
+
[dependencies]
31
+
libversion-sys = { version = "0.2", default-features = false }
18
32
```
19
33
20
34
### Safe API
@@ -46,6 +60,13 @@ let result = unsafe { ffi::version_compare2(v1.as_ptr(), v2.as_ptr()) };
- C compiler (gcc/clang) for the default vendored build
63
83
- libclang (for bindgen)
84
+
-`pkg-config` and a system `libversion` installation when building with `default-features = false`
64
85
65
86
On Ubuntu/Debian:
66
87
67
88
```sh
68
-
sudo apt-get install cmake libclang-dev
89
+
sudo apt-get install libclang-dev
69
90
```
70
91
92
+
For system linking:
93
+
94
+
```sh
95
+
sudo apt-get install pkg-config libversion-dev
96
+
```
97
+
98
+
`cmake` is only needed by maintainers when regenerating `generated/libversion/config.h` and `generated/libversion/export.h` after updating the vendored libversion source.
0 commit comments