From 1788708a93c30b37f0d6888f1582f7fe1e7f2b12 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Sun, 10 Sep 2023 12:03:58 -0400 Subject: [PATCH] wip: update to latest mini_portile and drop the pkgconf hacks See https://github.com/flavorjones/mini_portile/pull/131 --- .github/workflows/sqlite3-ruby.yml | 2 +- Gemfile | 2 ++ ext/sqlite3/extconf.rb | 22 ---------------------- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/.github/workflows/sqlite3-ruby.yml b/.github/workflows/sqlite3-ruby.yml index 2c0667dd..dc897991 100644 --- a/.github/workflows/sqlite3-ruby.yml +++ b/.github/workflows/sqlite3-ruby.yml @@ -86,7 +86,7 @@ jobs: steps: - run: | dnf group install -y "C Development Tools and Libraries" - dnf install -y ruby ruby-devel libyaml-devel + dnf install -y ruby ruby-devel libyaml-devel git-all - uses: actions/checkout@v4 - run: bundle install - run: bundle exec rake compile -- --disable-system-libraries diff --git a/Gemfile b/Gemfile index 65cbbf4d..46fd1ccc 100644 --- a/Gemfile +++ b/Gemfile @@ -9,3 +9,5 @@ gem("rdoc", "6.5.0") gem("psych", "5.1.0") gem("ruby_memcheck", "2.1.2") if Gem::Platform.local.os == "linux" + +gem "mini_portile2", git: "https://github.com/flavorjones/mini_portile", ref: "696d25d3" diff --git a/ext/sqlite3/extconf.rb b/ext/sqlite3/extconf.rb index 8d266c7c..be26288c 100644 --- a/ext/sqlite3/extconf.rb +++ b/ext/sqlite3/extconf.rb @@ -66,28 +66,6 @@ def configure_packaged_libraries recipe.cook end recipe.activate - - # on macos, pkg-config will not return --cflags without this - ENV["PKG_CONFIG_ALLOW_SYSTEM_CFLAGS"] = "t" - - # only needed for Ruby 3.1.3, see https://bugs.ruby-lang.org/issues/19233 - RbConfig::CONFIG["PKG_CONFIG"] = config_string("PKG_CONFIG") || "pkg-config" - - lib_path = File.join(recipe.path, "lib") - pcfile = File.join(lib_path, "pkgconfig", "sqlite3.pc") - abort_pkg_config("pkg_config") unless pkg_config(pcfile) - - # see https://bugs.ruby-lang.org/issues/18490 - ldflags = xpopen(["pkg-config", "--libs", "--static", pcfile], err: [:child, :out], &:read) - abort_pkg_config("xpopen") unless $?.success? - ldflags = ldflags.split - - # see https://github.com/flavorjones/mini_portile/issues/118 - "-L#{lib_path}".tap do |lib_path_flag| - ldflags.prepend(lib_path_flag) unless ldflags.include?(lib_path_flag) - end - - ldflags.each { |ldflag| append_ldflags(ldflag) } end end