Skip to content

Commit

Permalink
mkmf_config is more robust about detecting libdir
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
flavorjones committed May 31, 2024
1 parent 4d789d1 commit 68f8344
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions lib/mini_portile2/mini_portile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

#
Expand Down

0 comments on commit 68f8344

Please sign in to comment.