pkg-config 1.4.0 → 1.6.5
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/Gemfile +12 -2
- data/NEWS.md +565 -0
- data/README.rdoc +2 -10
- data/Rakefile +7 -3
- data/lib/pkg-config.rb +377 -254
- data/test/{run-test.rb → run.rb} +0 -3
- data/test/test-pkg-config.rb +347 -0
- metadata +11 -58
- data/NEWS +0 -322
- data/lib/pkg-config/version.rb +0 -19
- data/test/test_pkg_config.rb +0 -217
data/NEWS
DELETED
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
= NEWS
|
|
2
|
-
|
|
3
|
-
== 1.4.0 - 2019-10-24
|
|
4
|
-
|
|
5
|
-
=== Improvements
|
|
6
|
-
|
|
7
|
-
* Improved Homebrew detection.
|
|
8
|
-
|
|
9
|
-
== 1.3.9 - 2019-09-28
|
|
10
|
-
|
|
11
|
-
=== Improvements
|
|
12
|
-
|
|
13
|
-
* Added support for absolute path in Requires.
|
|
14
|
-
[GitHub#18][Reported by Josh Huckabee]
|
|
15
|
-
|
|
16
|
-
=== Thanks
|
|
17
|
-
|
|
18
|
-
* Josh Huckabee
|
|
19
|
-
|
|
20
|
-
== 1.3.8 - 2019-08-13
|
|
21
|
-
|
|
22
|
-
=== Improvements
|
|
23
|
-
|
|
24
|
-
* Added support for -framework on macOS.
|
|
25
|
-
[GitHub:ruby-gnome2/ruby-gnome2#1287][Reported by Viko]
|
|
26
|
-
|
|
27
|
-
=== Thanks
|
|
28
|
-
|
|
29
|
-
* Viko
|
|
30
|
-
|
|
31
|
-
== 1.3.7 - 2019-03-17
|
|
32
|
-
|
|
33
|
-
=== Improvements
|
|
34
|
-
|
|
35
|
-
* Added support for alphabet and _ only version.
|
|
36
|
-
[GitHub#17][Reported by xiejiangzhi]
|
|
37
|
-
|
|
38
|
-
=== Thanks
|
|
39
|
-
|
|
40
|
-
* xiejiangzhi
|
|
41
|
-
|
|
42
|
-
== 1.3.6 - 2019-03-09
|
|
43
|
-
|
|
44
|
-
=== Improvements
|
|
45
|
-
|
|
46
|
-
* Added support for Homebrew environment without pkg-config formula.
|
|
47
|
-
|
|
48
|
-
== 1.3.5 - 2019-03-08
|
|
49
|
-
|
|
50
|
-
=== Fixes
|
|
51
|
-
|
|
52
|
-
* Fixed MSYS2 detection installed at non standard folder.
|
|
53
|
-
[GitHub:ruby-gnome2/ruby-gnome2#1271][Reported by Simon Arnaud]
|
|
54
|
-
|
|
55
|
-
=== Thanks
|
|
56
|
-
|
|
57
|
-
* Simon Arnaud
|
|
58
|
-
|
|
59
|
-
== 1.3.4 - 2019-02-19
|
|
60
|
-
|
|
61
|
-
=== Fixes
|
|
62
|
-
|
|
63
|
-
* Fixed 32bit MinGW Ruby detection.
|
|
64
|
-
[GitHub:ruby-gnome2/ruby-gnome2#1274][Reported by noanoa07]
|
|
65
|
-
|
|
66
|
-
=== Thanks
|
|
67
|
-
|
|
68
|
-
* noanoa07
|
|
69
|
-
|
|
70
|
-
== 1.3.3 - 2019-02-10
|
|
71
|
-
|
|
72
|
-
=== Improvements
|
|
73
|
-
|
|
74
|
-
* Improved MSYS2 detection on Windows.
|
|
75
|
-
[GitHub#16][Reported by dsisnero]
|
|
76
|
-
|
|
77
|
-
=== Thanks
|
|
78
|
-
|
|
79
|
-
* dsisnero
|
|
80
|
-
|
|
81
|
-
== 1.3.2 - 2018-11-03
|
|
82
|
-
|
|
83
|
-
=== Improvements
|
|
84
|
-
|
|
85
|
-
* Added support for Ruby installed by RubyInstaller for Windows with
|
|
86
|
-
MSYS2-Devkit.
|
|
87
|
-
|
|
88
|
-
== 1.3.1 - 2018-04-28
|
|
89
|
-
|
|
90
|
-
=== Improvements
|
|
91
|
-
|
|
92
|
-
* Changed search order to find C flags.
|
|
93
|
-
[GitHub#6][Reported by HIGUCHI Daisuke]
|
|
94
|
-
* Before: Requires -> Requires.private
|
|
95
|
-
* After: Requires.private -> Requires
|
|
96
|
-
|
|
97
|
-
=== Thanks
|
|
98
|
-
|
|
99
|
-
* HIGUCHI Daisuke
|
|
100
|
-
|
|
101
|
-
== 1.3.0 - 2018-04-10
|
|
102
|
-
|
|
103
|
-
=== Improvements
|
|
104
|
-
|
|
105
|
-
* Added Ruby 2.0 on Ubuntu Trusty again.
|
|
106
|
-
|
|
107
|
-
== 1.2.9 - 2018-01-13
|
|
108
|
-
|
|
109
|
-
=== Improvements
|
|
110
|
-
|
|
111
|
-
* Added more default paths for OpenBSD.
|
|
112
|
-
[GitHub#15][Reported by clintpachl]
|
|
113
|
-
|
|
114
|
-
=== Thanks
|
|
115
|
-
|
|
116
|
-
* clintpachl
|
|
117
|
-
|
|
118
|
-
== 1.2.8 - 2017-10-19
|
|
119
|
-
|
|
120
|
-
=== Improvements
|
|
121
|
-
|
|
122
|
-
* Improved macOS environment detection.
|
|
123
|
-
[Reported by Simeon Manolov]
|
|
124
|
-
|
|
125
|
-
=== Thanks
|
|
126
|
-
|
|
127
|
-
* Simeon Manolov
|
|
128
|
-
|
|
129
|
-
== 1.2.7 - 2017-08-16
|
|
130
|
-
|
|
131
|
-
=== Improvements
|
|
132
|
-
|
|
133
|
-
* Improved Homebrew repository detection.
|
|
134
|
-
[Reported by Wyatt Kirby]
|
|
135
|
-
|
|
136
|
-
=== Thanks
|
|
137
|
-
|
|
138
|
-
* Wyatt Kirby
|
|
139
|
-
|
|
140
|
-
== 1.2.6 - 2017-08-13
|
|
141
|
-
|
|
142
|
-
=== Improvements
|
|
143
|
-
|
|
144
|
-
* Improved Homebrew repository detection.
|
|
145
|
-
|
|
146
|
-
== 1.2.5 - 2017-08-10
|
|
147
|
-
|
|
148
|
-
=== Improvements
|
|
149
|
-
|
|
150
|
-
* Supported Homebrew bundled .pc files.
|
|
151
|
-
[GitHub:rcairo/rcairo#49][Reported by choboy11]
|
|
152
|
-
|
|
153
|
-
=== Thanks
|
|
154
|
-
|
|
155
|
-
* choboy11
|
|
156
|
-
|
|
157
|
-
== 1.2.4 - 2017-08-07
|
|
158
|
-
|
|
159
|
-
=== Improvements
|
|
160
|
-
|
|
161
|
-
* Added `pkg-config` 0.29 or later compatible result support.
|
|
162
|
-
[GitHub#13][Reported by HIGUCHI Daisuke]
|
|
163
|
-
|
|
164
|
-
* test: Updated expected value for the latest cairo.
|
|
165
|
-
[GitHub#14][Patch by HIGUCHI Daisuke]
|
|
166
|
-
|
|
167
|
-
=== Thanks
|
|
168
|
-
|
|
169
|
-
* HIGUCHI Daisuke
|
|
170
|
-
|
|
171
|
-
== 1.2.3 - 2017-05-29
|
|
172
|
-
|
|
173
|
-
=== Fixes
|
|
174
|
-
|
|
175
|
-
* Supported *-mingw32 Rubies without MSYS2 again.
|
|
176
|
-
|
|
177
|
-
== 1.2.2 - 2017-05-29
|
|
178
|
-
|
|
179
|
-
=== Improvements
|
|
180
|
-
|
|
181
|
-
* Supported path normalization for MSYS2.
|
|
182
|
-
|
|
183
|
-
== 1.2.1 - 2017-05-29
|
|
184
|
-
|
|
185
|
-
=== Improvements
|
|
186
|
-
|
|
187
|
-
* Supported MSYS2.
|
|
188
|
-
|
|
189
|
-
== 1.2.0 - 2017-04-25
|
|
190
|
-
|
|
191
|
-
=== Improvements
|
|
192
|
-
|
|
193
|
-
* Supported x32 environment. [GitHub#12][Reported by Elan Ruusamäe]
|
|
194
|
-
|
|
195
|
-
=== Thanks
|
|
196
|
-
|
|
197
|
-
* Elan Ruusamäe
|
|
198
|
-
|
|
199
|
-
== 1.1.9 - 2017-04-20
|
|
200
|
-
|
|
201
|
-
* Supported C++ compiler.
|
|
202
|
-
|
|
203
|
-
== 1.1.8 - 2017-04-19
|
|
204
|
-
|
|
205
|
-
* Stopped to require mkmf.
|
|
206
|
-
|
|
207
|
-
== 1.1.7 - 2015-01-16
|
|
208
|
-
|
|
209
|
-
* Added path for FreeBSD to default paths.
|
|
210
|
-
[Reported by Hajime UMEMOTO]
|
|
211
|
-
|
|
212
|
-
=== Thanks
|
|
213
|
-
|
|
214
|
-
* Hajime UMEMOTO
|
|
215
|
-
|
|
216
|
-
== 1.1.6 - 2014/11/12
|
|
217
|
-
|
|
218
|
-
* Supported Ruby 2.1.
|
|
219
|
-
[GitHub:ruby-gnome2/ruby-gnome2#262][Reported by Steve Wills]
|
|
220
|
-
|
|
221
|
-
=== Thanks
|
|
222
|
-
|
|
223
|
-
* Steve Wills
|
|
224
|
-
|
|
225
|
-
== 1.1.5 - 2013/12/29
|
|
226
|
-
|
|
227
|
-
* Supported XQuartz.
|
|
228
|
-
[GitHub:#10][Patch by Masafumi Yokoyama]
|
|
229
|
-
|
|
230
|
-
=== Thanks
|
|
231
|
-
|
|
232
|
-
* Masafumi Yokoyama
|
|
233
|
-
|
|
234
|
-
== 1.1.4 - 2012/08/02
|
|
235
|
-
|
|
236
|
-
* Supported mswin64 as MSVC environment.
|
|
237
|
-
|
|
238
|
-
== 1.1.3 - 2012/01/29
|
|
239
|
-
|
|
240
|
-
* [GitHub #8] fix test broken by libpng version.
|
|
241
|
-
(Patch by Bohuslav Kabrda.)
|
|
242
|
-
* Used RbConfig instead of Config.
|
|
243
|
-
|
|
244
|
-
=== Thanks
|
|
245
|
-
|
|
246
|
-
* Bohuslav Kabrda
|
|
247
|
-
|
|
248
|
-
== 1.1.2 - 2011/07/04
|
|
249
|
-
|
|
250
|
-
* [GitHub #2] fix test broken.
|
|
251
|
-
(Reported by Mamoru Tasaka.)
|
|
252
|
-
* [GitHub #4] update project descripton.
|
|
253
|
-
(Patch by Antonio Terceiro.)
|
|
254
|
-
* [GitHub #4] use setup.rb instead of extconf.rb.
|
|
255
|
-
(Patch by Antonio Terceiro.)
|
|
256
|
-
* [GitHub #3] add Copyright notice to README.
|
|
257
|
-
(Suggested by Antonio Terceiro.)
|
|
258
|
-
* [GitHub #7] supported non i386 and amd64 architectures.
|
|
259
|
-
(Reported by Antonio Terceiro.)
|
|
260
|
-
|
|
261
|
-
=== Thanks
|
|
262
|
-
|
|
263
|
-
* Mamoru Tasaka
|
|
264
|
-
* Antonio Terceiro
|
|
265
|
-
|
|
266
|
-
== 1.1.1 - 2011/05/03
|
|
267
|
-
|
|
268
|
-
* [ruby-gnome-devel-en] add
|
|
269
|
-
/usr/lib/i386-linux-gnu/pkgconfig to the default paths.
|
|
270
|
-
(Reported by Andrea B.C.)
|
|
271
|
-
|
|
272
|
-
=== Thanks
|
|
273
|
-
|
|
274
|
-
* Funky Bibimba
|
|
275
|
-
|
|
276
|
-
== 1.1.0 - 2011/04/03
|
|
277
|
-
|
|
278
|
-
* [#3270846] add /usr/lib/x86_64-linux-gnu/pkgconfig to default paths.
|
|
279
|
-
(Reported by Funky Bibimbap)
|
|
280
|
-
|
|
281
|
-
=== Thanks
|
|
282
|
-
|
|
283
|
-
* Funky Bibimba
|
|
284
|
-
|
|
285
|
-
== 1.0.8 - 2011/01/30
|
|
286
|
-
|
|
287
|
-
* fix a bug that multiple PKGConfig.add_path doesn't work.
|
|
288
|
-
|
|
289
|
-
== 1.0.7 - 2010/09/30
|
|
290
|
-
|
|
291
|
-
* suppress warnings on Ruby 1.9.
|
|
292
|
-
|
|
293
|
-
== 1.0.6 - 2010/09/23
|
|
294
|
-
|
|
295
|
-
* add PKGConfig.libs_only_L.
|
|
296
|
-
|
|
297
|
-
== 1.0.5 - 2010/09/23
|
|
298
|
-
|
|
299
|
-
* suppress duplicated configure arguments processing.
|
|
300
|
-
* use mkmf.rb message functions.
|
|
301
|
-
|
|
302
|
-
== 1.0.4 - 2010/09/23
|
|
303
|
-
|
|
304
|
-
* add PKGConfig.variable.
|
|
305
|
-
|
|
306
|
-
== 1.0.3 - 2010/09/07
|
|
307
|
-
|
|
308
|
-
* add path and override_variable customize API.
|
|
309
|
-
* support description.
|
|
310
|
-
|
|
311
|
-
== 1.0.2 - 2010/09/02
|
|
312
|
-
|
|
313
|
-
* fix packaing miss.
|
|
314
|
-
|
|
315
|
-
== 1.0.1 - 2010/09/02
|
|
316
|
-
|
|
317
|
-
* support installing without gem.
|
|
318
|
-
|
|
319
|
-
== 1.0.0 - 2010/09/02
|
|
320
|
-
|
|
321
|
-
* Initial release!
|
|
322
|
-
|
data/lib/pkg-config/version.rb
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# Copyright 2012-2019 Kouhei Sutou <kou@cozmixng.org>
|
|
2
|
-
#
|
|
3
|
-
# This library is free software; you can redistribute it and/or
|
|
4
|
-
# modify it under the terms of the GNU Lesser General Public
|
|
5
|
-
# License as published by the Free Software Foundation; either
|
|
6
|
-
# version 2.1 of the License, or (at your option) any later version.
|
|
7
|
-
#
|
|
8
|
-
# This library is distributed in the hope that it will be useful,
|
|
9
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
10
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
11
|
-
# Lesser General Public License for more details.
|
|
12
|
-
#
|
|
13
|
-
# You should have received a copy of the GNU Lesser General Public
|
|
14
|
-
# License along with this library; if not, write to the Free Software
|
|
15
|
-
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
16
|
-
|
|
17
|
-
module PKGConfig
|
|
18
|
-
VERSION = "1.4.0"
|
|
19
|
-
end
|
data/test/test_pkg_config.rb
DELETED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
require "mkmf"
|
|
2
|
-
require "pkg-config"
|
|
3
|
-
|
|
4
|
-
class PkgConfigTest < Test::Unit::TestCase
|
|
5
|
-
def setup
|
|
6
|
-
@custom_libdir = "/tmp/local/lib"
|
|
7
|
-
options = {:override_variables => {"libdir" => @custom_libdir}}
|
|
8
|
-
@cairo = PackageConfig.new("cairo", options)
|
|
9
|
-
@cairo_png = PackageConfig.new("cairo-png", options)
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def only_pkg_config_version(major, minor)
|
|
13
|
-
pkg_config_version = `pkg-config --version`.chomp
|
|
14
|
-
current_major, current_minor = pkg_config_version.split(".").collect(&:to_i)
|
|
15
|
-
return if ([major, minor] <=> [current_major, current_minor]) <= 0
|
|
16
|
-
omit("Require pkg-config #{pkg_config_version} or later")
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def test_exist?
|
|
20
|
-
assert(system('pkg-config --exists cairo'))
|
|
21
|
-
assert(@cairo.exist?)
|
|
22
|
-
|
|
23
|
-
assert(system('pkg-config --exists cairo-png'))
|
|
24
|
-
assert(@cairo_png.exist?)
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def test_cflags
|
|
28
|
-
assert_pkg_config("cairo", ["--cflags"], @cairo.cflags)
|
|
29
|
-
only_pkg_config_version(0, 29)
|
|
30
|
-
assert_pkg_config("cairo-png", ["--cflags"], @cairo_png.cflags)
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def test_cflags_only_I
|
|
34
|
-
assert_pkg_config("cairo", ["--cflags-only-I"], @cairo.cflags_only_I)
|
|
35
|
-
only_pkg_config_version(0, 29)
|
|
36
|
-
assert_pkg_config("cairo-png", ["--cflags-only-I"], @cairo_png.cflags_only_I)
|
|
37
|
-
end
|
|
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
|
-
|
|
88
|
-
def test_libs
|
|
89
|
-
assert_pkg_config("cairo", ["--libs"], @cairo.libs)
|
|
90
|
-
assert_pkg_config("cairo-png", ["--libs"], @cairo_png.libs)
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
def test_libs_msvc
|
|
94
|
-
@cairo.msvc_syntax = true
|
|
95
|
-
result = pkg_config("cairo", "--libs")
|
|
96
|
-
msvc_result = result.gsub(/-lcairo\b/, "cairo.lib")
|
|
97
|
-
msvc_result = msvc_result.gsub(/-L/, '/libpath:')
|
|
98
|
-
assert_not_equal(msvc_result, result)
|
|
99
|
-
assert_equal(msvc_result, @cairo.libs)
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
def test_libs_only_l
|
|
103
|
-
assert_pkg_config("cairo", ["--libs-only-l"], @cairo.libs_only_l)
|
|
104
|
-
assert_pkg_config("cairo-png", ["--libs-only-l"], @cairo_png.libs_only_l)
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
def test_libs_only_l_msvc
|
|
108
|
-
@cairo_png.msvc_syntax = true
|
|
109
|
-
result = pkg_config("cairo-png", "--libs-only-l")
|
|
110
|
-
msvc_result = result.gsub(/-l(cairo|png[0-9]+|z)\b/, '\1.lib')
|
|
111
|
-
assert_not_equal(msvc_result, result)
|
|
112
|
-
assert_equal(msvc_result, @cairo_png.libs_only_l)
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
def test_libs_only_L
|
|
116
|
-
assert_pkg_config("cairo", ["--libs-only-L"], @cairo.libs_only_L)
|
|
117
|
-
assert_pkg_config("cairo-png", ["--libs-only-L"], @cairo_png.libs_only_L)
|
|
118
|
-
end
|
|
119
|
-
|
|
120
|
-
def test_libs_only_L_msvc
|
|
121
|
-
@cairo_png.msvc_syntax = true
|
|
122
|
-
result = pkg_config("cairo-png", "--libs-only-L")
|
|
123
|
-
msvc_result = result.gsub(/-L/, '/libpath:')
|
|
124
|
-
assert_not_equal(msvc_result, result)
|
|
125
|
-
assert_equal(msvc_result, @cairo_png.libs_only_L)
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
def test_requires
|
|
129
|
-
assert_equal([], @cairo.requires)
|
|
130
|
-
end
|
|
131
|
-
|
|
132
|
-
def test_requires_private
|
|
133
|
-
requires_private = pkg_config("cairo", "--print-requires-private")
|
|
134
|
-
expected_requires = requires_private.split(/\n/).collect do |require|
|
|
135
|
-
require.split(/\s/, 2)[0]
|
|
136
|
-
end
|
|
137
|
-
assert_equal(expected_requires,
|
|
138
|
-
@cairo.requires_private)
|
|
139
|
-
end
|
|
140
|
-
|
|
141
|
-
def test_version
|
|
142
|
-
assert_pkg_config("cairo", ["--modversion"], @cairo.version)
|
|
143
|
-
end
|
|
144
|
-
|
|
145
|
-
def test_parse_override_variables
|
|
146
|
-
assert_override_variables({}, nil)
|
|
147
|
-
assert_override_variables({"prefix" => "c:\\\\gtk-dev"},
|
|
148
|
-
"prefix=c:\\\\gtk-dev")
|
|
149
|
-
assert_override_variables({
|
|
150
|
-
"prefix" => "c:\\\\gtk-dev",
|
|
151
|
-
"includdir" => "d:\\\\gtk\\include"
|
|
152
|
-
},
|
|
153
|
-
["prefix=c:\\\\gtk-dev",
|
|
154
|
-
"includdir=d:\\\\gtk\\include"].join(","))
|
|
155
|
-
end
|
|
156
|
-
|
|
157
|
-
def test_override_variables
|
|
158
|
-
overridden_prefix = "c:\\\\gtk-dev"
|
|
159
|
-
original_prefix = @cairo.variable("prefix")
|
|
160
|
-
assert_not_equal(overridden_prefix, original_prefix)
|
|
161
|
-
with_override_variables("prefix=#{overridden_prefix}") do
|
|
162
|
-
cairo = PackageConfig.new("cairo")
|
|
163
|
-
assert_equal(overridden_prefix, cairo.variable("prefix"))
|
|
164
|
-
end
|
|
165
|
-
end
|
|
166
|
-
|
|
167
|
-
private
|
|
168
|
-
def pkg_config(package, *args)
|
|
169
|
-
args.unshift("--define-variable=libdir=#{@custom_libdir}")
|
|
170
|
-
args = args.collect {|arg| arg.dump}.join(' ')
|
|
171
|
-
`pkg-config #{args} #{package}`.strip
|
|
172
|
-
end
|
|
173
|
-
|
|
174
|
-
def assert_pkg_config(package, pkg_config_args, actual)
|
|
175
|
-
result = pkg_config(package, *pkg_config_args)
|
|
176
|
-
result = nil if result.empty?
|
|
177
|
-
assert_equal(result, actual)
|
|
178
|
-
end
|
|
179
|
-
|
|
180
|
-
def assert_override_variables(expected, override_variables)
|
|
181
|
-
with_override_variables(override_variables) do
|
|
182
|
-
cairo = PackageConfig.new("cairo")
|
|
183
|
-
assert_equal(expected, cairo.instance_variable_get("@override_variables"))
|
|
184
|
-
end
|
|
185
|
-
end
|
|
186
|
-
|
|
187
|
-
def with_override_variables(override_variables)
|
|
188
|
-
if override_variables.nil?
|
|
189
|
-
args = {}
|
|
190
|
-
else
|
|
191
|
-
args = {"--with-override-variables" => override_variables}
|
|
192
|
-
end
|
|
193
|
-
PackageConfig.clear_configure_args_cache
|
|
194
|
-
configure_args(args) do
|
|
195
|
-
yield
|
|
196
|
-
end
|
|
197
|
-
end
|
|
198
|
-
|
|
199
|
-
def configure_args(args)
|
|
200
|
-
original_configure_args = $configure_args
|
|
201
|
-
$configure_args = $configure_args.merge(args)
|
|
202
|
-
yield
|
|
203
|
-
ensure
|
|
204
|
-
$configure_args = original_configure_args
|
|
205
|
-
end
|
|
206
|
-
|
|
207
|
-
sub_test_case("#parse_requires") do
|
|
208
|
-
def parse_requires(requires)
|
|
209
|
-
@cairo.__send__(:parse_requires, requires)
|
|
210
|
-
end
|
|
211
|
-
|
|
212
|
-
def test_broken_version
|
|
213
|
-
assert_equal(["fribidi"],
|
|
214
|
-
parse_requires("fribidi >= fribidi_required_dep"))
|
|
215
|
-
end
|
|
216
|
-
end
|
|
217
|
-
end
|