[librsvg: 25/53] Add check for pangoft2 to be used in the tests crate




commit 9688fc59fe1d7afedff4a19da310642668672ece
Author: Sven Neumann <sven svenfoo org>
Date:   Thu Oct 15 17:53:51 2020 +0200

    Add check for pangoft2 to be used in the tests crate

 Cargo.lock       |  1 +
 tests/Cargo.toml |  6 +++++-
 tests/build.rs   | 11 +++++++++++
 3 files changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/Cargo.lock b/Cargo.lock
index fe05794d..cf7c52c7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -786,6 +786,7 @@ dependencies = [
  "float-cmp",
  "librsvg",
  "lopdf",
+ "pkg-config",
  "png",
  "predicates",
  "rsvg_internals",
diff --git a/tests/Cargo.toml b/tests/Cargo.toml
index 256c13f7..9ebc557c 100644
--- a/tests/Cargo.toml
+++ b/tests/Cargo.toml
@@ -1,8 +1,9 @@
 [package]
 name = "librsvg-tests"
 version = "0.1.0"
-authors = ["Sven Neumann <sven svenfoo org>"]
+authors = ["Federico Mena Quintero <federico gnome org>", "Sven Neumann <sven svenfoo org>"]
 workspace = ".."
+build = "build.rs"
 edition = "2018"
 
 [dev-dependencies]
@@ -18,3 +19,6 @@ predicates = "1.0.2"
 rsvg_internals = { path = "../rsvg_internals" }
 tempfile = "3"
 test-generator = "0.3"
+
+[build-dependencies]
+pkg-config = "0.3.14"
diff --git a/tests/build.rs b/tests/build.rs
new file mode 100644
index 00000000..c19c5c30
--- /dev/null
+++ b/tests/build.rs
@@ -0,0 +1,11 @@
+use pkg_config;
+
+fn main() {
+    check_for_pangoft2();
+}
+
+fn check_for_pangoft2() {
+    if pkg_config::Config::new().atleast_version("1.38").probe("pangoft2").is_ok() {
+        println!("cargo:rustc-cfg=have_pangoft2");
+    }
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]