pkg-config 1.6.5 → 1.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a4a54b361004652d84f50b2d4f2cfaaf447ffd2fc97c44490ed7c7751763721
4
- data.tar.gz: 3ae709328a845092794bca9d2753e5d7867170b5832d7f85023c0692ec1e8178
3
+ metadata.gz: 9247c36102e80ca429636e25d28b24b14573486f0825d1d6764f85a09fc55681
4
+ data.tar.gz: 8dc70f0d2fb458c96b78b4db348e119be01c9c170e16b969795e6e435a3dca5b
5
5
  SHA512:
6
- metadata.gz: 748e225bef3d590013e8bf3efcc2c0422d6d2a802a65f104f15feebd01bcf526d29b0909b922d444b261c5354a2b6101d549871867f7e5bb95c0bd01da12ba48
7
- data.tar.gz: 0203aee2b542ca94a0dbf18e7515ff73339b3910931eeb209d19e791f30a63d8a70bf36c500271f68b73a2045abfc60fe6c0a5727e265df01843c893c95e7936
6
+ metadata.gz: 4c4d698e50f0f74dd4411fe8443e2c190fb1b1ae04e36c8341be38d997430977ffcb6ae3b7871fa4f53de367e3b08c9ec2305df504e9a60fe8a078843ee4d3e6
7
+ data.tar.gz: 1b01d95584b9feb2417852a11c8bce55ae12b6c703c8aea9f3fe71185f640fd379a09176172eee9eb1f981dc4851f6fb11e6e8145351be3c5a54d429b18dce1d
data/NEWS.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # NEWS
2
2
 
3
+ ## 1.6.7 - 2026-11-04
4
+
5
+ ### Improvements
6
+
7
+ * Improved `pkgconf`/`pkg-config` search algorithm: Search `pkgconf`
8
+ and `pkg-config` in each `PATH` entry.
9
+ * [apache/arrow#55366](https://github.com/apache/arrow/issues/55366)
10
+ * Reported by tadeja
11
+
12
+ ### Thanks
13
+
14
+ * tadeja
15
+
16
+ ## 1.6.6 - 2026-10-19
17
+
18
+ ### Improvements
19
+
20
+ * Added support for clang-cl.
21
+ * [ruby-gnome/pkg-config#56](https://github.com/ruby-gnome/pkg-config/issues/56)
22
+ * Patch by Hiroshi SHIBATA
23
+
24
+ ### Thanks
25
+
26
+ * Hiroshi SHIBATA
27
+
3
28
  ## 1.6.5 - 2025-12-01
4
29
 
5
30
  ### Improvements
data/lib/pkg-config.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2008-2025 Sutou Kouhei <kou@cozmixng.org>
1
+ # Copyright (C) 2008-2026 Sutou Kouhei <kou@cozmixng.org>
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -19,7 +19,7 @@ require "rbconfig"
19
19
  require "shellwords"
20
20
 
21
21
  module PKGConfig
22
- VERSION = "1.6.5"
22
+ VERSION = "1.6.7"
23
23
 
24
24
  @@paths = []
25
25
  @@override_variables = {}
@@ -34,7 +34,8 @@ module PKGConfig
34
34
  end
35
35
 
36
36
  def msvc?
37
- /mswin/.match(RUBY_PLATFORM) and /^cl\b/.match(RbConfig::CONFIG["CC"])
37
+ /mswin/.match(RUBY_PLATFORM) and
38
+ /\A(?:clang-)?cl\b/.match(RbConfig::CONFIG["CC"])
38
39
  end
39
40
 
40
41
  def package_config(package)
@@ -186,8 +187,6 @@ class PackageConfig
186
187
  candidates = [
187
188
  with_config("pkg-config"),
188
189
  ENV["PKG_CONFIG"],
189
- "pkgconf#{exeext}",
190
- "pkg-config#{exeext}",
191
190
  ].compact
192
191
  candidates.each do |pkg_config|
193
192
  pkg_config = Pathname.new(pkg_config)
@@ -201,13 +200,19 @@ class PackageConfig
201
200
  return found_pkg_config if found_pkg_config
202
201
  end
203
202
  end
204
- Pathname.new(candidates[0])
203
+ # Search both names in each PATH entry to respect PATH order.
204
+ default_candidates = ["pkgconf#{exeext}", "pkg-config#{exeext}"]
205
+ found_pkg_config = search_executable_from_path(*default_candidates)
206
+ return found_pkg_config if found_pkg_config
207
+ Pathname.new(candidates[0] || default_candidates[0])
205
208
  end
206
209
 
207
- def search_executable_from_path(name)
210
+ def search_executable_from_path(*names)
208
211
  (ENV["PATH"] || "").split(SEPARATOR).each do |path|
209
- try_name = Pathname(path) + name
210
- return try_name if try_name.executable?
212
+ names.each do |name|
213
+ try_name = Pathname(path) + name
214
+ return try_name if try_name.executable?
215
+ end
211
216
  end
212
217
  nil
213
218
  end
@@ -1,5 +1,7 @@
1
1
  require "mkmf"
2
+ require "fileutils"
2
3
  require "tempfile"
4
+ require "tmpdir"
3
5
 
4
6
  require "pkg-config"
5
7
 
@@ -344,4 +346,54 @@ Cflags: -I${includedir}/my-package
344
346
  "-DFOO", "-Wall", "-Wl,--as-needed"]))
345
347
  end
346
348
  end
349
+
350
+ sub_test_case(".native_pkg_config") do
351
+ def setup
352
+ super
353
+ original_path = ENV["PATH"]
354
+ original_pkg_config = ENV["PKG_CONFIG"]
355
+ begin
356
+ ENV.delete("PKG_CONFIG")
357
+ PackageConfig.clear_configure_args_cache
358
+ Dir.mktmpdir do |tmp_dir|
359
+ @tmp_dir = tmp_dir
360
+ yield
361
+ end
362
+ ensure
363
+ ENV["PATH"] = original_path
364
+ ENV["PKG_CONFIG"] = original_pkg_config
365
+ PackageConfig.clear_configure_args_cache
366
+ end
367
+ end
368
+
369
+ def create_executable(dir, name)
370
+ dir = File.join(@tmp_dir, dir)
371
+ FileUtils.mkdir_p(dir)
372
+ path = File.join(dir, "#{name}#{RbConfig::CONFIG["EXEEXT"]}")
373
+ File.write(path, "")
374
+ FileUtils.chmod(0755, path)
375
+ Pathname(path)
376
+ end
377
+
378
+ def native_pkg_config
379
+ PackageConfig.native_pkg_config
380
+ end
381
+
382
+ def test_prefer_earlier_path_entry
383
+ pkg_config = create_executable("conda", "pkg-config")
384
+ pkgconf = create_executable("homebrew", "pkgconf")
385
+ ENV["PATH"] = [
386
+ File.dirname(pkg_config),
387
+ File.dirname(pkgconf),
388
+ ].join(File::PATH_SEPARATOR)
389
+ assert_equal(pkg_config, native_pkg_config)
390
+ end
391
+
392
+ def test_prefer_pkgconf_in_same_path_entry
393
+ create_executable("bin", "pkg-config")
394
+ pkgconf = create_executable("bin", "pkgconf")
395
+ ENV["PATH"] = File.dirname(pkgconf)
396
+ assert_equal(pkgconf, native_pkg_config)
397
+ end
398
+ end
347
399
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pkg-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.5
4
+ version: 1.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sutou Kouhei
@@ -44,7 +44,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
44
44
  - !ruby/object:Gem::Version
45
45
  version: '0'
46
46
  requirements: []
47
- rubygems_version: 3.6.9
47
+ rubygems_version: 4.0.20
48
48
  specification_version: 4
49
49
  summary: A pkg-config implementation for Ruby
50
50
  test_files: