From 68f83448ad649722a0a5f15685fc6c790e2f7e33 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Fri, 31 May 2024 10:43:04 -0400 Subject: [PATCH] mkmf_config is more robust about detecting libdir openbsd's pkg-config doesn't support `--print-variables`, but we don't need it since everybody's pkg-config seems to just return a blank string if the variable doesn't exist. --- CHANGELOG.md | 1 + lib/mini_portile2/mini_portile.rb | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f3a3b0..76cc7b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - When setting the C compiler through the `MiniPortile` constructor, the preferred keyword argument is now `:cc_command`. The original `:gcc_command` is still supported. (#144 by @flavorjones) - GPG file verification error messages are captured in the raised exception. Previously these errors went to `stderr`. (#145 by @flavorjones) - Add support for extracting xz-compressed tarballs on OpenBSD. (#141 by @postmodern) +- Add OpenBSD support to the experimental method `MakeMakefile#mkmf_config`. (#141 by @flavorjones) ### 2.8.6 / 2024-04-14 diff --git a/lib/mini_portile2/mini_portile.rb b/lib/mini_portile2/mini_portile.rb index 72767fe..0607d3f 100644 --- a/lib/mini_portile2/mini_portile.rb +++ b/lib/mini_portile2/mini_portile.rb @@ -320,10 +320,8 @@ def mkmf_config(pkg: nil, dir: nil, static: nil) if static libdir = lib_path if pcfile - variables = minimal_pkg_config(pcfile, "print-variables").split("\n").map(&:strip) - if variables.include?("libdir") - libdir = minimal_pkg_config(pcfile, "variable=libdir") - end + pcfile_libdir = minimal_pkg_config(pcfile, "variable=libdir").strip + libdir = pcfile_libdir unless pcfile_libdir.empty? end #