Notification time stamped 2023-08-31 21:41:37 UTC
From e18876647da357b0a6e0b6ee966f02a15979e8b2 Mon Sep 17 00:00:00 2001 From: Fabio Valentini decathorpe@gmail.com Date: Aug 31 2023 20:05:49 +0000 Subject: Update to version 0.4.8; Fixes RHBZ#2187760
---
diff --git a/.gitignore b/.gitignore index 33da6d7..990fc63 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /pq-sys-0.4.6.crate /pq-sys-0.4.7.crate +/pq-sys-0.4.8.crate diff --git a/0001-Unconditionally-use-pkg-config-to-link-against-syste.patch b/0001-Unconditionally-use-pkg-config-to-link-against-syste.patch new file mode 100644 index 0000000..54cf32e --- /dev/null +++ b/0001-Unconditionally-use-pkg-config-to-link-against-syste.patch @@ -0,0 +1,216 @@ +From 3b9c72eeb08946147f8a31a12a313ca01b225810 Mon Sep 17 00:00:00 2001 +From: Fabio Valentini decathorpe@gmail.com +Date: Thu, 31 Aug 2023 22:03:55 +0200 +Subject: [PATCH] Unconditionally use pkg-config to link against system libpq + +--- + build.rs | 195 +------------------------------------------------------ + 1 file changed, 1 insertion(+), 194 deletions(-) + +diff --git a/build.rs b/build.rs +index 2640f27..3a146aa 100644 +--- a/build.rs ++++ b/build.rs +@@ -1,198 +1,5 @@ +-#[cfg(feature="pkg-config")] + extern crate pkg_config; + +-#[cfg(target_env = "msvc")] +-extern crate vcpkg; +- +-use std::process::Command; +-use std::env; +-use std::path::PathBuf; +-use std::fmt::{self, Display}; +- +-enum LinkType { +- Static, +- Dynamic +-} +- +-impl Display for LinkType { +- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { +- match *self { +- LinkType::Static => write!(f, "static"), +- LinkType::Dynamic => write!(f, "dylib"), +- } +- } +-} +- +-struct LinkingOptions { +- linking_type: Option<LinkType>, +- lib_name: &'static str, +-} +- +-impl LinkingOptions { +- fn from_name_and_type(lib_name: &'static str, tpe: LinkType) -> Self { +- LinkingOptions { +- linking_type: Some(tpe), +- lib_name +- } +- } +- fn from_name(lib_name: &'static str) -> Self { +- LinkingOptions { +- linking_type: None, +- lib_name +- } +- } +- +- fn from_env() -> Self { +- // On Windows-MSVC, always link dynamically +- if cfg!(all(windows, target_env="msvc")) { +- return LinkingOptions::from_name_and_type("libpq", LinkType::Dynamic); +- } +- +- // Link unconditionally statically +- if env::var_os("PQ_LIB_STATIC").is_some() { +- return LinkingOptions::from_name_and_type("pq", LinkType::Static); +- } +- +- // Examine the per-target env vars +- if let Ok(target) = env::var("TARGET") { +- let pg_config_for_target = format!("PQ_LIB_STATIC_{}", target.to_ascii_uppercase().replace("-", "_")); +- println!("cargo:rerun-if-env-changed={}", pg_config_for_target); +- if env::var_os(&pg_config_for_target).is_some() { +- return LinkingOptions::from_name_and_type("pq", LinkType::Static); +- } +- } +- +- // Otherwise, don't specify +- LinkingOptions::from_name("pq") +- } +-} +- +-impl Display for LinkingOptions { +- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { +- if let Some(ref t) = self.linking_type { +- write!(f, "{}=", t)?; +- } +- write!(f, "{}", self.lib_name) +- } +-} +- + fn main() { +- println!("cargo:rerun-if-env-changed=PQ_LIB_STATIC"); +- println!("cargo:rerun-if-env-changed=TARGET"); +- +- // if target is specified the more concrete pq_lib_dir overwrites a more general one +- let lib_dir = if let Ok(target) = env::var("TARGET") { +- let pq_lib_dir_for_target = format!("PQ_LIB_DIR_{}", target.to_ascii_uppercase().replace("-", "_")); +- check_and_use_lib_dir(&pq_lib_dir_for_target).or_else(|_| check_and_use_lib_dir("PQ_LIB_DIR")) +- } +- else{ +- check_and_use_lib_dir("PQ_LIB_DIR") +- }; +- +- if let Ok(lib_dir) = lib_dir { +- println!("cargo:rustc-link-search=native={}", lib_dir); +- } else if configured_by_pkg_config() { +- return // pkg_config does everything for us, including output for cargo +- } else if configured_by_vcpkg() { +- return // vcpkg does everything for us, including output for cargo +- } else if let Some(path) = pg_config_output("--libdir") { +- let path = replace_homebrew_path_on_mac(path); +- println!("cargo:rustc-link-search=native={}", path); +- } +- println!("cargo:rustc-link-lib={}", LinkingOptions::from_env()); +-} +- +-#[cfg(feature = "pkg-config")] +-fn configured_by_pkg_config() -> bool { +- pkg_config::probe_library("libpq").is_ok() +-} +- +-#[cfg(not(feature = "pkg-config"))] +-fn configured_by_pkg_config() -> bool { +- false +-} +- +-#[cfg(target_env = "msvc")] +-fn configured_by_vcpkg() -> bool { +- vcpkg::find_package("libpq").map(|_| { +- println!("cargo:rustc-link-lib=crypt32"); +- println!("cargo:rustc-link-lib=gdi32"); +- println!("cargo:rustc-link-lib=user32"); +- println!("cargo:rustc-link-lib=secur32"); +- println!("cargo:rustc-link-lib=shell32"); +- println!("cargo:rustc-link-lib=wldap32"); +- }).is_ok() +-} +- +-#[cfg(not(target_env = "msvc"))] +-fn configured_by_vcpkg() -> bool { +- false +-} +- +-fn check_and_use_lib_dir(var_name: &str) -> Result<String, env::VarError>{ +- println!("cargo:rerun-if-env-changed={:?}", var_name); +- println!("{:?} = {:?}", var_name , env::var(var_name)); +- +- let pq_lib_dir = env::var(var_name); +- if let Ok(pg_lib_path) = pq_lib_dir.clone() { +- let path = PathBuf::from(&pg_lib_path); +- if !path.exists() { +- panic!("Folder {:?} doesn't exist in the configured path: {:?}", var_name, path); +- } +- } +- pq_lib_dir +-} +- +-fn pg_config_path() -> PathBuf { +- if let Ok(target) = env::var("TARGET") { +- let pg_config_for_target = &format!("PG_CONFIG_{}", target.to_ascii_uppercase().replace("-", "_")); +- println!("cargo:rerun-if-env-changed={}", pg_config_for_target); +- if let Some(pg_config_path) = env::var_os(pg_config_for_target) { +- +- let path = PathBuf::from(&pg_config_path); +- +- if !path.exists() { +- panic!("pg_config doesn't exist in the configured path: {:?}", path); +- } +- +- return path; +- } +- } +- PathBuf::from("pg_config") +-} +- +-fn pg_config_output(command: &str) -> Option<String> { +- Command::new(pg_config_path()) +- .arg(command) +- .output() +- .ok() +- .into_iter() +- .filter(|output| output.status.success()) +- .flat_map(|output| String::from_utf8(output.stdout).ok()) +- .map(|output| output.trim().to_string()) +- .next() +-} +- +-#[cfg(not(target_os = "macos"))] +-fn replace_homebrew_path_on_mac(path: String) -> String { +- path +-} +- +-#[cfg(target_os = "macos")] +-fn replace_homebrew_path_on_mac(path: String) -> String { +- if path == "/usr/local/lib" { +- Command::new("brew") +- .arg("--prefix") +- .arg("postgres") +- .output() +- .ok() +- .into_iter() +- .filter(|output| output.status.success()) +- .flat_map(|output| String::from_utf8(output.stdout).ok()) +- .map(|output| format!("{}/lib", output.trim())) +- .next() +- .unwrap_or(path) +- } else { +- path +- } ++ pkg_config::probe_library("libpq").unwrap(); + } +-- +2.41.0 + diff --git a/0001-unconditionally-use-pkg-config-to-link-against-syste.patch b/0001-unconditionally-use-pkg-config-to-link-against-syste.patch deleted file mode 100644 index 133d0fa..0000000 --- a/0001-unconditionally-use-pkg-config-to-link-against-syste.patch +++ /dev/null @@ -1,215 +0,0 @@ -From 6ad894cf364730af4b9c859a9f429e813d29e0e2 Mon Sep 17 00:00:00 2001 -From: Fabio Valentini decathorpe@gmail.com -Date: Fri, 5 Aug 2022 17:34:40 +0200 -Subject: [PATCH] unconditionally use pkg-config to link against system libpq - ---- - build.rs | 194 +------------------------------------------------------ - 1 file changed, 1 insertion(+), 193 deletions(-) - -diff --git a/build.rs b/build.rs -index c8f5a6b..3a146aa 100644 ---- a/build.rs -+++ b/build.rs -@@ -1,197 +1,5 @@ --#[cfg(feature="pkg-config")] - extern crate pkg_config; - --#[cfg(target_env = "msvc")] --extern crate vcpkg; -- --use std::process::Command; --use std::env; --use std::path::PathBuf; --use std::fmt::{self, Display}; -- --enum LinkType { -- Static, -- Dynamic --} -- --impl Display for LinkType { -- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { -- match *self { -- LinkType::Static => write!(f, "static"), -- LinkType::Dynamic => write!(f, "dylib"), -- } -- } --} -- --struct LinkingOptions { -- linking_type: Option<LinkType>, -- lib_name: &'static str, --} -- --impl LinkingOptions { -- fn from_name_and_type(lib_name: &'static str, tpe: LinkType) -> Self { -- LinkingOptions { -- linking_type: Some(tpe), -- lib_name -- } -- } -- fn from_name(lib_name: &'static str) -> Self { -- LinkingOptions { -- linking_type: None, -- lib_name -- } -- } -- -- fn from_env() -> Self { -- // On Windows-MSVC, always link dynamically -- if cfg!(all(windows, target_env="msvc")) { -- return LinkingOptions::from_name_and_type("libpq", LinkType::Dynamic); -- } -- -- // Link unconditionally statically -- if env::var_os("PQ_LIB_STATIC").is_some() { -- return LinkingOptions::from_name_and_type("pq", LinkType::Static); -- } -- -- // Examine the per-target env vars -- if let Ok(target) = env::var("TARGET") { -- let pg_config_for_target = format!("PQ_LIB_STATIC_{}", target.to_ascii_uppercase().replace("-", "_")); -- println!("cargo:rerun-if-env-changed={}", pg_config_for_target); -- if env::var_os(&pg_config_for_target).is_some() { -- return LinkingOptions::from_name_and_type("pq", LinkType::Static); -- } -- } -- -- // Otherwise, don't specify -- LinkingOptions::from_name("pq") -- } --} -- --impl Display for LinkingOptions { -- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { -- if let Some(ref t) = self.linking_type { -- write!(f, "{}=", t)?; -- } -- write!(f, "{}", self.lib_name) -- } --} -- - fn main() { -- println!("cargo:rerun-if-env-changed=PQ_LIB_STATIC"); -- println!("cargo:rerun-if-env-changed=TARGET"); -- -- // if target is specified the more concrete pq_lib_dir overwrites a more general one -- let lib_dir = if let Ok(target) = env::var("TARGET") { -- let pq_lib_dir_for_target = format!("PQ_LIB_DIR_{}", target.to_ascii_uppercase().replace("-", "_")); -- check_and_use_lib_dir(&pq_lib_dir_for_target).or_else(|_| check_and_use_lib_dir("PQ_LIB_DIR")) -- } -- else{ -- check_and_use_lib_dir("PQ_LIB_DIR") -- }; -- -- if let Ok(lib_dir) = lib_dir { -- println!("cargo:rustc-link-search=native={}", lib_dir); -- } else if configured_by_pkg_config() { -- return // pkg_config does everything for us, including output for cargo -- } else if configured_by_vcpkg() { -- return // vcpkg does everything for us, including output for cargo -- } else if let Some(path) = pg_config_output("--libdir") { -- let path = replace_homebrew_path_on_mac(path); -- println!("cargo:rustc-link-search=native={}", path); -- } -- println!("cargo:rustc-link-lib={}", LinkingOptions::from_env()); --} -- --#[cfg(feature = "pkg-config")] --fn configured_by_pkg_config() -> bool { -- pkg_config::probe_library("libpq").is_ok() --} -- --#[cfg(not(feature = "pkg-config"))] --fn configured_by_pkg_config() -> bool { -- false --} -- --#[cfg(target_env = "msvc")] --fn configured_by_vcpkg() -> bool { -- vcpkg::find_package("libpq").map(|_| { -- println!("cargo:rustc-link-lib=crypt32"); -- println!("cargo:rustc-link-lib=gdi32"); -- println!("cargo:rustc-link-lib=user32"); -- println!("cargo:rustc-link-lib=secur32"); -- println!("cargo:rustc-link-lib=shell32"); -- }).is_ok() --} -- --#[cfg(not(target_env = "msvc"))] --fn configured_by_vcpkg() -> bool { -- false --} -- --fn check_and_use_lib_dir(var_name: &str) -> Result<String, env::VarError>{ -- println!("cargo:rerun-if-env-changed={:?}", var_name); -- println!("{:?} = {:?}", var_name , env::var(var_name)); -- -- let pq_lib_dir = env::var(var_name); -- if let Ok(pg_lib_path) = pq_lib_dir.clone() { -- let path = PathBuf::from(&pg_lib_path); -- if !path.exists() { -- panic!("Folder {:?} doesn't exist in the configured path: {:?}", var_name, path); -- } -- } -- pq_lib_dir --} -- --fn pg_config_path() -> PathBuf { -- if let Ok(target) = env::var("TARGET") { -- let pg_config_for_target = &format!("PG_CONFIG_{}", target.to_ascii_uppercase().replace("-", "_")); -- println!("cargo:rerun-if-env-changed={}", pg_config_for_target); -- if let Some(pg_config_path) = env::var_os(pg_config_for_target) { -- -- let path = PathBuf::from(&pg_config_path); -- -- if !path.exists() { -- panic!("pg_config doesn't exist in the configured path: {:?}", path); -- } -- -- return path; -- } -- } -- PathBuf::from("pg_config") --} -- --fn pg_config_output(command: &str) -> Option<String> { -- Command::new(pg_config_path()) -- .arg(command) -- .output() -- .ok() -- .into_iter() -- .filter(|output| output.status.success()) -- .flat_map(|output| String::from_utf8(output.stdout).ok()) -- .map(|output| output.trim().to_string()) -- .next() --} -- --#[cfg(not(target_os = "macos"))] --fn replace_homebrew_path_on_mac(path: String) -> String { -- path --} -- --#[cfg(target_os = "macos")] --fn replace_homebrew_path_on_mac(path: String) -> String { -- if path == "/usr/local/lib" { -- Command::new("brew") -- .arg("--prefix") -- .arg("postgres") -- .output() -- .ok() -- .into_iter() -- .filter(|output| output.status.success()) -- .flat_map(|output| String::from_utf8(output.stdout).ok()) -- .map(|output| format!("{}/lib", output.trim())) -- .next() -- .unwrap_or(path) -- } else { -- path -- } -+ pkg_config::probe_library("libpq").unwrap(); - } --- -2.37.1 - diff --git a/README.md b/README.md deleted file mode 100644 index d523d27..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# rust-pq-sys - -The rust-pq-sys package \ No newline at end of file diff --git a/pq-sys-fix-metadata-auto.diff b/pq-sys-fix-metadata-auto.diff index e85b31f..5d9ba85 100644 --- a/pq-sys-fix-metadata-auto.diff +++ b/pq-sys-fix-metadata-auto.diff @@ -1,6 +1,6 @@ ---- pq-sys-0.4.7/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ pq-sys-0.4.7/Cargo.toml 1970-01-01T00:00:01+00:00 -@@ -25,5 +25,3 @@ +--- pq-sys-0.4.8/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ pq-sys-0.4.8/Cargo.toml 2023-08-31T20:00:11.068121+00:00 +@@ -26,5 +26,3 @@ version = "0.3.0" optional = true
diff --git a/pq-sys-fix-metadata.diff b/pq-sys-fix-metadata.diff index 2336a74..3565041 100644 --- a/pq-sys-fix-metadata.diff +++ b/pq-sys-fix-metadata.diff @@ -1,6 +1,6 @@ ---- pq-sys-0.4.7/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ pq-sys-0.4.7/Cargo.toml 2022-08-05T15:25:23.988681+00:00 -@@ -23,5 +23,6 @@ +--- pq-sys-0.4.8/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ pq-sys-0.4.8/Cargo.toml 2023-08-31T20:00:32.674209+00:00 +@@ -24,5 +24,6 @@
[build-dependencies.pkg-config] version = "0.3.0" diff --git a/rust-pq-sys.spec b/rust-pq-sys.spec index fc640f1..ff44a41 100644 --- a/rust-pq-sys.spec +++ b/rust-pq-sys.spec @@ -1,4 +1,4 @@ -# Generated by rust2rpm 22 +# Generated by rust2rpm 24 %ifarch %{ix86} %{arm} # * generated bindgen tests only work on 64-bit architectures # https://github.com/sgrif/pq-sys/issues/32 @@ -11,7 +11,7 @@ %global crate pq-sys
Name: rust-pq-sys -Version: 0.4.7 +Version: 0.4.8 Release: %autorelease Summary: Auto-generated rust bindings for libpq
@@ -24,9 +24,7 @@ Patch: pq-sys-fix-metadata-auto.diff # * make build-dependency on pkg-config non-optional Patch: pq-sys-fix-metadata.diff # * unconditionally use pkg-config to link against system libpq -Patch: 0001-unconditionally-use-pkg-config-to-link-against-syste.patch - -ExclusiveArch: %{rust_arches} +Patch: 0001-Unconditionally-use-pkg-config-to-link-against-syste.patch
BuildRequires: rust-packaging >= 21
diff --git a/sources b/sources index b661c51..fc05ab7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pq-sys-0.4.7.crate) = 26d4c241ce607922b71eca87e753661dc4583b356279cdd3b693c34d8d3eda3cd188aa7f4daa632c4f8785ad7f5a42d58a4ec1fde059d42cc365a411170ef811 +SHA512 (pq-sys-0.4.8.crate) = 5c9c049c2ed2f88a7e910c06bf1f13dc79a86420f57605958dc137d68e7e85cb18429c7c6e0df720e8a106b972a299f499996e91ba258635fd007c1139068f79
https://src.fedoraproject.org/rpms/rust-pq-sys/c/e18876647da357b0a6e0b6ee966...
scm-commits@lists.fedoraproject.org