diff --git a/0001-Make-static-curl-static-ssl-features-a-noop.patch b/0001-Make-static-curl-static-ssl-features-a-noop.patch new file mode 100644 index 0000000..4e1c443 --- /dev/null +++ b/0001-Make-static-curl-static-ssl-features-a-noop.patch @@ -0,0 +1,62 @@ +From 274cc7067e131d0c7e1bcdc3959bc8fbd895c942 Mon Sep 17 00:00:00 2001 +From: Igor Raits +Date: Sun, 17 May 2020 16:00:46 +0200 +Subject: [PATCH] Make static-curl/static-ssl features a noop + +Signed-off-by: Igor Raits +--- + build.rs | 33 ++++++++++++++++----------------- + 1 file changed, 16 insertions(+), 17 deletions(-) + +diff --git a/build.rs b/build.rs +index 74b6a55..842ddb5 100644 +--- a/build.rs ++++ b/build.rs +@@ -19,28 +19,27 @@ fn main() { + return println!("cargo:rustc-flags=-l curl"); + } + +- // If the static-curl feature is disabled, probe for a system-wide libcurl. +- if !cfg!(feature = "static-curl") { +- // OSX and Haiku ships libcurl by default, so we just use that version +- // so long as it has the right features enabled. +- if target.contains("apple") || target.contains("haiku") { +- if !cfg!(feature = "http2") || curl_config_reports_http2() { +- return println!("cargo:rustc-flags=-l curl"); +- } ++ // OSX and Haiku ships libcurl by default, so we just use that version ++ // so long as it has the right features enabled. ++ if target.contains("apple") || target.contains("haiku") { ++ if !cfg!(feature = "http2") || curl_config_reports_http2() { ++ return println!("cargo:rustc-flags=-l curl"); + } ++ } + +- // Next, fall back and try to use pkg-config if its available. +- if windows { +- if try_vcpkg() { +- return; +- } +- } else { +- if try_pkg_config() { +- return; +- } ++ // Next, fall back and try to use pkg-config if its available. ++ if windows { ++ if try_vcpkg() { ++ return; ++ } ++ } else { ++ if try_pkg_config() { ++ return; + } + } + ++ std::process::exit(1); ++ + if !Path::new("curl/.git").exists() { + let _ = Command::new("git") + .args(&["submodule", "update", "--init"]) +-- +2.26.2 + diff --git a/curl-sys-fix-metadata.diff b/curl-sys-fix-metadata.diff index b590c05..0b436b0 100644 --- a/curl-sys-fix-metadata.diff +++ b/curl-sys-fix-metadata.diff @@ -1,5 +1,5 @@ --- curl-sys-0.4.31+curl-7.70.0/Cargo.toml 2020-04-29T16:02:44+00:00 -+++ curl-sys-0.4.31+curl-7.70.0/Cargo.toml 2020-04-29T22:14:16.610856+00:00 ++++ curl-sys-0.4.31+curl-7.70.0/Cargo.toml 2020-05-17T14:07:18.084789+00:00 @@ -12,7 +12,7 @@ [package] @@ -9,7 +9,7 @@ authors = ["Alex Crichton "] build = "build.rs" links = "curl" -@@ -28,18 +28,9 @@ +@@ -28,18 +28,6 @@ [dependencies.libc] version = "0.2.2" @@ -17,9 +17,9 @@ -version = "0.1.3" -optional = true - - [dependencies.libz-sys] - version = "1.0.18" - +-[dependencies.libz-sys] +-version = "1.0.18" +- -[dependencies.mesalink] -version = "1.1.0-cratesio" -features = ["client_apis", "error_strings", "tls13", "aesgcm", "chachapoly", "x25519", "ecdh", "ecdsa", "verifier"] @@ -28,26 +28,27 @@ [build-dependencies.cc] version = "1.0" -@@ -48,21 +39,13 @@ - +@@ -49,20 +37,12 @@ [features] default = ["ssl"] --force-system-lib-on-osx = [] + force-system-lib-on-osx = [] -http2 = ["libnghttp2-sys"] +http2 = [] protocol-ftp = [] spnego = [] - ssl = ["openssl-sys"] --static-curl = [] +-ssl = ["openssl-sys"] ++ssl = [] + static-curl = [] -static-ssl = ["openssl-sys/vendored"] - [target."cfg(all(unix, not(target_os = \"macos\")))".dependencies.openssl-sys] - version = "0.9" - optional = true +-[target."cfg(all(unix, not(target_os = \"macos\")))".dependencies.openssl-sys] +-version = "0.9" +-optional = true -[target."cfg(target_env = \"msvc\")".build-dependencies.vcpkg] -version = "0.2" -[target."cfg(windows)".dependencies.winapi] -version = "0.3" -features = ["winsock2", "ws2def"] ++static-ssl = [] [badges.appveyor] repository = "alexcrichton/curl-rust" diff --git a/curl-sys-remove-libnghttp2-sys.diff b/curl-sys-remove-libnghttp2-sys.diff deleted file mode 100644 index 08c03df..0000000 --- a/curl-sys-remove-libnghttp2-sys.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- curl-sys-0.4.18/lib.rs.orig 2019-04-17 18:46:52.000000000 -0700 -+++ curl-sys-0.4.18/lib.rs 2019-05-09 12:05:12.694980681 -0700 -@@ -2,8 +2,6 @@ - #![doc(html_root_url = "https://docs.rs/curl-sys/0.3")] - - extern crate libc; --#[cfg(link_libnghttp2)] --extern crate libnghttp2_sys; - #[cfg(link_libz)] - extern crate libz_sys; - #[cfg(feature = "mesalink")] diff --git a/rust-curl-sys.spec b/rust-curl-sys.spec index 3991d07..d34732c 100644 --- a/rust-curl-sys.spec +++ b/rust-curl-sys.spec @@ -7,7 +7,7 @@ Name: rust-%{crate} Version: 0.4.31 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Native bindings to the libcurl library # Upstream license specification: MIT @@ -17,9 +17,10 @@ Source: %{crates_source %{crate} %{upstream_version}} # Initial patched metadata # * Remove curl version from version field # * No windows -# * libnghttp2-sys is only needed for bundled curl +# * Drop unused dependencies Patch0: curl-sys-fix-metadata.diff -Patch1: curl-sys-remove-libnghttp2-sys.diff +# Make static-curl/static-ssl features a noop, not for upstream +Patch0001: 0001-Make-static-curl-static-ssl-features-a-noop.patch ExclusiveArch: %{rust_arches} %if %{__cargo_skip_build} @@ -59,28 +60,28 @@ which use "default" feature of "%{crate}" crate. %files -n %{name}+default-devel %ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml -%package -n %{name}+http2-devel +%package -n %{name}+force-system-lib-on-osx-devel Summary: %{summary} BuildArch: noarch -%description -n %{name}+http2-devel %{_description} +%description -n %{name}+force-system-lib-on-osx-devel %{_description} This package contains library source intended for building other packages -which use "http2" feature of "%{crate}" crate. +which use "force-system-lib-on-osx" feature of "%{crate}" crate. -%files -n %{name}+http2-devel +%files -n %{name}+force-system-lib-on-osx-devel %ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml -%package -n %{name}+openssl-sys-devel +%package -n %{name}+http2-devel Summary: %{summary} BuildArch: noarch -%description -n %{name}+openssl-sys-devel %{_description} +%description -n %{name}+http2-devel %{_description} This package contains library source intended for building other packages -which use "openssl-sys" feature of "%{crate}" crate. +which use "http2" feature of "%{crate}" crate. -%files -n %{name}+openssl-sys-devel +%files -n %{name}+http2-devel %ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml %package -n %{name}+protocol-ftp-devel @@ -119,6 +120,30 @@ which use "ssl" feature of "%{crate}" crate. %files -n %{name}+ssl-devel %ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml +%package -n %{name}+static-curl-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+static-curl-devel %{_description} + +This package contains library source intended for building other packages +which use "static-curl" feature of "%{crate}" crate. + +%files -n %{name}+static-curl-devel +%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml + +%package -n %{name}+static-ssl-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+static-ssl-devel %{_description} + +This package contains library source intended for building other packages +which use "static-ssl" feature of "%{crate}" crate. + +%files -n %{name}+static-ssl-devel +%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml + %prep %autosetup -n %{crate}-%{upstream_version} -p1 # No bundled deps @@ -141,6 +166,10 @@ echo 'pkgconfig(libcurl)' %endif %changelog +* Sun May 17 16:07:18 CEST 2020 Igor Raits - 0.4.31-2 +- Drop move unneeded dependencies +- Add static features back, but make them noop + * Wed Apr 29 2020 Josh Stone - 0.4.31-1 - Update to 0.4.31+curl-7.70.0