Simplify the cargo-c usage and generate the library as libpathfinder

This commit is contained in:
Luca Barbato 2020-07-20 18:22:15 +02:00
parent 448ede2b1f
commit 03017e9a23
3 changed files with 5 additions and 58 deletions

50
Cargo.lock generated
View File

@ -366,23 +366,6 @@ dependencies = [
"web-sys", "web-sys",
] ]
[[package]]
name = "cbindgen"
version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2db2df1ebc842c41fd2c4ae5b5a577faf63bd5151b953db752fc686812bee318"
dependencies = [
"clap",
"log",
"proc-macro2 1.0.18",
"quote 1.0.7",
"serde",
"serde_json",
"syn 1.0.33",
"tempfile",
"toml",
]
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.0.57" version = "1.0.57"
@ -2029,7 +2012,6 @@ dependencies = [
name = "pathfinder_c" name = "pathfinder_c"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"cbindgen",
"core-foundation 0.6.4", "core-foundation 0.6.4",
"font-kit", "font-kit",
"foreign-types", "foreign-types",
@ -2601,15 +2583,6 @@ version = "0.6.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8"
[[package]]
name = "remove_dir_all"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
dependencies = [
"winapi 0.3.9",
]
[[package]] [[package]]
name = "roxmltree" name = "roxmltree"
version = "0.11.0" version = "0.11.0"
@ -3060,20 +3033,6 @@ dependencies = [
"unicode-xid 0.2.1", "unicode-xid 0.2.1",
] ]
[[package]]
name = "tempfile"
version = "3.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9"
dependencies = [
"cfg-if",
"libc 0.2.71",
"rand",
"redox_syscall",
"remove_dir_all",
"winapi 0.3.9",
]
[[package]] [[package]]
name = "termcolor" name = "termcolor"
version = "1.1.0" version = "1.1.0"
@ -3134,15 +3093,6 @@ version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed" checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed"
[[package]]
name = "toml"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a"
dependencies = [
"serde",
]
[[package]] [[package]]
name = "ttf-parser" name = "ttf-parser"
version = "0.6.2" version = "0.6.2"

View File

@ -93,14 +93,13 @@ fixes.
The C bindings use [cargo-c](https://github.com/lu-zero/cargo-c). Install `cargo-c` with The C bindings use [cargo-c](https://github.com/lu-zero/cargo-c). Install `cargo-c` with
`cargo install cargo-c`, and then use a command like: `cargo install cargo-c`, and then use a command like:
$ cd c $ cargo cinstall --destdir=/tmp/pathfinder-destdir --manifest-path c/Cargo.toml
$ cargo cbuild --prefix=/usr/local $ sudo cp -a /tmp/pathfinder-destdir/* /
$ cargo cinstall --prefix=/usr/local
The resulting library is usable via `pkg-config` as `pathfinder_c`. For examples of use, see the The resulting library is usable via `pkg-config` as `pathfinder`. For examples of use, see the
examples in the `examples/` directory beginning with `c_`. examples in the `examples/` directory beginning with `c_`.
`cargo-c` has a variety of other options such as `--destdir`, which may be useful for packagers. `cargo-c` has a variety of other options such as `--prefix`, which may be useful for packagers.
## Community ## Community

View File

@ -6,6 +6,7 @@ edition = "2018"
[lib] [lib]
crate-type = ["staticlib"] crate-type = ["staticlib"]
name = "pathfinder"
[dependencies] [dependencies]
font-kit = "0.6" font-kit = "0.6"
@ -52,6 +53,3 @@ metal = "0.18"
[target.'cfg(target_os = "macos")'.dependencies.pathfinder_metal] [target.'cfg(target_os = "macos")'.dependencies.pathfinder_metal]
path = "../metal" path = "../metal"
[build-dependencies]
cbindgen = "0.13"