pkg-config 1.5.7 → 1.5.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +12 -0
- data/Rakefile +4 -0
- data/lib/pkg-config/version.rb +2 -2
- data/lib/pkg-config.rb +21 -11
- data/test/test-pkg-config.rb +16 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 568c790e6c8520f9e99712aa1589824a4338b70a7c4f2de671ba5ad5aa6a96f2
|
4
|
+
data.tar.gz: 4e98a0c87e9449d3864f433ca38f48bfaad836567eee3f9d82d60263e4d2c640
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e25b477c8c8ea1612547120a36e974a8aabf898c5dcf4fa5d4eb78b00db2ab805adc69870bcc00e2ba5a9ff10d35d4b913d6180c50fcde466ad75669afe79909
|
7
|
+
data.tar.gz: 6b774c150ea79e3d5c6122373cdf368e439ac54d15a18bae06d188a56062daaaf82f2a2b369ac0a41149d962cd4627cfe9efee771d010e772eee778e95642d00
|
data/NEWS.md
CHANGED
data/Rakefile
CHANGED
data/lib/pkg-config/version.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright 2012-
|
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.
|
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
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
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
|
-
|
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
|
data/test/test-pkg-config.rb
CHANGED
@@ -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 =
|
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
|
27
|
+
omit("Require #{@pkgconf} #{pkg_config_version} or later")
|
17
28
|
end
|
18
29
|
|
19
30
|
def test_exist?
|
20
|
-
assert(system("
|
31
|
+
assert(system("#{@pkgconf} --exists cairo"))
|
21
32
|
assert(@cairo.exist?)
|
22
33
|
|
23
|
-
assert(system("
|
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(
|
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.
|
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:
|
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.
|
90
|
+
rubygems_version: 3.6.2
|
91
91
|
specification_version: 4
|
92
92
|
summary: A pkg-config implementation for Ruby
|
93
93
|
test_files:
|