Skip to content

Commit

Permalink
wip: update to latest mini_portile and drop the pkgconf hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones committed Sep 10, 2023
1 parent 5c8e329 commit 1cbf1c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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: "74ac5a11"
22 changes: 0 additions & 22 deletions ext/sqlite3/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1cbf1c1

Please sign in to comment.