|
|
|
@ -1,19 +1,19 @@
|
|
|
|
|
From 1d8cd791f014ff2a3e043730eaaaf3b7c5be114f Mon Sep 17 00:00:00 2001
|
|
|
|
|
From 7d6c389b4f3330696e737110bbb9f7c38101da55 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: Fabio Valentini <decathorpe@gmail.com>
|
|
|
|
|
Date: Sat, 29 Jul 2023 16:48:39 +0200
|
|
|
|
|
Date: Wed, 10 Jan 2024 17:12:19 +0100
|
|
|
|
|
Subject: [PATCH] unconditionally use pkg-config to link with system zlib
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
build.rs | 188 ++-------------------------------------------------
|
|
|
|
|
build.rs | 197 ++-------------------------------------------------
|
|
|
|
|
build_zng.rs | 60 ----------------
|
|
|
|
|
2 files changed, 5 insertions(+), 243 deletions(-)
|
|
|
|
|
2 files changed, 4 insertions(+), 253 deletions(-)
|
|
|
|
|
delete mode 100644 build_zng.rs
|
|
|
|
|
|
|
|
|
|
diff --git a/build.rs b/build.rs
|
|
|
|
|
index 51ebe6b..8d1acf7 100644
|
|
|
|
|
index 1368a12..8d1acf7 100644
|
|
|
|
|
--- a/build.rs
|
|
|
|
|
+++ b/build.rs
|
|
|
|
|
@@ -1,187 +1,9 @@
|
|
|
|
|
@@ -1,198 +1,9 @@
|
|
|
|
|
-use std::env;
|
|
|
|
|
-use std::fs;
|
|
|
|
|
-use std::path::PathBuf;
|
|
|
|
@ -111,7 +111,7 @@ index 51ebe6b..8d1acf7 100644
|
|
|
|
|
- let lib = dst.join("lib");
|
|
|
|
|
-
|
|
|
|
|
- cfg.warnings(false).out_dir(&lib).include("src/zlib");
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
- cfg.file("src/zlib/adler32.c")
|
|
|
|
|
- .file("src/zlib/compress.c")
|
|
|
|
|
- .file("src/zlib/crc32.c")
|
|
|
|
@ -153,11 +153,26 @@ index 51ebe6b..8d1acf7 100644
|
|
|
|
|
- fs::copy("src/zlib/zconf.h", dst.join("include/zconf.h")).unwrap();
|
|
|
|
|
-
|
|
|
|
|
- fs::create_dir_all(lib.join("pkgconfig")).unwrap();
|
|
|
|
|
- let zlib_h = fs::read_to_string(dst.join("include/zlib.h")).unwrap();
|
|
|
|
|
- let version = zlib_h
|
|
|
|
|
- .lines()
|
|
|
|
|
- .find(|l| l.contains("ZLIB_VERSION"))
|
|
|
|
|
- .unwrap()
|
|
|
|
|
- .split("\"")
|
|
|
|
|
- .nth(1)
|
|
|
|
|
+ pkg_config::Config::new()
|
|
|
|
|
+ .cargo_metadata(true)
|
|
|
|
|
+ .print_system_libs(false)
|
|
|
|
|
+ .probe("zlib")
|
|
|
|
|
.unwrap();
|
|
|
|
|
- fs::write(
|
|
|
|
|
- lib.join("pkgconfig/zlib.pc"),
|
|
|
|
|
- fs::read_to_string("src/zlib/zlib.pc.in")
|
|
|
|
|
- .unwrap()
|
|
|
|
|
- .replace("@prefix@", dst.to_str().unwrap()),
|
|
|
|
|
- .replace("@prefix@", dst.to_str().unwrap())
|
|
|
|
|
- .replace("@includedir@", "${prefix}/include")
|
|
|
|
|
- .replace("@libdir@", "${prefix}/lib")
|
|
|
|
|
- .replace("@VERSION@", version),
|
|
|
|
|
- )
|
|
|
|
|
- .unwrap();
|
|
|
|
|
-
|
|
|
|
@ -198,13 +213,8 @@ index 51ebe6b..8d1acf7 100644
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- false
|
|
|
|
|
+ pkg_config::Config::new()
|
|
|
|
|
+ .cargo_metadata(true)
|
|
|
|
|
+ .print_system_libs(false)
|
|
|
|
|
+ .probe("zlib")
|
|
|
|
|
+ .unwrap();
|
|
|
|
|
}
|
|
|
|
|
diff --git a/build_zng.rs b/build_zng.rs
|
|
|
|
|
deleted file mode 100644
|
|
|
|
@ -273,5 +283,5 @@ index 2557625..0000000
|
|
|
|
|
- build_zlib_ng(&target, false);
|
|
|
|
|
-}
|
|
|
|
|
--
|
|
|
|
|
2.41.0
|
|
|
|
|
2.43.0
|
|
|
|
|
|
|
|
|
|