pkg-config 1.5.7 → 1.5.9

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: 0ce019f0f6ac801e5c218c7f9e721d5c428ffbef30e6bfdbae678a80c364a46b
4
- data.tar.gz: '082d9fdd2413f734de37a5573a0747a3de8d46af22c1f904452e63765edc7d6b'
3
+ metadata.gz: 568c790e6c8520f9e99712aa1589824a4338b70a7c4f2de671ba5ad5aa6a96f2
4
+ data.tar.gz: 4e98a0c87e9449d3864f433ca38f48bfaad836567eee3f9d82d60263e4d2c640
5
5
  SHA512:
6
- metadata.gz: 6d0f96d09ec77da0d85688684eeeac8dd46095eca8fa2e296080d9f2bc65b46302ab846df62bbb8ae62c9da707488b24151b5c7ae58703c7bbee269479d7b30e
7
- data.tar.gz: ceda5ab27054ea938d5136240d5005babe6cdb034ec9bf221a114419cf55a21168266b427e93b44759014458cd8851aa6c7587d74a7d2aac2535779d0d50e4f6
6
+ metadata.gz: e25b477c8c8ea1612547120a36e974a8aabf898c5dcf4fa5d4eb78b00db2ab805adc69870bcc00e2ba5a9ff10d35d4b913d6180c50fcde466ad75669afe79909
7
+ data.tar.gz: 6b774c150ea79e3d5c6122373cdf368e439ac54d15a18bae06d188a56062daaaf82f2a2b369ac0a41149d962cd4627cfe9efee771d010e772eee778e95642d00
data/NEWS.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # NEWS
2
2
 
3
+ ## 1.5.9 - 2025-01-08
4
+
5
+ ### Improvements
6
+
7
+ * Added support for `.pc` that uses UTF-8.
8
+
9
+ ## 1.5.8 - 2024-11-21
10
+
11
+ ### Improvements
12
+
13
+ * Added support for pkgconf.
14
+
3
15
  ## 1.5.7 - 2024-10-24
4
16
 
5
17
  ### Improvements
data/Rakefile CHANGED
@@ -35,3 +35,7 @@ desc "Run tests"
35
35
  task :test do
36
36
  ruby("test/run-test.rb")
37
37
  end
38
+
39
+ release_task = Rake.application["release"]
40
+ # We use Trusted Publishing.
41
+ release_task.prerequisites.delete("release:rubygem_push")
@@ -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.9"
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)
@@ -507,6 +514,9 @@ class PackageConfig
507
514
  @declarations = {}
508
515
  File.open(pc_path) do |input|
509
516
  input.each_line do |line|
517
+ if line.dup.force_encoding("UTF-8").valid_encoding?
518
+ line.force_encoding("UTF-8")
519
+ end
510
520
  line = line.gsub(/#.*/, "").strip
511
521
  next if line.empty?
512
522
  case line
@@ -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,13 @@
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.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2024-10-24 00:00:00.000000000 Z
10
+ date: 2025-01-08 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: test-unit
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  requirements: []
90
- rubygems_version: 3.6.0.dev
90
+ rubygems_version: 3.6.2
91
91
  specification_version: 4
92
92
  summary: A pkg-config implementation for Ruby
93
93
  test_files: