]> git.proxmox.com Git - cargo.git/blob - vendor/pkg-config/debian/patches/no-special-snowflake-env.patch
New upstream version 0.47.0
[cargo.git] / vendor / pkg-config / debian / patches / no-special-snowflake-env.patch
1 --- a/src/lib.rs
2 +++ b/src/lib.rs
3 @@ -9,8 +9,6 @@
4 //! A number of environment variables are available to globally configure how
5 //! this crate will invoke `pkg-config`:
6 //!
7 -//! * `PKG_CONFIG_ALLOW_CROSS` - if this variable is not set, then `pkg-config`
8 -//! will automatically be disabled for all cross compiles.
9 //! * `FOO_NO_PKG_CONFIG` - if set, this will disable running `pkg-config` when
10 //! probing for the library named `foo`.
11 //!
12 @@ -106,9 +104,8 @@ pub enum Error {
13 /// Contains the name of the responsible environment variable.
14 EnvNoPkgConfig(String),
15
16 - /// Cross compilation detected.
17 - ///
18 - /// Override with `PKG_CONFIG_ALLOW_CROSS=1`.
19 + /// Cross compilation detected. Kept for compatibility;
20 + /// the Debian package never emits this.
21 CrossCompilation,
22
23 /// Failed to run `pkg-config`.
24 @@ -152,11 +145,6 @@ impl fmt::Display for Error {
25 fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
26 match *self {
27 Error::EnvNoPkgConfig(ref name) => write!(f, "Aborted because {} is set", name),
28 - Error::CrossCompilation => write!(
29 - f,
30 - "Cross compilation detected. \
31 - Use PKG_CONFIG_ALLOW_CROSS=1 to override"
32 - ),
33 Error::Command {
34 ref command,
35 ref cause,
36 @@ -180,7 +168,7 @@ impl fmt::Display for Error {
37 }
38 Ok(())
39 }
40 - Error::__Nonexhaustive => panic!(),
41 + Error::CrossCompilation | Error::__Nonexhaustive => panic!(),
42 }
43 }
44 }
45 @@ -341,6 +329,8 @@ impl Config {
46 if host == target {
47 return true;
48 }
49 + // always enable PKG_CONFIG_ALLOW_CROSS override in Debian
50 + return true;
51
52 // pkg-config may not be aware of cross-compilation, and require
53 // a wrapper script that sets up platform-specific prefixes.
54 --- a/tests/test.rs
55 +++ b/tests/test.rs
56 @@ -34,7 +34,6 @@ fn find(name: &str) -> Result<pkg_config
57 pkg_config::probe_library(name)
58 }
59
60 -#[test]
61 fn cross_disabled() {
62 let _g = LOCK.lock();
63 reset();
64 @@ -46,7 +45,6 @@ fn cross_disabled() {
65 }
66 }
67
68 -#[test]
69 fn cross_enabled() {
70 let _g = LOCK.lock();
71 reset();