pkg-config 1.3.7 → 1.3.8
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 +4 -4
- data/NEWS +11 -0
- data/lib/pkg-config.rb +25 -2
- data/lib/pkg-config/version.rb +1 -1
- data/test/test_pkg_config.rb +55 -0
- 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: a47d4bf798e1d6eb5ad3c16fad3ab29dead0f05b2d41e39d98ecb3b3642ac6ea
|
|
4
|
+
data.tar.gz: 3ca7a21d13ffba40247e65134cbac57a07690c69312898af8e29fd5394616293
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 21d73b0dd4803571c903e01410c1d199297af2d3c17a5254197511285f1f1807875c70d819e06cc1b28a6158c715111be694aae997799432af1eb4c41e657aaf
|
|
7
|
+
data.tar.gz: 31a9e5bae18a521b65c6ba3b82cffb3197cd076e0318682b44b2f71c65dbd80fe40369ba09125ed3a4b2ad2ce1b9c39a11237922e798583fe94ed060bb329e06
|
data/NEWS
CHANGED
data/lib/pkg-config.rb
CHANGED
|
@@ -293,8 +293,8 @@ class PackageConfig
|
|
|
293
293
|
self.class.new(package, @options).libs
|
|
294
294
|
end
|
|
295
295
|
all_libs = [declaration("Libs")] + all_libs
|
|
296
|
-
|
|
297
|
-
path_flags, other_flags =
|
|
296
|
+
all_flags = split_lib_flags(all_libs.join(" "))
|
|
297
|
+
path_flags, other_flags = all_flags.partition {|flag| /\A-L/ =~ flag}
|
|
298
298
|
path_flags = normalize_path_flags(path_flags, "-L")
|
|
299
299
|
path_flags = path_flags.reject do |flag|
|
|
300
300
|
/\A-L\/usr\/lib(?:64|x32)?\z/ =~ flag
|
|
@@ -314,6 +314,29 @@ class PackageConfig
|
|
|
314
314
|
[path_flags, other_flags]
|
|
315
315
|
end
|
|
316
316
|
|
|
317
|
+
def split_lib_flags(libs_command_line)
|
|
318
|
+
all_flags = {}
|
|
319
|
+
flags = []
|
|
320
|
+
in_option = false
|
|
321
|
+
libs_command_line.gsub(/-([Ll]) /, '\1').split.each do |arg|
|
|
322
|
+
if in_option
|
|
323
|
+
flags << arg
|
|
324
|
+
in_option = false
|
|
325
|
+
else
|
|
326
|
+
case arg
|
|
327
|
+
when /-[lL]/
|
|
328
|
+
next if all_flags.key?(arg)
|
|
329
|
+
all_flags[arg] = true
|
|
330
|
+
flags << arg
|
|
331
|
+
in_option = true
|
|
332
|
+
else
|
|
333
|
+
flags << arg
|
|
334
|
+
end
|
|
335
|
+
end
|
|
336
|
+
end
|
|
337
|
+
flags
|
|
338
|
+
end
|
|
339
|
+
|
|
317
340
|
IDENTIFIER_RE = /[a-zA-Z\d_\.]+/
|
|
318
341
|
def parse_pc
|
|
319
342
|
raise ".pc for #{@name} doesn't exist." unless exist?
|
data/lib/pkg-config/version.rb
CHANGED
data/test/test_pkg_config.rb
CHANGED
|
@@ -36,10 +36,61 @@ class PkgConfigTest < Test::Unit::TestCase
|
|
|
36
36
|
assert_pkg_config("cairo-png", ["--cflags-only-I"], @cairo_png.cflags_only_I)
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
+
def split_lib_flags(libs_command_line)
|
|
40
|
+
@cairo.__send__(:split_lib_flags, libs_command_line)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def test_split_libs
|
|
44
|
+
assert_equal([
|
|
45
|
+
"-L/usr/local/Cellar/gtk+3/3.24.10/lib",
|
|
46
|
+
"-L/usr/local/Cellar/pango/1.44.3/lib",
|
|
47
|
+
"-L/usr/local/Cellar/harfbuzz/2.5.3/lib",
|
|
48
|
+
"-L/usr/local/Cellar/gdk-pixbuf/2.38.1_1/lib",
|
|
49
|
+
"-L/usr/local/Cellar/cairo/1.16.0_2/lib",
|
|
50
|
+
"-L/usr/local/Cellar/glib/2.60.6/lib",
|
|
51
|
+
"-L/usr/local/opt/gettext/lib",
|
|
52
|
+
"-lgdk-3",
|
|
53
|
+
"-framework", "Cocoa",
|
|
54
|
+
"-framework", "Carbon",
|
|
55
|
+
"-framework", "CoreGraphics",
|
|
56
|
+
"-lpangocairo-1.0",
|
|
57
|
+
"-lpango-1.0",
|
|
58
|
+
"-lharfbuzz",
|
|
59
|
+
"-lgdk_pixbuf-2.0",
|
|
60
|
+
"-lcairo-gobject",
|
|
61
|
+
"-lcairo",
|
|
62
|
+
"-lgobject-2.0",
|
|
63
|
+
"-lglib-2.0",
|
|
64
|
+
"-lintl"
|
|
65
|
+
],
|
|
66
|
+
split_lib_flags("-L/usr/local/Cellar/gtk+3/3.24.10/lib " +
|
|
67
|
+
"-L/usr/local/Cellar/pango/1.44.3/lib " +
|
|
68
|
+
"-L/usr/local/Cellar/harfbuzz/2.5.3/lib " +
|
|
69
|
+
"-L/usr/local/Cellar/gdk-pixbuf/2.38.1_1/lib " +
|
|
70
|
+
"-L/usr/local/Cellar/cairo/1.16.0_2/lib " +
|
|
71
|
+
"-L/usr/local/Cellar/glib/2.60.6/lib " +
|
|
72
|
+
"-L/usr/local/opt/gettext/lib " +
|
|
73
|
+
"-lgdk-3 " +
|
|
74
|
+
"-framework Cocoa " +
|
|
75
|
+
"-framework Carbon " +
|
|
76
|
+
"-framework CoreGraphics " +
|
|
77
|
+
"-lpangocairo-1.0 " +
|
|
78
|
+
"-lpango-1.0 " +
|
|
79
|
+
"-lharfbuzz " +
|
|
80
|
+
"-lgdk_pixbuf-2.0 " +
|
|
81
|
+
"-lcairo-gobject " +
|
|
82
|
+
"-lcairo " +
|
|
83
|
+
"-lgobject-2.0 " +
|
|
84
|
+
"-lglib-2.0 " +
|
|
85
|
+
"-lintl"))
|
|
86
|
+
end
|
|
87
|
+
|
|
39
88
|
def test_libs
|
|
40
89
|
assert_pkg_config("cairo", ["--libs"], @cairo.libs)
|
|
41
90
|
assert_pkg_config("cairo-png", ["--libs"], @cairo_png.libs)
|
|
91
|
+
end
|
|
42
92
|
|
|
93
|
+
def test_libs_msvc
|
|
43
94
|
@cairo.msvc_syntax = true
|
|
44
95
|
result = pkg_config("cairo", "--libs")
|
|
45
96
|
msvc_result = result.gsub(/-lcairo\b/, "cairo.lib")
|
|
@@ -51,7 +102,9 @@ class PkgConfigTest < Test::Unit::TestCase
|
|
|
51
102
|
def test_libs_only_l
|
|
52
103
|
assert_pkg_config("cairo", ["--libs-only-l"], @cairo.libs_only_l)
|
|
53
104
|
assert_pkg_config("cairo-png", ["--libs-only-l"], @cairo_png.libs_only_l)
|
|
105
|
+
end
|
|
54
106
|
|
|
107
|
+
def test_libs_only_l_msvc
|
|
55
108
|
@cairo_png.msvc_syntax = true
|
|
56
109
|
result = pkg_config("cairo-png", "--libs-only-l")
|
|
57
110
|
msvc_result = result.gsub(/-l(cairo|png[0-9]+|z)\b/, '\1.lib')
|
|
@@ -62,7 +115,9 @@ class PkgConfigTest < Test::Unit::TestCase
|
|
|
62
115
|
def test_libs_only_L
|
|
63
116
|
assert_pkg_config("cairo", ["--libs-only-L"], @cairo.libs_only_L)
|
|
64
117
|
assert_pkg_config("cairo-png", ["--libs-only-L"], @cairo_png.libs_only_L)
|
|
118
|
+
end
|
|
65
119
|
|
|
120
|
+
def test_libs_only_L_msvc
|
|
66
121
|
@cairo_png.msvc_syntax = true
|
|
67
122
|
result = pkg_config("cairo-png", "--libs-only-L")
|
|
68
123
|
msvc_result = result.gsub(/-L/, '/libpath:')
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pkg-config
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
4
|
+
version: 1.3.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kouhei Sutou
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-08-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: test-unit
|
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
90
90
|
version: '0'
|
|
91
91
|
requirements: []
|
|
92
92
|
rubyforge_project:
|
|
93
|
-
rubygems_version: 2.7.6
|
|
93
|
+
rubygems_version: 2.7.6.2
|
|
94
94
|
signing_key:
|
|
95
95
|
specification_version: 4
|
|
96
96
|
summary: A pkg-config implementation for Ruby
|