pkg-config 1.6.2 → 1.6.4

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: a7e1cf5d660f2266bd2b7b33b4bea74f886eaf24018e6381ece093e3175fc9cc
4
- data.tar.gz: 5297a48889e115f5f08a508eaf3bd43e409d56ea19354f6d8817b31422cc3106
3
+ metadata.gz: 1aa00fc6e840f6d61f9d63a7455da3a9a6fd4febfb4d9909508aa5f32fcbd838
4
+ data.tar.gz: 318ecf2df122cbaa86fc972fbd32017d8afe938cc0b0dc492cf75c6d0706aaa6
5
5
  SHA512:
6
- metadata.gz: 18f13c71bc84f415e69190fca6eb0518242896c4606fa56f585ced55cad394d2d5d8916fa098a978418736b145959c332056597be5570598e7fb94bd2e891c53
7
- data.tar.gz: 2e88e75e57d264b56a756dd720a504f8138ecdced79ecde4358915a394793cfe7b4030bdf6e9c2bb9ad433d6566bad33efd588bd250abe4133a9fcee968114b5
6
+ metadata.gz: 077e55fa2ddf6791ae05f24012c29bb3cdb126e713d5f07c58e204facc62885a33901cea3fd5985f4e64adfa3acab2e40a893250a0095675fea416c0b302b186
7
+ data.tar.gz: 5b0fc63366cd7dd3e41185fb35338547b407ad6a0ba0e2018e59e072a5cbc2a83ed22a23ab172e0b5a0506d07e29ce256aee5528a1c7cec01787240554483377
data/NEWS.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # NEWS
2
2
 
3
+ ## 1.6.4 - 2025-09-03
4
+
5
+ ### Improvements
6
+
7
+ * Added support for continuous line.
8
+ * [ruby-gnome/ruby-gnome#1686](https://github.com/ruby-gnome/ruby-gnome/issues/1686)
9
+ * Reported by Vincent Garrigues
10
+
11
+ ### Thanks
12
+
13
+ * Vincent Garrigues
14
+
15
+ ## 1.6.3 - 2025-08-27
16
+
17
+ ### Improvements
18
+
19
+ * Added support for detecting Homebrew's pkgconfig path by `brew
20
+ --path`.
21
+ * [ruby-gnome/pkg-config#36](https://github.com/ruby-gnome/pkg-config/issues/36)
22
+ * Patch by meredith
23
+
24
+ ### Thanks
25
+
26
+ * meredith
27
+
3
28
  ## 1.6.2 - 2025-04-27
4
29
 
5
30
  ### Improvements
data/lib/pkg-config.rb CHANGED
@@ -19,7 +19,7 @@ require "rbconfig"
19
19
  require "shellwords"
20
20
 
21
21
  module PKGConfig
22
- VERSION = "1.6.2"
22
+ VERSION = "1.6.4"
23
23
 
24
24
  @@paths = []
25
25
  @@override_variables = {}
@@ -343,6 +343,11 @@ class PackageConfig
343
343
  homebrew_repository_candidates <<
344
344
  Pathname(homebrew_repository.strip)
345
345
  end
346
+ homebrew_prefix = run_command("brew", "--prefix")
347
+ if homebrew_prefix
348
+ homebrew_repository_candidates <<
349
+ Pathname(homebrew_prefix.strip)
350
+ end
346
351
  end
347
352
  homebrew_repository_candidates.uniq.each do |candidate|
348
353
  mac_pkgconfig_base_path =
@@ -632,13 +637,18 @@ class PackageConfig
632
637
  @variables = {}
633
638
  @declarations = {}
634
639
  File.open(pc_path) do |input|
640
+ current_line = +""
635
641
  input.each_line do |line|
636
642
  if line.dup.force_encoding("UTF-8").valid_encoding?
637
643
  line.force_encoding("UTF-8")
638
644
  end
639
645
  line = line.gsub(/#.*/, "").strip
640
- next if line.empty?
641
- case line
646
+ if line.end_with?("\\")
647
+ current_line += line[0..-2]
648
+ next
649
+ end
650
+ current_line += line
651
+ case current_line
642
652
  when /^(#{IDENTIFIER_RE})\s*=\s*/
643
653
  match = Regexp.last_match
644
654
  @variables[match[1]] = match.post_match.strip
@@ -646,6 +656,7 @@ class PackageConfig
646
656
  match = Regexp.last_match
647
657
  @declarations[match[1]] = match.post_match.strip
648
658
  end
659
+ current_line = +""
649
660
  end
650
661
  end
651
662
  end
@@ -1,4 +1,6 @@
1
1
  require "mkmf"
2
+ require "tempfile"
3
+
2
4
  require "pkg-config"
3
5
 
4
6
  class PkgConfigTest < Test::Unit::TestCase
@@ -227,6 +229,56 @@ class PkgConfigTest < Test::Unit::TestCase
227
229
  $configure_args = original_configure_args
228
230
  end
229
231
 
232
+ sub_test_case("#parse_pc") do
233
+ def parse_pc(content)
234
+ Tempfile.create(["pkg-config", ".pc"]) do |file|
235
+ file.puts(content)
236
+ file.close
237
+ package_config = PackageConfig.new(file.path)
238
+ package_config.__send__(:parse_pc)
239
+ [
240
+ package_config.instance_variable_get(:@variables),
241
+ package_config.instance_variable_get(:@declarations),
242
+ ]
243
+ end
244
+ end
245
+
246
+ def test_continuous_line
247
+ assert_equal([
248
+ {
249
+ "prefix" => "/usr/local",
250
+ "libdir" => "/usr/local/lib",
251
+ "includedir" => "/usr/local/include",
252
+ },
253
+ {
254
+ "Name" => "my-package",
255
+ "Description" => "This is my package",
256
+ "Version" => "1.0.0",
257
+ "Requires" => "glib-2.0 >= 2.72 gobject-2.0 >= 2.72",
258
+ "Requires.private" => "gio-2.0 >= 2.72 " +
259
+ " cairo",
260
+ "Libs" => "-L${libdir} -lmy-package",
261
+ "Cflags" => "-I${includedir}/my-package",
262
+ },
263
+ ],
264
+ parse_pc(<<-PC))
265
+ prefix=/usr/local
266
+ libdir=/usr/local/lib
267
+ includedir=/usr/local/include
268
+
269
+ Name: my-package
270
+ Description: This is my package
271
+ Version: 1.0.0
272
+ Requires: glib-2.0 >= 2.72 gobject-2.0 >= 2.72
273
+ Requires.private: gio-2.0 >= 2.72 \
274
+ cairo
275
+
276
+ Libs: -L${libdir} -lmy-package
277
+ Cflags: -I${includedir}/my-package
278
+ PC
279
+ end
280
+ end
281
+
230
282
  sub_test_case("#parse_requires") do
231
283
  def parse_requires(requires)
232
284
  @glib.__send__(:parse_requires, requires)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pkg-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sutou Kouhei
@@ -44,7 +44,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
44
44
  - !ruby/object:Gem::Version
45
45
  version: '0'
46
46
  requirements: []
47
- rubygems_version: 3.6.7
47
+ rubygems_version: 3.6.9
48
48
  specification_version: 4
49
49
  summary: A pkg-config implementation for Ruby
50
50
  test_files: