pkg-config 1.6.3 → 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: 53a3d87cdf57d9d78a5458eb6743ae3dd175e0760284c0ed6b885149ef3ebd53
4
- data.tar.gz: d6c27bc63a6e3191ee88b53387428cfedbced08104f8d5c71a68f6deb75a82a8
3
+ metadata.gz: 1aa00fc6e840f6d61f9d63a7455da3a9a6fd4febfb4d9909508aa5f32fcbd838
4
+ data.tar.gz: 318ecf2df122cbaa86fc972fbd32017d8afe938cc0b0dc492cf75c6d0706aaa6
5
5
  SHA512:
6
- metadata.gz: 488102c7ff0f8d6bfb6ba89d28a3db6bc98a1ecf4bcfa78df1d04020b1fede9e4517549830214fcd941832fe2db878a643951b7943b4d2edfee9d59a0777fd89
7
- data.tar.gz: b3d212d31f385b43dbf5e24d2632fc99b0523d1b1f1defc458daceae11bb4021ecfc9a3fc34e7609c3fd94638c970dc9f34e6c6f4abee14c2f1e33a6f9dc4da3
6
+ metadata.gz: 077e55fa2ddf6791ae05f24012c29bb3cdb126e713d5f07c58e204facc62885a33901cea3fd5985f4e64adfa3acab2e40a893250a0095675fea416c0b302b186
7
+ data.tar.gz: 5b0fc63366cd7dd3e41185fb35338547b407ad6a0ba0e2018e59e072a5cbc2a83ed22a23ab172e0b5a0506d07e29ce256aee5528a1c7cec01787240554483377
data/NEWS.md CHANGED
@@ -1,5 +1,17 @@
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
+
3
15
  ## 1.6.3 - 2025-08-27
4
16
 
5
17
  ### 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.3"
22
+ VERSION = "1.6.4"
23
23
 
24
24
  @@paths = []
25
25
  @@override_variables = {}
@@ -637,13 +637,18 @@ class PackageConfig
637
637
  @variables = {}
638
638
  @declarations = {}
639
639
  File.open(pc_path) do |input|
640
+ current_line = +""
640
641
  input.each_line do |line|
641
642
  if line.dup.force_encoding("UTF-8").valid_encoding?
642
643
  line.force_encoding("UTF-8")
643
644
  end
644
645
  line = line.gsub(/#.*/, "").strip
645
- next if line.empty?
646
- 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
647
652
  when /^(#{IDENTIFIER_RE})\s*=\s*/
648
653
  match = Regexp.last_match
649
654
  @variables[match[1]] = match.post_match.strip
@@ -651,6 +656,7 @@ class PackageConfig
651
656
  match = Regexp.last_match
652
657
  @declarations[match[1]] = match.post_match.strip
653
658
  end
659
+ current_line = +""
654
660
  end
655
661
  end
656
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.3
4
+ version: 1.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sutou Kouhei