aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2020-08-11 21:38:03 +0900
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>2020-08-17 14:54:04 +0900
commit0ee644ea985bcba22c5e59934639d8fac231cd84 (patch)
tree7cfd7df6d2564f5acad7593cf7baafce930c613b
parent635892f76c6bf6204306abf0c8110fd9963d9e42 (diff)
downloadhinawa-rs-0ee644ea985bcba22c5e59934639d8fac231cd84.tar.gz
hinawa-sys/hinawa: regenerate crates by the latest gir code generator
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-rw-r--r--hinawa-sys/Cargo.toml2
-rw-r--r--hinawa-sys/build.rs69
-rw-r--r--hinawa-sys/versions.txt2
-rw-r--r--hinawa/src/auto/versions.txt2
4 files changed, 6 insertions, 69 deletions
diff --git a/hinawa-sys/Cargo.toml b/hinawa-sys/Cargo.toml
index b4b8275..8aab8c1 100644
--- a/hinawa-sys/Cargo.toml
+++ b/hinawa-sys/Cargo.toml
@@ -28,7 +28,7 @@ pkg-config = "0.3.7"
system-deps = "1.3"
[dev-dependencies]
-shell-words = "0.1.0"
+shell-words = "1.0.0"
tempfile = "3"
[features]
diff --git a/hinawa-sys/build.rs b/hinawa-sys/build.rs
index b21572a..f4c4e7c 100644
--- a/hinawa-sys/build.rs
+++ b/hinawa-sys/build.rs
@@ -3,17 +3,9 @@
// DO NOT EDIT
#[cfg(not(feature = "dox"))]
-extern crate pkg_config;
+extern crate system_deps;
#[cfg(not(feature = "dox"))]
-use pkg_config::{Config, Error};
-#[cfg(not(feature = "dox"))]
-use std::env;
-#[cfg(not(feature = "dox"))]
-use std::io::prelude::*;
-#[cfg(not(feature = "dox"))]
-use std::io;
-#[cfg(not(feature = "dox"))]
use std::process;
#[cfg(feature = "dox")]
@@ -21,63 +13,8 @@ fn main() {} // prevent linking libraries to avoid documentation failure
#[cfg(not(feature = "dox"))]
fn main() {
- if let Err(s) = find() {
- let _ = writeln!(io::stderr(), "{}", s);
+ if let Err(s) = system_deps::Config::new().probe() {
+ let _ = eprintln!("{}", s);
process::exit(1);
}
}
-
-#[cfg(not(feature = "dox"))]
-fn find() -> Result<(), Error> {
- let package_name = "hinawa";
- let shared_libs = ["hinawa"];
- let version = {
- "2.0"
- };
-
- if let Ok(inc_dir) = env::var("GTK_INCLUDE_DIR") {
- println!("cargo:include={}", inc_dir);
- }
- if let Ok(lib_dir) = env::var("GTK_LIB_DIR") {
- for lib_ in shared_libs.iter() {
- println!("cargo:rustc-link-lib=dylib={}", lib_);
- }
- println!("cargo:rustc-link-search=native={}", lib_dir);
- return Ok(())
- }
-
- let target = env::var("TARGET").expect("TARGET environment variable doesn't exist");
- let hardcode_shared_libs = target.contains("windows");
-
- let mut config = Config::new();
- config.atleast_version(version);
- config.print_system_libs(false);
- if hardcode_shared_libs {
- config.cargo_metadata(false);
- }
- match config.probe(package_name) {
- Ok(library) => {
- if let Ok(paths) = std::env::join_paths(library.include_paths) {
- println!("cargo:include={}", paths.to_string_lossy());
- }
- if hardcode_shared_libs {
- for lib_ in shared_libs.iter() {
- println!("cargo:rustc-link-lib=dylib={}", lib_);
- }
- for path in library.link_paths.iter() {
- println!("cargo:rustc-link-search=native={}",
- path.to_str().expect("library path doesn't exist"));
- }
- }
- Ok(())
- }
- Err(Error::EnvNoPkgConfig(_)) | Err(Error::Command { .. }) => {
- for lib_ in shared_libs.iter() {
- println!("cargo:rustc-link-lib=dylib={}", lib_);
- }
- Ok(())
- }
- Err(err) => Err(err),
- }
-}
-
diff --git a/hinawa-sys/versions.txt b/hinawa-sys/versions.txt
index 0909d96..60d5c74 100644
--- a/hinawa-sys/versions.txt
+++ b/hinawa-sys/versions.txt
@@ -1,2 +1,2 @@
-Generated by gir (https://github.com/gtk-rs/gir @ 57dbee3)
+Generated by gir (https://github.com/gtk-rs/gir @ a6737c7)
from gir-files (https://github.com/gtk-rs/gir-files @ c31e734)
diff --git a/hinawa/src/auto/versions.txt b/hinawa/src/auto/versions.txt
index 0909d96..60d5c74 100644
--- a/hinawa/src/auto/versions.txt
+++ b/hinawa/src/auto/versions.txt
@@ -1,2 +1,2 @@
-Generated by gir (https://github.com/gtk-rs/gir @ 57dbee3)
+Generated by gir (https://github.com/gtk-rs/gir @ a6737c7)
from gir-files (https://github.com/gtk-rs/gir-files @ c31e734)