From 76dbc8c5bef99467f3403297e29da4297fbddeb7 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Mon, 17 Oct 2022 21:41:16 -0400 Subject: [PATCH 1/2] dep: update zlib to v1.2.13 --- dependencies.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies.yml b/dependencies.yml index 25b818954f..bb07a276e7 100644 --- a/dependencies.yml +++ b/dependencies.yml @@ -9,8 +9,8 @@ libxslt: # sha-256 hash provided in https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.37.sha256sum zlib: - version: "1.2.12" - sha256: "91844808532e5ce316b3c010929493c0244f3d37593afd6de04f71821d5136d9" + version: "1.2.13" + sha256: "b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30" # SHA-256 hash provided on http://zlib.net/ libiconv: From 212e07da28096db7d2cbda697bc2a38d71f6dc3a Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Tue, 18 Oct 2022 09:31:31 -0400 Subject: [PATCH 2/2] ext: hack to cross-compile zlib v1.2.13 on darwin --- ext/nokogiri/extconf.rb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ext/nokogiri/extconf.rb b/ext/nokogiri/extconf.rb index b0c808d7fa..3000148418 100644 --- a/ext/nokogiri/extconf.rb +++ b/ext/nokogiri/extconf.rb @@ -712,9 +712,17 @@ def install else class << recipe def configure - cflags = concat_flags(ENV["CFLAGS"], "-fPIC", "-g") - execute("configure", - ["env", "CHOST=#{host}", "CFLAGS=#{cflags}", "./configure", "--static", configure_prefix]) + env = {} + env["CFLAGS"] = concat_flags(ENV["CFLAGS"], "-fPIC", "-g") + env["CHOST"] = host + execute("configure", ["./configure", "--static", configure_prefix], { env: env }) + if darwin? + # needed as of zlib 1.2.13 + Dir.chdir(work_path) do + makefile = File.read("Makefile").gsub(/^AR=.*$/, "AR=#{host}-libtool") + File.open("Makefile", "w") { |m| m.write(makefile) } + end + end end end end