From 379f757ef529feae0fafba2ae2c145c050d8a4fc Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Sun, 20 Feb 2022 14:21:33 -0500 Subject: [PATCH] dev(package): work around gnome mirrors with expired certs what year is it, jfc --- ext/nokogiri/extconf.rb | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/ext/nokogiri/extconf.rb b/ext/nokogiri/extconf.rb index 86aae340896..a1d6be549e9 100644 --- a/ext/nokogiri/extconf.rb +++ b/ext/nokogiri/extconf.rb @@ -211,6 +211,18 @@ def local_have_library(lib, func = nil, headers = nil) have_library(lib, func, headers) || have_library("lib#{lib}", func, headers) end +def gnome_source + # As of 2022-02-20, some mirrors have expired SSL certificates. I'm able to retrieve from my home, + # but whatever host is resolved on the github actions workers see an expired cert. + # + # See https://github.com/sparklemotion/nokogiri/runs/5266206403?check_suite_focus=true + if ENV["NOKOGIRI_USE_CANONICAL_GNOME_SOURCE"] + "https://download.gnome.org" + else + "https://mirror.csclub.uwaterloo.ca/gnome" # old reliable + end +end + LOCAL_PACKAGE_RESPONSE = Object.new def LOCAL_PACKAGE_RESPONSE.%(package) package ? "yes: #{package}" : "no" @@ -512,6 +524,7 @@ def recipe.port_path EOM + pp(recipe.files) chdir_for_build { recipe.cook } FileUtils.touch(checkpoint) end @@ -772,7 +785,7 @@ def compile else minor_version = Gem::Version.new(recipe.version).segments.take(2).join(".") recipe.files = [{ - url: "https://download.gnome.org/sources/libxml2/#{minor_version}/#{recipe.name}-#{recipe.version}.tar.xz", + url: "#{gnome_source}/sources/libxml2/#{minor_version}/#{recipe.name}-#{recipe.version}.tar.xz", sha256: dependencies["libxml2"]["sha256"], }] recipe.patch_files = Dir[File.join(PACKAGE_ROOT_DIR, "patches", "libxml2", "*.patch")].sort @@ -821,7 +834,7 @@ def compile else minor_version = Gem::Version.new(recipe.version).segments.take(2).join(".") recipe.files = [{ - url: "https://download.gnome.org/sources/libxslt/#{minor_version}/#{recipe.name}-#{recipe.version}.tar.xz", + url: "#{gnome_source}/sources/libxslt/#{minor_version}/#{recipe.name}-#{recipe.version}.tar.xz", sha256: dependencies["libxslt"]["sha256"], }] recipe.patch_files = Dir[File.join(PACKAGE_ROOT_DIR, "patches", "libxslt", "*.patch")].sort