diff options
author | Robin Krahl <me@robin-krahl.de> | 2018-12-11 23:51:40 +0100 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2018-12-17 07:52:13 -0800 |
commit | 44f6100b36eecf79c1e8484a048ea49cad6e488d (patch) | |
tree | bf16ea9a570f3026324b9882f46b9f8360e7591f /hidapi-sys/build.rs | |
parent | 6737f748b8edb5266c5397591b92da4c88f95dff (diff) | |
download | nitrocli-44f6100b36eecf79c1e8484a048ea49cad6e488d.tar.gz nitrocli-44f6100b36eecf79c1e8484a048ea49cad6e488d.tar.bz2 |
Remove unused dependencies
This patch removes all dependencies that are no longer required since
the hidapi communication is replaced by libnitrokey.
Delete subrepo hid/:hid
Delete subrepo hidapi-sys/:hidapi-sys
Delete subrepo pkg-config/:pkg-config
Diffstat (limited to 'hidapi-sys/build.rs')
-rw-r--r-- | hidapi-sys/build.rs | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/hidapi-sys/build.rs b/hidapi-sys/build.rs deleted file mode 100644 index 4a392c6..0000000 --- a/hidapi-sys/build.rs +++ /dev/null @@ -1,93 +0,0 @@ -extern crate cc; -extern crate pkg_config; - -use std::env; -use std::io; -use std::path::PathBuf; -use std::process::Command; - -fn main() { - if env::var("CARGO_FEATURE_BUILD").is_err() { - return; - } - - fetch().expect("failed to checkout hidapi sources, internet connection and git are needed"); - build().expect("failed to build hidapi sources"); - - println!("cargo:rustc-link-search=native={}", output().to_string_lossy()); -} - -fn output() -> PathBuf { - PathBuf::from(env::var("OUT_DIR").unwrap()) -} - -fn source() -> PathBuf { - if let Ok(path) = env::var("HIDAPI_PATH") { - path.into() - } - else { - output().join("hidapi") - } -} - -fn fetch() -> io::Result<()> { - if env::var("HIDAPI_PATH").is_ok() { - return Ok(()); - } - - Command::new("git") - .current_dir(&output()) - .arg("clone") - .arg("https://github.com/signal11/hidapi.git") - .arg("hidapi") - .status()?; - - Ok(()) -} - -#[cfg(target_os = "linux")] -fn build() -> io::Result<()> { - let mut build = cc::Build::new(); - - build.file(source().join("libusb/hid.c")); - build.include(source().join("hidapi")); - build.static_flag(true); - - for path in pkg_config::find_library("libusb-1.0").unwrap().include_paths { - build.include(path.to_str().unwrap()); - } - - build.compile("libhidapi-libusb.a"); - - Ok(()) -} - -#[cfg(target_os = "macos")] -fn build() -> io::Result<()> { - let mut build = cc::Build::new(); - - build.file(source().join("libusb/hid.c")); - build.include(source().join("hidapi")); - build.static_flag(true); - - for path in pkg_config::find_library("libusb-1.0").unwrap().include_paths { - build.include(path.to_str().unwrap()); - } - - build.compile("libhidapi.a"); - - Ok(()) -} - -#[cfg(target_os = "windows")] -fn build() -> io::Result<()> { - let mut build = cc::Build::new(); - - build.file(source().join("windows/hid.c")); - build.include(source().join("hidapi")); - build.static_flag(true); - - build.compile("libhidapi.a"); - - Ok(()) -} |