Update to version 1.1.20; Fixes RHBZ#2283120

epel10 imports/epel10/rust-libz-sys-1.1.20-1.el10
Fabio Valentini 5 months ago
parent 1a0f1a3be6
commit fba6121354
No known key found for this signature in database
GPG Key ID: 5AC5F572E5D410AF

1
.gitignore vendored

@ -14,3 +14,4 @@
/libz-sys-1.1.12.crate
/libz-sys-1.1.14.crate
/libz-sys-1.1.16.crate
/libz-sys-1.1.20.crate

@ -1,19 +1,17 @@
From b2c370ea75648dd768ed3605430e45b9c841267e Mon Sep 17 00:00:00 2001
From 3660391791ccadf584bcbfd0b9238fca13e52522 Mon Sep 17 00:00:00 2001
From: Fabio Valentini <decathorpe@gmail.com>
Date: Fri, 17 May 2024 21:30:52 +0200
Date: Wed, 25 Sep 2024 17:10:14 +0200
Subject: [PATCH] unconditionally use pkg-config to link with system zlib
---
build.rs | 209 +--------------------------------------------------
build_zng.rs | 60 ---------------
2 files changed, 4 insertions(+), 265 deletions(-)
delete mode 100644 build_zng.rs
build.rs | 243 +------------------------------------------------------
1 file changed, 4 insertions(+), 239 deletions(-)
diff --git a/build.rs b/build.rs
index e00ae65..8d1acf7 100644
index cab160a..8d1acf7 100644
--- a/build.rs
+++ b/build.rs
@@ -1,210 +1,9 @@
@@ -1,244 +1,9 @@
-use std::env;
-use std::fs;
-use std::path::PathBuf;
@ -21,17 +19,31 @@ index e00ae65..8d1acf7 100644
fn main() {
- println!("cargo:rerun-if-env-changed=LIBZ_SYS_STATIC");
println!("cargo:rerun-if-changed=build.rs");
- println!("cargo:rerun-if-changed=zng/cmake.rs");
- println!("cargo:rerun-if-changed=zng/cc.rs");
-
- let host = env::var("HOST").unwrap();
- let target = env::var("TARGET").unwrap();
-
- let host_and_target_contain = |s| host.contains(s) && target.contains(s);
-
- let want_ng = cfg!(feature = "zlib-ng") && !cfg!(feature = "stock-zlib");
- let want_ng = cfg!(any(
- feature = "zlib-ng",
- feature = "zlib-ng-no-cmake-experimental-community-maintained"
- )) && !cfg!(feature = "stock-zlib");
-
- if want_ng && target != "wasm32-unknown-unknown" {
- return build_zlib_ng(&target, true);
- }
-
- // All android compilers should come with libz by default, so let's just use
- // the one already there. Likewise, Haiku always ships with libz, so we can
- // link to it even when cross-compiling.
- if target.contains("android") || target.contains("haiku") {
- println!("cargo:rustc-link-lib=z");
- return;
- }
-
- // Don't run pkg-config if we're linking statically (we'll build below) and
- // also don't run pkg-config on FreeBSD/DragonFly. That'll end up printing
- // `-L /usr/lib` which wreaks havoc with linking to an OpenSSL in /usr/local/lib
@ -73,14 +85,6 @@ index e00ae65..8d1acf7 100644
- }
- }
-
- // All android compilers should come with libz by default, so let's just use
- // the one already there. Likewise, Haiku always ships with libz, so we can
- // link to it even when cross-compiling.
- if target.contains("android") || target.contains("haiku") {
- println!("cargo:rustc-link-lib=z");
- return;
- }
-
- let mut cfg = cc::Build::new();
-
- // Situations where we build unconditionally.
@ -119,7 +123,7 @@ index e00ae65..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")
@ -131,7 +135,7 @@ index e00ae65..8d1acf7 100644
- .file("src/zlib/trees.c")
- .file("src/zlib/uncompr.c")
- .file("src/zlib/zutil.c");
-
- if !cfg!(feature = "libc") || target.starts_with("wasm32") {
- cfg.define("Z_SOLO", None);
- } else {
@ -189,13 +193,31 @@ index e00ae65..8d1acf7 100644
- println!("cargo:include={}/include", dst.to_str().unwrap());
-}
-
-#[cfg(not(feature = "zlib-ng"))]
-fn build_zlib_ng(_target: &str, _compat: bool) {}
-
-#[cfg(feature = "zlib-ng")]
-#[cfg(any(
- feature = "zlib-ng",
- feature = "zlib-ng-no-cmake-experimental-community-maintained"
-))]
-mod zng {
- #[cfg_attr(feature = "zlib-ng", path = "cmake.rs")]
- #[cfg_attr(
- all(
- feature = "zlib-ng-no-cmake-experimental-community-maintained",
- not(feature = "zlib-ng")
- ),
- path = "cc.rs"
- )]
- mod build_zng;
-#[cfg(feature = "zlib-ng")]
-use build_zng::build_zlib_ng;
-
- pub(super) use build_zng::build_zlib_ng;
-}
-
-fn build_zlib_ng(_target: &str, _compat: bool) {
- #[cfg(any(
- feature = "zlib-ng",
- feature = "zlib-ng-no-cmake-experimental-community-maintained"
- ))]
- zng::build_zlib_ng(_target, _compat);
-}
-
-fn try_vcpkg() -> bool {
- // see if there is a vcpkg tree with zlib installed
@ -203,7 +225,17 @@ index e00ae65..8d1acf7 100644
- .emit_includes(true)
- .find_package("zlib")
- {
- Ok(_) => true,
- Ok(zlib) => {
- if !zlib.include_paths.is_empty() {
- let paths = zlib
- .include_paths
- .iter()
- .map(|s| s.display().to_string())
- .collect::<Vec<_>>();
- println!("cargo:include={}", paths.join(","));
- }
- true
- }
- Err(e) => {
- println!("note, vcpkg did not find zlib: {}", e);
- false
@ -228,72 +260,6 @@ index e00ae65..8d1acf7 100644
-
- false
}
diff --git a/build_zng.rs b/build_zng.rs
deleted file mode 100644
index 2557625..0000000
--- a/build_zng.rs
+++ /dev/null
@@ -1,60 +0,0 @@
-use std::env;
-
-pub fn build_zlib_ng(target: &str, compat: bool) {
- let mut cmake = cmake::Config::new("src/zlib-ng");
- cmake
- .define("BUILD_SHARED_LIBS", "OFF")
- .define("ZLIB_COMPAT", if compat { "ON" } else { "OFF" })
- .define("ZLIB_ENABLE_TESTS", "OFF")
- .define("WITH_GZFILEOP", "ON");
- if target.contains("s390x") {
- // Enable hardware compression on s390x.
- cmake
- .define("WITH_DFLTCC_DEFLATE", "1")
- .define("WITH_DFLTCC_INFLATE", "1")
- .cflag("-DDFLTCC_LEVEL_MASK=0x7e");
- }
- if target == "i686-pc-windows-msvc" {
- cmake.define("CMAKE_GENERATOR_PLATFORM", "Win32");
- }
-
- let install_dir = cmake.build();
-
- let includedir = install_dir.join("include");
- let libdir = install_dir.join("lib");
- let libdir64 = install_dir.join("lib64");
- println!(
- "cargo:rustc-link-search=native={}",
- libdir.to_str().unwrap()
- );
- println!(
- "cargo:rustc-link-search=native={}",
- libdir64.to_str().unwrap()
- );
- let mut debug_suffix = "";
- let libname = if target.contains("windows") && target.contains("msvc") {
- if env::var("OPT_LEVEL").unwrap() == "0" {
- debug_suffix = "d";
- }
- "zlibstatic"
- } else {
- "z"
- };
- println!(
- "cargo:rustc-link-lib=static={}{}{}",
- libname,
- if compat { "" } else { "-ng" },
- debug_suffix,
- );
- println!("cargo:root={}", install_dir.to_str().unwrap());
- println!("cargo:include={}", includedir.to_str().unwrap());
- if !compat {
- println!("cargo:rustc-cfg=zng");
- }
-}
-
-#[allow(dead_code)]
-fn main() {
- let target = env::var("TARGET").unwrap();
- build_zlib_ng(&target, false);
-}
--
2.45.1
2.46.2

@ -1,18 +1,18 @@
--- libz-sys-1.1.16/Cargo.toml 1970-01-01T00:00:01+00:00
+++ libz-sys-1.1.16/Cargo.toml 2024-05-17T19:32:28.270127+00:00
@@ -47,25 +47,12 @@
--- libz-sys-1.1.20/Cargo.toml 1970-01-01T00:00:01+00:00
+++ libz-sys-1.1.20/Cargo.toml 2024-09-25T15:05:48.025207+00:00
@@ -72,29 +72,15 @@
[build-dependencies.cc]
version = "1.0.18"
version = "1.0.98"
-[build-dependencies.cmake]
-version = "0.1.44"
-version = "0.1.50"
-optional = true
-
[build-dependencies.pkg-config]
version = "0.3.9"
-[build-dependencies.vcpkg]
-version = "0.2"
-version = "0.2.11"
-
[features]
-asm = []
@ -26,3 +26,7 @@
- "libc",
- "cmake",
-]
-zlib-ng-no-cmake-experimental-community-maintained = ["libc"]
[lints.rust.unexpected_cfgs]
level = "warn"

@ -5,7 +5,7 @@
%global crate libz-sys
Name: rust-libz-sys
Version: 1.1.16
Version: 1.1.20
Release: %autorelease
Summary: Low-level bindings to the system libz library (also known as zlib)

@ -1 +1 @@
SHA512 (libz-sys-1.1.16.crate) = 1d6b65b5a5293d470cf8ed48293a6f8273828a0cdf096d286e777d438b2c4d076360b5492ee3c2c83b27605d51389e6a3eda7eaebfb09a6041a877a48540aef1
SHA512 (libz-sys-1.1.20.crate) = 9b537e7c01553e782be145223c6d174601ade3a950bfd0eb4ea09658da5b8910cf0d0c5984672f9d198f73d5aa63d21e0c20c4c44ff7d0a017ee11ae4ecf4859

Loading…
Cancel
Save