pkg-config 1.5.6 → 1.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02f5ffc55f6c6be0c817f99382bf952d6034409f5739b028df92ca7c14df81c2
4
- data.tar.gz: dff862614b13e2f884baa5d97769cce3fda34045d70f4edd7ce909eaaf14b529
3
+ metadata.gz: 718c0829414803eaf6e4b4119eedbd5635f06490e432e02b8fecd1100e471409
4
+ data.tar.gz: 00d55bbd4c8f935454a5a65a1f84a6183e04f87ed6621fb6b21145075e38b481
5
5
  SHA512:
6
- metadata.gz: 35d5915bb0394db4eedea0c7cec0f527678cca9d77ecf709aa40b764f1fcc05c51e9c9dfb916d318d800890659f4249c81e16ef92bc21edd61c620629e38208f
7
- data.tar.gz: 9bd75f5f78dd824aae20e96ff2f8e4aa221c2310d6464db465b2ae2fd319fb2969ac916659d9b22363f31220ce832a5c75bb2e552bd55d69766fa4b76b5c2d61
6
+ metadata.gz: 5333ac54f4a4ff9d9013d4f61097032bd822d8b562144b5dd79a646106fe82d0c4ae32933ba6e570a14b10198d729c442d885b782e32ab490da4998bb7930c9c
7
+ data.tar.gz: a31424703041ab85dabff217234d68dcf0d1e28418f7b6a3ec2173dfdba6cc3c565d68744adf4e8eae7140cf3775a01c180ab6667886ae7ed50c3fc465fedd5b
data/{NEWS → NEWS.md} RENAMED
@@ -1,8 +1,32 @@
1
- = NEWS
1
+ # NEWS
2
2
 
3
- == 1.5.6 - 2023-11-19
3
+ ## 1.5.8 - 2024-11-21
4
4
 
5
- === Improvements
5
+ ### Improvements
6
+
7
+ * Added support for pkgconf.
8
+
9
+ ## 1.5.7 - 2024-10-24
10
+
11
+ ### Improvements
12
+
13
+ * conda: Added support for `${CONDA_PREFIX}/share/pkgconfig`.
14
+
15
+ ### Fixes
16
+
17
+ * Fixed `Cflags` nomralization
18
+
19
+ * GH-25
20
+
21
+ * Reported by Jean byroot Boussier
22
+
23
+ ### Thanks
24
+
25
+ * Jean byroot Boussier
26
+
27
+ ## 1.5.6 - 2023-11-19
28
+
29
+ ### Improvements
6
30
 
7
31
  * Added support for "<" and ">" operators in "Requires:".
8
32
 
@@ -10,296 +34,296 @@
10
34
 
11
35
  Patch by Daisuke Fujimura
12
36
 
13
- === Thanks
37
+ ### Thanks
14
38
 
15
39
  * Daisuke Fujimura
16
40
 
17
- == 1.5.5 - 2023-09-05
41
+ ## 1.5.5 - 2023-09-05
18
42
 
19
- === Fixes
43
+ ### Fixes
20
44
 
21
45
  * Fixed a bug in 1.5.4 that success detection doesn't work.
22
46
 
23
- == 1.5.4 - 2023-09-05
47
+ ## 1.5.4 - 2023-09-05
24
48
 
25
- === Improvements
49
+ ### Improvements
26
50
 
27
51
  * Added package version to unsatisfied version is only found case.
28
52
 
29
- == 1.5.3 - 2023-08-29
53
+ ## 1.5.3 - 2023-08-29
30
54
 
31
- === Improvements
55
+ ### Improvements
32
56
 
33
57
  * Accepted spaces between "=" and ":". For example, "prefix = /usr"
34
58
  is accepted.
35
59
 
36
- == 1.5.2 - 2023-06-25
60
+ ## 1.5.2 - 2023-06-25
37
61
 
38
- === Improvements
62
+ ### Improvements
39
63
 
40
64
  * Added support for conda.
41
65
 
42
- == 1.5.1 - 2022-11-23
66
+ ## 1.5.1 - 2022-11-23
43
67
 
44
- === Improvements
68
+ ### Improvements
45
69
 
46
70
  * Improved the default search path. "/usr" in "/usr/bin/pkg-config"
47
71
  isn't used for buidling the default search path if "pkg-config
48
72
  --variable=pc_path pkg-config" is available.
49
73
  [Reported by Watson][GitHub:#22]
50
74
 
51
- == 1.5.0 - 2022-11-23
75
+ ## 1.5.0 - 2022-11-23
52
76
 
53
- === Improvements
77
+ ### Improvements
54
78
 
55
79
  * Improved the default search path. "pkg-config --variable=pc_path
56
80
  pkg-config" is used as the default search path if it's available.
57
81
  [Reported by Watson][GitHub:#22]
58
82
 
59
- == 1.4.9 - 2022-07-31
83
+ ## 1.4.9 - 2022-07-31
60
84
 
61
85
  This is a bug fix release of 1.4.8. All 1.4.8 users should be upgraded
62
86
  to 1.4.9.
63
87
 
64
- === Fixes
88
+ ### Fixes
65
89
 
66
90
  * Fixed a regression bug in 1.4.8 that PkgConfig.have_package can't
67
91
  detect nonexistent package.
68
92
 
69
- == 1.4.8 - 2022-07-30
93
+ ## 1.4.8 - 2022-07-30
70
94
 
71
- === Improvements
95
+ ### Improvements
72
96
 
73
97
  * Added support for showing found package version.
74
98
 
75
- == 1.4.7 - 2022-01-16
99
+ ## 1.4.7 - 2022-01-16
76
100
 
77
- === Improvements
101
+ ### Improvements
78
102
 
79
103
  * Added support for RubyInstaller2 3.1 or later.
80
104
  [Reported by golirev][GitHub:ruby-gnome/ruby-gnome#1457]
81
105
 
82
- === Thanks
106
+ ### Thanks
83
107
 
84
108
  * golirev
85
109
 
86
- == 1.4.6 - 2021-04-12
110
+ ## 1.4.6 - 2021-04-12
87
111
 
88
- === Improvements
112
+ ### Improvements
89
113
 
90
114
  * Improved support for .pc detection installed by Homebrew.
91
115
  [Reported by Evan Shea][GitHub:rcairo/rcairo#66]
92
116
 
93
- === Thanks
117
+ ### Thanks
94
118
 
95
119
  * Evan Shea
96
120
 
97
- == 1.4.5 - 2021-02-04
121
+ ## 1.4.5 - 2021-02-04
98
122
 
99
- === Improvements
123
+ ### Improvements
100
124
 
101
125
  * Added support for macOS 11.2.
102
126
  [Reported by Ludovic Moutury][GitHub:rcairo/rcairo#69]
103
127
 
104
- === Thanks
128
+ ### Thanks
105
129
 
106
130
  * Ludovic Moutury
107
131
 
108
- == 1.4.4 - 2020-09-23
132
+ ## 1.4.4 - 2020-09-23
109
133
 
110
- === Fixes
134
+ ### Fixes
111
135
 
112
136
  * Fixed a bug that NoMethodError instead of
113
137
  PackageConfig::NotFoundError is raised.
114
138
  [GitHub#21][Fixed by kojix2]
115
139
 
116
- === Thanks
140
+ ### Thanks
117
141
 
118
142
  * kojix2
119
143
 
120
- == 1.4.3 - 2020-09-15
144
+ ## 1.4.3 - 2020-09-15
121
145
 
122
- === Improvements
146
+ ### Improvements
123
147
 
124
148
  * Changed to use PackageConfig::NotFoundError instead of RuntimeError
125
149
  for exception on no .pc is found.
126
150
 
127
- == 1.4.2 - 2020-08-10
151
+ ## 1.4.2 - 2020-08-10
128
152
 
129
- === Improvements
153
+ ### Improvements
130
154
 
131
155
  * Added support for detecting pkgconfig path on RubyInstaller
132
156
  without "ridk exec".
133
157
 
134
- == 1.4.1 - 2020-02-10
158
+ ## 1.4.1 - 2020-02-10
135
159
 
136
- === Improvements
160
+ ### Improvements
137
161
 
138
162
  * Added support for cycled depended .pc such as freetype2.pc and
139
163
  harfbuzz.pc on PLD Linux.
140
164
  [Reported by Jakub Bogusz]
141
165
 
142
- === Thanks
166
+ ### Thanks
143
167
 
144
168
  * Jakub Bogusz
145
169
 
146
- == 1.4.0 - 2019-10-24
170
+ ## 1.4.0 - 2019-10-24
147
171
 
148
- === Improvements
172
+ ### Improvements
149
173
 
150
174
  * Improved Homebrew detection.
151
175
 
152
- == 1.3.9 - 2019-09-28
176
+ ## 1.3.9 - 2019-09-28
153
177
 
154
- === Improvements
178
+ ### Improvements
155
179
 
156
180
  * Added support for absolute path in Requires.
157
181
  [GitHub#18][Reported by Josh Huckabee]
158
182
 
159
- === Thanks
183
+ ### Thanks
160
184
 
161
185
  * Josh Huckabee
162
186
 
163
- == 1.3.8 - 2019-08-13
187
+ ## 1.3.8 - 2019-08-13
164
188
 
165
- === Improvements
189
+ ### Improvements
166
190
 
167
191
  * Added support for -framework on macOS.
168
192
  [GitHub:ruby-gnome2/ruby-gnome2#1287][Reported by Viko]
169
193
 
170
- === Thanks
194
+ ### Thanks
171
195
 
172
196
  * Viko
173
197
 
174
- == 1.3.7 - 2019-03-17
198
+ ## 1.3.7 - 2019-03-17
175
199
 
176
- === Improvements
200
+ ### Improvements
177
201
 
178
202
  * Added support for alphabet and _ only version.
179
203
  [GitHub#17][Reported by xiejiangzhi]
180
204
 
181
- === Thanks
205
+ ### Thanks
182
206
 
183
207
  * xiejiangzhi
184
208
 
185
- == 1.3.6 - 2019-03-09
209
+ ## 1.3.6 - 2019-03-09
186
210
 
187
- === Improvements
211
+ ### Improvements
188
212
 
189
213
  * Added support for Homebrew environment without pkg-config formula.
190
214
 
191
- == 1.3.5 - 2019-03-08
215
+ ## 1.3.5 - 2019-03-08
192
216
 
193
- === Fixes
217
+ ### Fixes
194
218
 
195
219
  * Fixed MSYS2 detection installed at non standard folder.
196
220
  [GitHub:ruby-gnome2/ruby-gnome2#1271][Reported by Simon Arnaud]
197
221
 
198
- === Thanks
222
+ ### Thanks
199
223
 
200
224
  * Simon Arnaud
201
225
 
202
- == 1.3.4 - 2019-02-19
226
+ ## 1.3.4 - 2019-02-19
203
227
 
204
- === Fixes
228
+ ### Fixes
205
229
 
206
230
  * Fixed 32bit MinGW Ruby detection.
207
231
  [GitHub:ruby-gnome2/ruby-gnome2#1274][Reported by noanoa07]
208
232
 
209
- === Thanks
233
+ ### Thanks
210
234
 
211
235
  * noanoa07
212
236
 
213
- == 1.3.3 - 2019-02-10
237
+ ## 1.3.3 - 2019-02-10
214
238
 
215
- === Improvements
239
+ ### Improvements
216
240
 
217
241
  * Improved MSYS2 detection on Windows.
218
242
  [GitHub#16][Reported by dsisnero]
219
243
 
220
- === Thanks
244
+ ### Thanks
221
245
 
222
246
  * dsisnero
223
247
 
224
- == 1.3.2 - 2018-11-03
248
+ ## 1.3.2 - 2018-11-03
225
249
 
226
- === Improvements
250
+ ### Improvements
227
251
 
228
252
  * Added support for Ruby installed by RubyInstaller for Windows with
229
253
  MSYS2-Devkit.
230
254
 
231
- == 1.3.1 - 2018-04-28
255
+ ## 1.3.1 - 2018-04-28
232
256
 
233
- === Improvements
257
+ ### Improvements
234
258
 
235
259
  * Changed search order to find C flags.
236
260
  [GitHub#6][Reported by HIGUCHI Daisuke]
237
261
  * Before: Requires -> Requires.private
238
262
  * After: Requires.private -> Requires
239
263
 
240
- === Thanks
264
+ ### Thanks
241
265
 
242
266
  * HIGUCHI Daisuke
243
267
 
244
- == 1.3.0 - 2018-04-10
268
+ ## 1.3.0 - 2018-04-10
245
269
 
246
- === Improvements
270
+ ### Improvements
247
271
 
248
272
  * Added Ruby 2.0 on Ubuntu Trusty again.
249
273
 
250
- == 1.2.9 - 2018-01-13
274
+ ## 1.2.9 - 2018-01-13
251
275
 
252
- === Improvements
276
+ ### Improvements
253
277
 
254
278
  * Added more default paths for OpenBSD.
255
279
  [GitHub#15][Reported by clintpachl]
256
280
 
257
- === Thanks
281
+ ### Thanks
258
282
 
259
283
  * clintpachl
260
284
 
261
- == 1.2.8 - 2017-10-19
285
+ ## 1.2.8 - 2017-10-19
262
286
 
263
- === Improvements
287
+ ### Improvements
264
288
 
265
289
  * Improved macOS environment detection.
266
290
  [Reported by Simeon Manolov]
267
291
 
268
- === Thanks
292
+ ### Thanks
269
293
 
270
294
  * Simeon Manolov
271
295
 
272
- == 1.2.7 - 2017-08-16
296
+ ## 1.2.7 - 2017-08-16
273
297
 
274
- === Improvements
298
+ ### Improvements
275
299
 
276
300
  * Improved Homebrew repository detection.
277
301
  [Reported by Wyatt Kirby]
278
302
 
279
- === Thanks
303
+ ### Thanks
280
304
 
281
305
  * Wyatt Kirby
282
306
 
283
- == 1.2.6 - 2017-08-13
307
+ ## 1.2.6 - 2017-08-13
284
308
 
285
- === Improvements
309
+ ### Improvements
286
310
 
287
311
  * Improved Homebrew repository detection.
288
312
 
289
- == 1.2.5 - 2017-08-10
313
+ ## 1.2.5 - 2017-08-10
290
314
 
291
- === Improvements
315
+ ### Improvements
292
316
 
293
317
  * Supported Homebrew bundled .pc files.
294
318
  [GitHub:rcairo/rcairo#49][Reported by choboy11]
295
319
 
296
- === Thanks
320
+ ### Thanks
297
321
 
298
322
  * choboy11
299
323
 
300
- == 1.2.4 - 2017-08-07
324
+ ## 1.2.4 - 2017-08-07
301
325
 
302
- === Improvements
326
+ ### Improvements
303
327
 
304
328
  * Added `pkg-config` 0.29 or later compatible result support.
305
329
  [GitHub#13][Reported by HIGUCHI Daisuke]
@@ -307,88 +331,88 @@ to 1.4.9.
307
331
  * test: Updated expected value for the latest cairo.
308
332
  [GitHub#14][Patch by HIGUCHI Daisuke]
309
333
 
310
- === Thanks
334
+ ### Thanks
311
335
 
312
336
  * HIGUCHI Daisuke
313
337
 
314
- == 1.2.3 - 2017-05-29
338
+ ## 1.2.3 - 2017-05-29
315
339
 
316
- === Fixes
340
+ ### Fixes
317
341
 
318
342
  * Supported *-mingw32 Rubies without MSYS2 again.
319
343
 
320
- == 1.2.2 - 2017-05-29
344
+ ## 1.2.2 - 2017-05-29
321
345
 
322
- === Improvements
346
+ ### Improvements
323
347
 
324
348
  * Supported path normalization for MSYS2.
325
349
 
326
- == 1.2.1 - 2017-05-29
350
+ ## 1.2.1 - 2017-05-29
327
351
 
328
- === Improvements
352
+ ### Improvements
329
353
 
330
354
  * Supported MSYS2.
331
355
 
332
- == 1.2.0 - 2017-04-25
356
+ ## 1.2.0 - 2017-04-25
333
357
 
334
- === Improvements
358
+ ### Improvements
335
359
 
336
360
  * Supported x32 environment. [GitHub#12][Reported by Elan Ruusamäe]
337
361
 
338
- === Thanks
362
+ ### Thanks
339
363
 
340
364
  * Elan Ruusamäe
341
365
 
342
- == 1.1.9 - 2017-04-20
366
+ ## 1.1.9 - 2017-04-20
343
367
 
344
368
  * Supported C++ compiler.
345
369
 
346
- == 1.1.8 - 2017-04-19
370
+ ## 1.1.8 - 2017-04-19
347
371
 
348
372
  * Stopped to require mkmf.
349
373
 
350
- == 1.1.7 - 2015-01-16
374
+ ## 1.1.7 - 2015-01-16
351
375
 
352
376
  * Added path for FreeBSD to default paths.
353
377
  [Reported by Hajime UMEMOTO]
354
378
 
355
- === Thanks
379
+ ### Thanks
356
380
 
357
381
  * Hajime UMEMOTO
358
382
 
359
- == 1.1.6 - 2014/11/12
383
+ ## 1.1.6 - 2014/11/12
360
384
 
361
385
  * Supported Ruby 2.1.
362
386
  [GitHub:ruby-gnome2/ruby-gnome2#262][Reported by Steve Wills]
363
387
 
364
- === Thanks
388
+ ### Thanks
365
389
 
366
390
  * Steve Wills
367
391
 
368
- == 1.1.5 - 2013/12/29
392
+ ## 1.1.5 - 2013/12/29
369
393
 
370
394
  * Supported XQuartz.
371
395
  [GitHub:#10][Patch by Masafumi Yokoyama]
372
396
 
373
- === Thanks
397
+ ### Thanks
374
398
 
375
399
  * Masafumi Yokoyama
376
400
 
377
- == 1.1.4 - 2012/08/02
401
+ ## 1.1.4 - 2012/08/02
378
402
 
379
403
  * Supported mswin64 as MSVC environment.
380
404
 
381
- == 1.1.3 - 2012/01/29
405
+ ## 1.1.3 - 2012/01/29
382
406
 
383
407
  * [GitHub #8] fix test broken by libpng version.
384
408
  (Patch by Bohuslav Kabrda.)
385
409
  * Used RbConfig instead of Config.
386
410
 
387
- === Thanks
411
+ ### Thanks
388
412
 
389
413
  * Bohuslav Kabrda
390
414
 
391
- == 1.1.2 - 2011/07/04
415
+ ## 1.1.2 - 2011/07/04
392
416
 
393
417
  * [GitHub #2] fix test broken.
394
418
  (Reported by Mamoru Tasaka.)
@@ -401,65 +425,65 @@ to 1.4.9.
401
425
  * [GitHub #7] supported non i386 and amd64 architectures.
402
426
  (Reported by Antonio Terceiro.)
403
427
 
404
- === Thanks
428
+ ### Thanks
405
429
 
406
430
  * Mamoru Tasaka
407
431
  * Antonio Terceiro
408
432
 
409
- == 1.1.1 - 2011/05/03
433
+ ## 1.1.1 - 2011/05/03
410
434
 
411
435
  * [ruby-gnome-devel-en] add
412
436
  /usr/lib/i386-linux-gnu/pkgconfig to the default paths.
413
437
  (Reported by Andrea B.C.)
414
438
 
415
- === Thanks
439
+ ### Thanks
416
440
 
417
441
  * Funky Bibimba
418
442
 
419
- == 1.1.0 - 2011/04/03
443
+ ## 1.1.0 - 2011/04/03
420
444
 
421
445
  * [#3270846] add /usr/lib/x86_64-linux-gnu/pkgconfig to default paths.
422
446
  (Reported by Funky Bibimbap)
423
447
 
424
- === Thanks
448
+ ### Thanks
425
449
 
426
450
  * Funky Bibimba
427
451
 
428
- == 1.0.8 - 2011/01/30
452
+ ## 1.0.8 - 2011/01/30
429
453
 
430
454
  * fix a bug that multiple PKGConfig.add_path doesn't work.
431
455
 
432
- == 1.0.7 - 2010/09/30
456
+ ## 1.0.7 - 2010/09/30
433
457
 
434
458
  * suppress warnings on Ruby 1.9.
435
459
 
436
- == 1.0.6 - 2010/09/23
460
+ ## 1.0.6 - 2010/09/23
437
461
 
438
462
  * add PKGConfig.libs_only_L.
439
463
 
440
- == 1.0.5 - 2010/09/23
464
+ ## 1.0.5 - 2010/09/23
441
465
 
442
466
  * suppress duplicated configure arguments processing.
443
467
  * use mkmf.rb message functions.
444
468
 
445
- == 1.0.4 - 2010/09/23
469
+ ## 1.0.4 - 2010/09/23
446
470
 
447
471
  * add PKGConfig.variable.
448
472
 
449
- == 1.0.3 - 2010/09/07
473
+ ## 1.0.3 - 2010/09/07
450
474
 
451
475
  * add path and override_variable customize API.
452
476
  * support description.
453
477
 
454
- == 1.0.2 - 2010/09/02
478
+ ## 1.0.2 - 2010/09/02
455
479
 
456
480
  * fix packaing miss.
457
481
 
458
- == 1.0.1 - 2010/09/02
482
+ ## 1.0.1 - 2010/09/02
459
483
 
460
484
  * support installing without gem.
461
485
 
462
- == 1.0.0 - 2010/09/02
486
+ ## 1.0.0 - 2010/09/02
463
487
 
464
488
  * Initial release!
465
489
 
@@ -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.6"
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)
@@ -173,6 +180,7 @@ class PackageConfig
173
180
  conda_prefix = ENV["CONDA_PREFIX"]
174
181
  if conda_prefix
175
182
  default_paths << File.join(conda_prefix, "lib", "pkgconfig")
183
+ default_paths << File.join(conda_prefix, "share", "pkgconfig")
176
184
  end
177
185
  default_paths << "/usr/local/lib64/pkgconfig"
178
186
  default_paths << "/usr/local/libx32/pkgconfig"
@@ -437,10 +445,10 @@ class PackageConfig
437
445
  begin
438
446
  loop do
439
447
  cflag = enumerator.next
440
- normalized_cflags << cflag
448
+ normalized_cflags << cflag.dup
441
449
  case cflag
442
450
  when "-I"
443
- normalized_cflags << enumerator.next
451
+ normalized_cflags.last << enumerator.next
444
452
  end
445
453
  end
446
454
  rescue StopIteration
@@ -645,7 +653,7 @@ module PKGConfig
645
653
  "yes (#{modversion(pkg)})"
646
654
  else
647
655
  if exist?(pkg)
648
- "no (#{modversion(pkg)}"
656
+ "no (#{modversion(pkg)})"
649
657
  else
650
658
  "no (nonexistent)"
651
659
  end
@@ -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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pkg-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.6
4
+ version: 1.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-18 00:00:00.000000000 Z
11
+ date: 2024-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-unit
@@ -62,7 +62,7 @@ extra_rdoc_files: []
62
62
  files:
63
63
  - Gemfile
64
64
  - LGPL-2.1
65
- - NEWS
65
+ - NEWS.md
66
66
  - README.rdoc
67
67
  - Rakefile
68
68
  - lib/pkg-config.rb
@@ -74,7 +74,7 @@ licenses:
74
74
  - LGPLv2+
75
75
  metadata:
76
76
  msys2_mingw_dependencies: pkg-config
77
- post_install_message:
77
+ post_install_message:
78
78
  rdoc_options: []
79
79
  require_paths:
80
80
  - lib
@@ -89,8 +89,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  requirements: []
92
- rubygems_version: 3.5.0.dev
93
- signing_key:
92
+ rubygems_version: 3.5.22
93
+ signing_key:
94
94
  specification_version: 4
95
95
  summary: A pkg-config implementation for Ruby
96
96
  test_files: