pkg-config 1.5.7 → 1.5.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ce019f0f6ac801e5c218c7f9e721d5c428ffbef30e6bfdbae678a80c364a46b
4
- data.tar.gz: '082d9fdd2413f734de37a5573a0747a3de8d46af22c1f904452e63765edc7d6b'
3
+ metadata.gz: 718c0829414803eaf6e4b4119eedbd5635f06490e432e02b8fecd1100e471409
4
+ data.tar.gz: 00d55bbd4c8f935454a5a65a1f84a6183e04f87ed6621fb6b21145075e38b481
5
5
  SHA512:
6
- metadata.gz: 6d0f96d09ec77da0d85688684eeeac8dd46095eca8fa2e296080d9f2bc65b46302ab846df62bbb8ae62c9da707488b24151b5c7ae58703c7bbee269479d7b30e
7
- data.tar.gz: ceda5ab27054ea938d5136240d5005babe6cdb034ec9bf221a114419cf55a21168266b427e93b44759014458cd8851aa6c7587d74a7d2aac2535779d0d50e4f6
6
+ metadata.gz: 5333ac54f4a4ff9d9013d4f61097032bd822d8b562144b5dd79a646106fe82d0c4ae32933ba6e570a14b10198d729c442d885b782e32ab490da4998bb7930c9c
7
+ data.tar.gz: a31424703041ab85dabff217234d68dcf0d1e28418f7b6a3ec2173dfdba6cc3c565d68744adf4e8eae7140cf3775a01c180ab6667886ae7ed50c3fc465fedd5b
data/NEWS.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # NEWS
2
2
 
3
+ ## 1.5.8 - 2024-11-21
4
+
5
+ ### Improvements
6
+
7
+ * Added support for pkgconf.
8
+
3
9
  ## 1.5.7 - 2024-10-24
4
10
 
5
11
  ### Improvements
@@ -1,4 +1,4 @@
1
- # Copyright 2012-2023 Sutou Kouhei <kou@cozmixng.org>
1
+ # Copyright (C) 2012-2024 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
@@ -15,5 +15,5 @@
15
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
  module PKGConfig
18
- VERSION = "1.5.7"
18
+ VERSION = "1.5.8"
19
19
  end
data/lib/pkg-config.rb CHANGED
@@ -72,18 +72,25 @@ class PackageConfig
72
72
 
73
73
  def guess_native_pkg_config
74
74
  exeext = RbConfig::CONFIG["EXEEXT"]
75
- default_pkg_config = ENV["PKG_CONFIG"] || "pkg-config#{exeext}"
76
- pkg_config = with_config("pkg-config", default_pkg_config)
77
- pkg_config = Pathname.new(pkg_config)
78
- unless pkg_config.absolute?
79
- found_pkg_config = search_executable_from_path(pkg_config)
80
- pkg_config = found_pkg_config if found_pkg_config
81
- end
82
- unless pkg_config.absolute?
83
- found_pkg_config = search_pkg_config_by_dln_find_exe(pkg_config)
84
- pkg_config = found_pkg_config if found_pkg_config
75
+ candidates = [
76
+ with_config("pkg-config"),
77
+ ENV["PKG_CONFIG"],
78
+ "pkgconf#{exeext}",
79
+ "pkg-config#{exeext}",
80
+ ].compact
81
+ candidates.each do |pkg_config|
82
+ pkg_config = Pathname.new(pkg_config)
83
+ return pkg_config if pkg_config.absolute? and pkg_config.exist?
84
+ unless pkg_config.absolute?
85
+ found_pkg_config = search_executable_from_path(pkg_config)
86
+ return found_pkg_config if found_pkg_config
87
+ end
88
+ unless pkg_config.absolute?
89
+ found_pkg_config = search_pkg_config_by_dln_find_exe(pkg_config)
90
+ return found_pkg_config if found_pkg_config
91
+ end
85
92
  end
86
- pkg_config
93
+ Pathname.new(candidates[0])
87
94
  end
88
95
 
89
96
  def search_executable_from_path(name)
@@ -2,7 +2,18 @@ require "mkmf"
2
2
  require "pkg-config"
3
3
 
4
4
  class PkgConfigTest < Test::Unit::TestCase
5
+ def find_program(name)
6
+ exeext = RbConfig::CONFIG["EXEEXT"]
7
+ ENV["PATH"].split(File::PATH_SEPARATOR).each do |path|
8
+ program = File.join(path, name)
9
+ return name if File.exist?(program)
10
+ return name if File.exist?("#{program}.#{exeext}")
11
+ end
12
+ nil
13
+ end
14
+
5
15
  def setup
16
+ @pkgconf = find_program("pkgconf") || "pkg-config"
6
17
  @custom_libdir = "/tmp/local/lib"
7
18
  options = {:override_variables => {"libdir" => @custom_libdir}}
8
19
  @cairo = PackageConfig.new("cairo", options)
@@ -10,17 +21,17 @@ class PkgConfigTest < Test::Unit::TestCase
10
21
  end
11
22
 
12
23
  def only_pkg_config_version(major, minor)
13
- pkg_config_version = `pkg-config --version`.chomp
24
+ pkg_config_version = `#{@pkgconf} --version`.chomp
14
25
  current_major, current_minor = pkg_config_version.split(".").collect(&:to_i)
15
26
  return if ([major, minor] <=> [current_major, current_minor]) <= 0
16
- omit("Require pkg-config #{pkg_config_version} or later")
27
+ omit("Require #{@pkgconf} #{pkg_config_version} or later")
17
28
  end
18
29
 
19
30
  def test_exist?
20
- assert(system("pkg-config --exists cairo"))
31
+ assert(system("#{@pkgconf} --exists cairo"))
21
32
  assert(@cairo.exist?)
22
33
 
23
- assert(system("pkg-config --exists cairo-png"))
34
+ assert(system("#{@pkgconf} --exists cairo-png"))
24
35
  assert(@cairo_png.exist?)
25
36
  end
26
37
 
@@ -177,7 +188,7 @@ class PkgConfigTest < Test::Unit::TestCase
177
188
  def pkg_config(package, *args)
178
189
  args.unshift("--define-variable=libdir=#{@custom_libdir}")
179
190
  args = args.collect {|arg| arg.dump}.join(" ")
180
- normalize_pkg_config_result(`pkg-config #{args} #{package}`.strip)
191
+ normalize_pkg_config_result(`#{@pkgconf} #{args} #{package}`.strip)
181
192
  end
182
193
 
183
194
  def normalize_pkg_config_result(result)
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pkg-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.7
4
+ version: 1.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
8
+ autorequire:
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 2024-10-24 00:00:00.000000000 Z
11
+ date: 2024-11-21 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: test-unit
@@ -73,6 +74,7 @@ licenses:
73
74
  - LGPLv2+
74
75
  metadata:
75
76
  msys2_mingw_dependencies: pkg-config
77
+ post_install_message:
76
78
  rdoc_options: []
77
79
  require_paths:
78
80
  - lib
@@ -87,7 +89,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
89
  - !ruby/object:Gem::Version
88
90
  version: '0'
89
91
  requirements: []
90
- rubygems_version: 3.6.0.dev
92
+ rubygems_version: 3.5.22
93
+ signing_key:
91
94
  specification_version: 4
92
95
  summary: A pkg-config implementation for Ruby
93
96
  test_files: