diff --git a/recipes/ruby/all/patches/0003-openssl-zlib-ext-3.2.2.patch b/recipes/ruby/all/patches/0003-openssl-zlib-ext-3.2.2.patch index 81c3225b86f8b..f69e2daae031f 100644 --- a/recipes/ruby/all/patches/0003-openssl-zlib-ext-3.2.2.patch +++ b/recipes/ruby/all/patches/0003-openssl-zlib-ext-3.2.2.patch @@ -7,10 +7,10 @@ diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb have_library("crypt32") + have_library("advapi32") end - + return false unless have_header("openssl/ssl.h") @@ -57,8 +58,12 @@ def find_openssl_library - + if $mswin # OpenSSL >= 1.1.0: libcrypto.lib and libssl.lib. + # Potentially with 'd' appended (conan center index) @@ -22,13 +22,26 @@ diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb + have_library("libssld", "SSL_new") return true end - + +@@ -95,6 +100,12 @@ end + Logging::message "=== Checking for required stuff... ===\n" + pkg_config_found = !dir_config_given && pkg_config("openssl") && have_header("openssl/ssl.h") + ++# Force finding the PKG config anyways because we want to grab the one ++# generated by conan to avoids the library linking order issue ++# (dl lz need to be after lssl and co). ++pkg_config("openssl") ++ ++ + if !pkg_config_found && !find_openssl_library + Logging::message "=== Checking for required stuff failed. ===\n" + Logging::message "Makefile wasn't created. Fix the errors above.\n" diff --git a/ext/zlib/extconf.rb b/ext/zlib/extconf.rb --- ext/zlib/extconf.rb +++ ext/zlib/extconf.rb @@ -11,7 +11,7 @@ require 'rbconfig' dir_config 'zlib' - + libs = $libs -if %w'z libz zlib1 zlib zdll zlibwapi'.find {|z| have_library(z, 'deflateReset')} and +if %w'z zlibstatic zlibstaticd zlib zlibd libz zlib1 zdll zlibwapi'.find {|z| have_library(z, 'deflateReset')} and diff --git a/recipes/ruby/all/patches/0003-openssl-zlib-ext-3.3.0.patch b/recipes/ruby/all/patches/0003-openssl-zlib-ext-3.3.0.patch index 8180ee1df6167..09642880a142c 100644 --- a/recipes/ruby/all/patches/0003-openssl-zlib-ext-3.3.0.patch +++ b/recipes/ruby/all/patches/0003-openssl-zlib-ext-3.3.0.patch @@ -1,7 +1,6 @@ diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb -index 56f4a1c..1d45d88 100644 ---- a/ext/openssl/extconf.rb -+++ b/ext/openssl/extconf.rb +--- ext/openssl/extconf.rb ++++ ext/openssl/extconf.rb @@ -68,6 +68,7 @@ def find_openssl_library # required for static OpenSSL libraries have_library("gdi32") # OpenSSL <= 1.0.2 (for RAND_screen()) @@ -24,10 +23,21 @@ index 56f4a1c..1d45d88 100644 return true end +@@ -116,6 +121,11 @@ end + Logging::message "=== Checking for required stuff... ===\n" + pkg_config_found = !dir_config_given && pkg_config("openssl") && have_header("openssl/ssl.h") + ++# Force finding the PKG config anyways because we want to grab the one ++# generated by conan to avoids the library linking order issue ++# (dl lz need to be after lssl and co). ++pkg_config("openssl") ++ + if !pkg_config_found && !find_openssl_library + Logging::message "=== Checking for required stuff failed. ===\n" + Logging::message "Makefile wasn't created. Fix the errors above.\n" diff --git a/ext/zlib/extconf.rb b/ext/zlib/extconf.rb -index 2b2dbb1..2abc037 100644 ---- a/ext/zlib/extconf.rb -+++ b/ext/zlib/extconf.rb +--- ext/zlib/extconf.rb ++++ ext/zlib/extconf.rb @@ -11,7 +11,7 @@ require 'rbconfig' dir_config 'zlib'