0 | |
--- a/src/lib.rs
|
1 | |
+++ b/src/lib.rs
|
|
0 |
Index: pkg-config/src/lib.rs
|
|
1 |
===================================================================
|
|
2 |
--- pkg-config.orig/src/lib.rs
|
|
3 |
+++ pkg-config/src/lib.rs
|
2 | 4 |
@@ -12,13 +12,6 @@
|
3 | 5 |
//! * `FOO_NO_PKG_CONFIG` - if set, this will disable running `pkg-config` when
|
4 | 6 |
//! probing for the library named `foo`.
|
|
13 | 15 |
//! There are also a number of environment variables which can configure how a
|
14 | 16 |
//! library is linked to (dynamically vs statically). These variables control
|
15 | 17 |
//! whether the `--static` flag is passed. Note that this behavior can be
|
16 | |
@@ -110,11 +103,8 @@
|
|
18 |
@@ -111,11 +104,8 @@ pub enum Error {
|
17 | 19 |
/// Contains the name of the responsible environment variable.
|
18 | 20 |
EnvNoPkgConfig(String),
|
19 | 21 |
|
|
27 | 29 |
CrossCompilation,
|
28 | 30 |
|
29 | 31 |
/// Failed to run `pkg-config`.
|
30 | |
@@ -145,14 +135,6 @@
|
|
32 |
@@ -155,14 +145,6 @@ impl fmt::Display for Error {
|
31 | 33 |
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
32 | 34 |
match *self {
|
33 | 35 |
Error::EnvNoPkgConfig(ref name) => write!(f, "Aborted because {} is set", name),
|
|
42 | 44 |
Error::Command {
|
43 | 45 |
ref command,
|
44 | 46 |
ref cause,
|
45 | |
@@ -205,7 +187,7 @@
|
46 | |
}
|
47 | |
Ok(())
|
|
47 |
@@ -219,7 +201,7 @@ impl fmt::Display for Error {
|
|
48 |
)?;
|
|
49 |
format_output(output, f)
|
48 | 50 |
}
|
49 | 51 |
- Error::__Nonexhaustive => panic!(),
|
50 | 52 |
+ Error::CrossCompilation | Error::__Nonexhaustive => panic!(),
|
51 | 53 |
}
|
52 | 54 |
}
|
53 | 55 |
}
|
54 | |
@@ -371,6 +353,8 @@
|
|
56 |
@@ -411,6 +393,8 @@ impl Config {
|
55 | 57 |
if host == target {
|
56 | 58 |
return true;
|
57 | 59 |
}
|
|
60 | 62 |
|
61 | 63 |
// pkg-config may not be aware of cross-compilation, and require
|
62 | 64 |
// a wrapper script that sets up platform-specific prefixes.
|
63 | |
--- a/tests/test.rs
|
64 | |
+++ b/tests/test.rs
|
65 | |
@@ -34,7 +34,6 @@
|
|
65 |
Index: pkg-config/tests/test.rs
|
|
66 |
===================================================================
|
|
67 |
--- pkg-config.orig/tests/test.rs
|
|
68 |
+++ pkg-config/tests/test.rs
|
|
69 |
@@ -34,7 +34,6 @@ fn find(name: &str) -> Result<pkg_config
|
66 | 70 |
pkg_config::probe_library(name)
|
67 | 71 |
}
|
68 | 72 |
|
|
70 | 74 |
fn cross_disabled() {
|
71 | 75 |
let _g = LOCK.lock();
|
72 | 76 |
reset();
|
73 | |
@@ -46,7 +45,6 @@
|
|
77 |
@@ -46,7 +45,6 @@ fn cross_disabled() {
|
74 | 78 |
}
|
75 | 79 |
}
|
76 | 80 |
|
|
78 | 82 |
fn cross_enabled() {
|
79 | 83 |
let _g = LOCK.lock();
|
80 | 84 |
reset();
|
81 | |
@@ -66,7 +64,6 @@
|
|
85 |
@@ -66,7 +64,6 @@ fn cross_enabled_if_customized() {
|
82 | 86 |
find("foo").unwrap();
|
83 | 87 |
}
|
84 | 88 |
|
|
86 | 90 |
fn cross_disabled_if_customized() {
|
87 | 91 |
let _g = LOCK.lock();
|
88 | 92 |
reset();
|
89 | |
@@ -74,10 +71,10 @@
|
|
93 |
@@ -74,10 +71,10 @@ fn cross_disabled_if_customized() {
|
90 | 94 |
env::set_var("HOST", "bar");
|
91 | 95 |
env::set_var("PKG_CONFIG_ALLOW_CROSS", "0");
|
92 | 96 |
env::set_var("PKG_CONFIG_SYSROOT_DIR", "/tmp/cross-test");
|