From 3da514073587eea788fb7f538df5caa53661347e Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Sun, 22 Dec 2019 12:12:27 -0600 Subject: [PATCH] Switch to a workspace. --- Cargo.toml | 14 ++++------- speech-dispatcher-sys/Cargo.toml | 11 +++++++++ speech-dispatcher-sys/build.rs | 23 +++++++++++++++++++ speech-dispatcher-sys/src/lib.rs | 7 ++++++ speech-dispatcher-sys/wrapper.h | 2 ++ speech-dispatcher/Cargo.toml | 10 ++++++++ .../examples}/hello_world.rs | 0 {src => speech-dispatcher/src}/lib.rs | 0 speech-dispatcher/wrapper.h | 2 ++ 9 files changed, 60 insertions(+), 9 deletions(-) create mode 100644 speech-dispatcher-sys/Cargo.toml create mode 100644 speech-dispatcher-sys/build.rs create mode 100644 speech-dispatcher-sys/src/lib.rs create mode 100644 speech-dispatcher-sys/wrapper.h create mode 100644 speech-dispatcher/Cargo.toml rename {examples => speech-dispatcher/examples}/hello_world.rs (100%) rename {src => speech-dispatcher/src}/lib.rs (100%) create mode 100644 speech-dispatcher/wrapper.h diff --git a/Cargo.toml b/Cargo.toml index 41d0d36..c8bf9ef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,6 @@ -[package] -name = "speech-dispatcher" -version = "0.3.2" -authors = ["Nolan Darilek "] -repository = "https://gitlab.com/ndarilek/speech-dispatcher-rs" -description = "Rusty interface to the speech-dispatcher speech synthesis library" -license = "LGPL-2.1" +[workspace] -[dependencies] -speech-dispatcher-sys = "0.3" +members = [ + "speech-dispatcher-sys", + "speech-dispatcher" +] diff --git a/speech-dispatcher-sys/Cargo.toml b/speech-dispatcher-sys/Cargo.toml new file mode 100644 index 0000000..258cb3a --- /dev/null +++ b/speech-dispatcher-sys/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "speech-dispatcher-sys" +version = "0.4.0" +authors = ["Nolan Darilek "] +repository = "https://gitlab.com/ndarilek/speech-dispatcher-sys" +description = "speech-dispatcher system bindings" +license = "LGPL-2.1" + +[build-dependencies] +bindgen = "0.51" +gcc = "0.3" diff --git a/speech-dispatcher-sys/build.rs b/speech-dispatcher-sys/build.rs new file mode 100644 index 0000000..49b95cb --- /dev/null +++ b/speech-dispatcher-sys/build.rs @@ -0,0 +1,23 @@ +extern crate bindgen; + +use std::env; +use std::path::Path; + +fn main() { + println!("cargo:rustc-link-lib=speechd"); + let out_dir = env::var("OUT_DIR").unwrap(); + let _ = bindgen::builder() + .header("wrapper.h") + .constified_enum_module("SPDConnectionMode") + .constified_enum_module("SPDPriority") + .constified_enum_module("SPDVoiceType") + .constified_enum_module("SPDDataMode") + .constified_enum_module("SPDNotification") + .constified_enum_module("SPDPunctuation") + .constified_enum_module("SPDCapitalLetters") + .constified_enum_module("SPDSpelling") + .use_core() + .layout_tests(false) + .generate().unwrap() + .write_to_file(Path::new(&out_dir).join("speech_dispatcher_sys.rs")); +} diff --git a/speech-dispatcher-sys/src/lib.rs b/speech-dispatcher-sys/src/lib.rs new file mode 100644 index 0000000..4f8cfec --- /dev/null +++ b/speech-dispatcher-sys/src/lib.rs @@ -0,0 +1,7 @@ +#![allow(non_upper_case_globals)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] + +extern crate core; + +include!(concat!(env!("OUT_DIR"), "/speech_dispatcher_sys.rs")); diff --git a/speech-dispatcher-sys/wrapper.h b/speech-dispatcher-sys/wrapper.h new file mode 100644 index 0000000..6052044 --- /dev/null +++ b/speech-dispatcher-sys/wrapper.h @@ -0,0 +1,2 @@ +#include +#include diff --git a/speech-dispatcher/Cargo.toml b/speech-dispatcher/Cargo.toml new file mode 100644 index 0000000..a655c28 --- /dev/null +++ b/speech-dispatcher/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "speech-dispatcher" +version = "0.4.0" +authors = ["Nolan Darilek "] +repository = "https://gitlab.com/ndarilek/speech-dispatcher-rs" +description = "Rusty interface to the speech-dispatcher speech synthesis library" +license = "LGPL-2.1" + +[dependencies] +speech-dispatcher-sys = { path = "../speech-dispatcher-sys" } diff --git a/examples/hello_world.rs b/speech-dispatcher/examples/hello_world.rs similarity index 100% rename from examples/hello_world.rs rename to speech-dispatcher/examples/hello_world.rs diff --git a/src/lib.rs b/speech-dispatcher/src/lib.rs similarity index 100% rename from src/lib.rs rename to speech-dispatcher/src/lib.rs diff --git a/speech-dispatcher/wrapper.h b/speech-dispatcher/wrapper.h new file mode 100644 index 0000000..6052044 --- /dev/null +++ b/speech-dispatcher/wrapper.h @@ -0,0 +1,2 @@ +#include +#include