summaryrefslogtreecommitdiff
path: root/net-libs/quiche/files/quiche-0.11.0-fix-pkg-config-output-path.patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-02-02 01:39:05 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-02-02 01:39:05 +0000
commitfcc5224904648a8e6eb528d7603154160a20022f (patch)
tree3bfce096b38a9cea8eed13fc70c1526c456e9abd /net-libs/quiche/files/quiche-0.11.0-fix-pkg-config-output-path.patch
parent2fd57282f0262ca084e05b0f2c63fbada395d02b (diff)
gentoo resync : 02.02.2022
Diffstat (limited to 'net-libs/quiche/files/quiche-0.11.0-fix-pkg-config-output-path.patch')
-rw-r--r--net-libs/quiche/files/quiche-0.11.0-fix-pkg-config-output-path.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/net-libs/quiche/files/quiche-0.11.0-fix-pkg-config-output-path.patch b/net-libs/quiche/files/quiche-0.11.0-fix-pkg-config-output-path.patch
new file mode 100644
index 000000000000..638d033b50a5
--- /dev/null
+++ b/net-libs/quiche/files/quiche-0.11.0-fix-pkg-config-output-path.patch
@@ -0,0 +1,65 @@
+From d2b14f02fbf6b8420abb4c77870d64df596fc0e9 Mon Sep 17 00:00:00 2001
+From: Alessandro Ghedini <alessandro@ghedini.me>
+Date: Tue, 1 Feb 2022 11:36:54 +0000
+Subject: [PATCH] build: fix pkg-config output path
+
+When building the tarball from crates.io rather than from the git
+repository, the target directory for the pkg-config file doesn't exist.
+
+Note that when explicitly passing the --target option to cargo, this
+changes the output directory from "target/<profile>/quiche.pc" (e.g.
+"target/debug/quiche.pc") to "target/<target>/<profile>/quiche.pc" (e.g.
+"target/x86_64-unknown-linux-gnu/debug).
+
+Fixes #1142.
+---
+ quiche/src/build.rs | 22 ++++++++++++++++++----
+ 1 file changed, 18 insertions(+), 4 deletions(-)
+
+diff --git a/src/build.rs b/src/build.rs
+index ce299cd49..d1ef4f4ee 100644
+--- a/src/build.rs
++++ b/src/build.rs
+@@ -173,11 +173,10 @@ fn get_boringssl_cmake_config() -> cmake::Config {
+ fn write_pkg_config() {
+ use std::io::prelude::*;
+
+- let profile = std::env::var("PROFILE").unwrap();
+ let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
+- let target_dir = format!("{}/../target/{}", manifest_dir, profile);
++ let target_dir = target_dir_path();
+
+- let out_path = std::path::Path::new(&target_dir).join("quiche.pc");
++ let out_path = target_dir.as_path().join("quiche.pc");
+ let mut out_file = std::fs::File::create(&out_path).unwrap();
+
+ let include_dir = format!("{}/include", manifest_dir);
+@@ -196,12 +195,27 @@ Version: {}
+ Libs: -Wl,-rpath,${{libdir}} -L${{libdir}} -lquiche
+ Cflags: -I${{includedir}}
+ ",
+- include_dir, target_dir, version
++ include_dir,
++ target_dir.to_str().unwrap(),
++ version
+ );
+
+ out_file.write_all(output.as_bytes()).unwrap();
+ }
+
++fn target_dir_path() -> std::path::PathBuf {
++ let out_dir = std::env::var("OUT_DIR").unwrap();
++ let out_dir = std::path::Path::new(&out_dir);
++
++ for p in out_dir.ancestors() {
++ if p.ends_with("build") {
++ return p.parent().unwrap().to_path_buf();
++ }
++ }
++
++ unreachable!();
++}
++
+ fn main() {
+ if cfg!(feature = "boringssl-vendored") && !cfg!(feature = "boring-sys") {
+ let bssl_dir = std::env::var("QUICHE_BSSL_PATH").unwrap_or_else(|_| {