pkg-config 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS +12 -0
- data/lib/pkg-config.rb +20 -19
- data/lib/pkg-config/version.rb +1 -1
- data/test/test_pkg_config.rb +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94b6c4b1e8df7f419e2faa25afd76dc8a29aa665aa0774b6ea9ff6bd8e2d5768
|
4
|
+
data.tar.gz: e885bc6fe1a7f17f01cfdff2db3822a76ae9bdafc0c299192a90f2e582634b90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5c54b359d84ce673cd8556f5124671514ce68b9f6b952652429165e43b7e9a8b35ed6834f72aab18e2d0a25c0844b74816191ac66b024c31f43a071b1bc9ef2
|
7
|
+
data.tar.gz: fd44996b5a304e03caabfd7ce55b156e6eb2b19eada66c64bab3777326263db51a3f444d651d1ba64d175172f895f9674b5e7fcb6e52e3a948fb55bee6540148
|
data/NEWS
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
= NEWS
|
2
2
|
|
3
|
+
== 1.4.1 - 2020-02-10
|
4
|
+
|
5
|
+
=== Improvements
|
6
|
+
|
7
|
+
* Added support for cycled depended .pc such as freetype2.pc and
|
8
|
+
harfbuzz.pc on PLD Linux.
|
9
|
+
[Reported by Jakub Bogusz]
|
10
|
+
|
11
|
+
=== Thanks
|
12
|
+
|
13
|
+
* Jakub Bogusz
|
14
|
+
|
3
15
|
== 1.4.0 - 2019-10-24
|
4
16
|
|
5
17
|
=== Improvements
|
data/lib/pkg-config.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright 2008-
|
1
|
+
# Copyright 2008-2020 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,15 +15,14 @@
|
|
15
15
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
16
|
|
17
17
|
begin
|
18
|
-
|
18
|
+
require_relative "pkg-config/version"
|
19
19
|
rescue LoadError
|
20
20
|
end
|
21
21
|
|
22
|
+
require "English"
|
23
|
+
require "pathname"
|
22
24
|
require "rbconfig"
|
23
|
-
|
24
|
-
require 'shellwords'
|
25
|
-
require 'English'
|
26
|
-
require 'pathname'
|
25
|
+
require "shellwords"
|
27
26
|
|
28
27
|
class PackageConfig
|
29
28
|
SEPARATOR = File::PATH_SEPARATOR
|
@@ -249,13 +248,15 @@ class PackageConfig
|
|
249
248
|
@path_position
|
250
249
|
end
|
251
250
|
|
252
|
-
def collect_requires(&block)
|
251
|
+
def collect_requires(processed_packages={}, &block)
|
253
252
|
packages = []
|
254
253
|
targets = yield(self)
|
255
254
|
targets.each do |name|
|
255
|
+
next if processed_packages.key?(name)
|
256
256
|
package = self.class.new(name, @options)
|
257
|
+
processed_packages[name] = package
|
257
258
|
packages << package
|
258
|
-
packages.concat(package.collect_requires(&block))
|
259
|
+
packages.concat(package.collect_requires(processed_packages, &block))
|
259
260
|
end
|
260
261
|
packages_without_self = packages.reject do |package|
|
261
262
|
package.name == @name
|
@@ -358,7 +359,7 @@ class PackageConfig
|
|
358
359
|
all_flags = {}
|
359
360
|
flags = []
|
360
361
|
in_option = false
|
361
|
-
libs_command_line.gsub(/-([Ll]) /,
|
362
|
+
libs_command_line.gsub(/-([Ll]) /, "\\1").split.each do |arg|
|
362
363
|
if in_option
|
363
364
|
flags << arg
|
364
365
|
in_option = false
|
@@ -384,7 +385,7 @@ class PackageConfig
|
|
384
385
|
@declarations = {}
|
385
386
|
File.open(pc_path) do |input|
|
386
387
|
input.each_line do |line|
|
387
|
-
line = line.gsub(/#.*/,
|
388
|
+
line = line.gsub(/#.*/, "").strip
|
388
389
|
next if line.empty?
|
389
390
|
case line
|
390
391
|
when /^(#{IDENTIFIER_RE})=/
|
@@ -398,7 +399,7 @@ class PackageConfig
|
|
398
399
|
|
399
400
|
def parse_requires(requires)
|
400
401
|
return [] if requires.nil?
|
401
|
-
requires_without_version = requires.gsub(/[<>]?=\s*[\d.a-zA-Z_-]+\s*/,
|
402
|
+
requires_without_version = requires.gsub(/[<>]?=\s*[\d.a-zA-Z_-]+\s*/, "")
|
402
403
|
requires_without_version.split(/[,\s]+/)
|
403
404
|
end
|
404
405
|
|
@@ -514,7 +515,7 @@ module PKGConfig
|
|
514
515
|
end
|
515
516
|
|
516
517
|
def msvc?
|
517
|
-
/mswin/.match(RUBY_PLATFORM) and /^cl\b/.match(RbConfig::CONFIG[
|
518
|
+
/mswin/.match(RUBY_PLATFORM) and /^cl\b/.match(RbConfig::CONFIG["CC"])
|
518
519
|
end
|
519
520
|
|
520
521
|
def package_config(package)
|
@@ -589,18 +590,18 @@ module PKGConfig
|
|
589
590
|
dldflags = libs(pkg)
|
590
591
|
dldflags = (Shellwords.shellwords(dldflags) -
|
591
592
|
Shellwords.shellwords(libraries))
|
592
|
-
dldflags = dldflags.map {|s| /\s/ =~ s ? "\"#{s}\"" : s }.join(
|
593
|
-
$libs +=
|
593
|
+
dldflags = dldflags.map {|s| /\s/ =~ s ? "\"#{s}\"" : s }.join(" ")
|
594
|
+
$libs += " " + libraries
|
594
595
|
if /mswin/ =~ RUBY_PLATFORM
|
595
|
-
$DLDFLAGS +=
|
596
|
+
$DLDFLAGS += " " + dldflags
|
596
597
|
else
|
597
|
-
$LDFLAGS +=
|
598
|
+
$LDFLAGS += " " + dldflags
|
598
599
|
end
|
599
|
-
$CFLAGS +=
|
600
|
+
$CFLAGS += " " + cflags_only_other(pkg)
|
600
601
|
if defined?($CXXFLAGS)
|
601
|
-
$CXXFLAGS +=
|
602
|
+
$CXXFLAGS += " " + cflags_only_other(pkg)
|
602
603
|
end
|
603
|
-
$INCFLAGS +=
|
604
|
+
$INCFLAGS += " " + cflags_only_I(pkg)
|
604
605
|
end
|
605
606
|
enough_version
|
606
607
|
end
|
data/lib/pkg-config/version.rb
CHANGED
data/test/test_pkg_config.rb
CHANGED
@@ -17,10 +17,10 @@ class PkgConfigTest < Test::Unit::TestCase
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_exist?
|
20
|
-
assert(system(
|
20
|
+
assert(system("pkg-config --exists cairo"))
|
21
21
|
assert(@cairo.exist?)
|
22
22
|
|
23
|
-
assert(system(
|
23
|
+
assert(system("pkg-config --exists cairo-png"))
|
24
24
|
assert(@cairo_png.exist?)
|
25
25
|
end
|
26
26
|
|
@@ -94,7 +94,7 @@ class PkgConfigTest < Test::Unit::TestCase
|
|
94
94
|
@cairo.msvc_syntax = true
|
95
95
|
result = pkg_config("cairo", "--libs")
|
96
96
|
msvc_result = result.gsub(/-lcairo\b/, "cairo.lib")
|
97
|
-
msvc_result = msvc_result.gsub(/-L/,
|
97
|
+
msvc_result = msvc_result.gsub(/-L/, "/libpath:")
|
98
98
|
assert_not_equal(msvc_result, result)
|
99
99
|
assert_equal(msvc_result, @cairo.libs)
|
100
100
|
end
|
@@ -107,7 +107,7 @@ class PkgConfigTest < Test::Unit::TestCase
|
|
107
107
|
def test_libs_only_l_msvc
|
108
108
|
@cairo_png.msvc_syntax = true
|
109
109
|
result = pkg_config("cairo-png", "--libs-only-l")
|
110
|
-
msvc_result = result.gsub(/-l(cairo|png[0-9]+|z)\b/,
|
110
|
+
msvc_result = result.gsub(/-l(cairo|png[0-9]+|z)\b/, "\\1.lib")
|
111
111
|
assert_not_equal(msvc_result, result)
|
112
112
|
assert_equal(msvc_result, @cairo_png.libs_only_l)
|
113
113
|
end
|
@@ -120,7 +120,7 @@ class PkgConfigTest < Test::Unit::TestCase
|
|
120
120
|
def test_libs_only_L_msvc
|
121
121
|
@cairo_png.msvc_syntax = true
|
122
122
|
result = pkg_config("cairo-png", "--libs-only-L")
|
123
|
-
msvc_result = result.gsub(/-L/,
|
123
|
+
msvc_result = result.gsub(/-L/, "/libpath:")
|
124
124
|
assert_not_equal(msvc_result, result)
|
125
125
|
assert_equal(msvc_result, @cairo_png.libs_only_L)
|
126
126
|
end
|
@@ -167,7 +167,7 @@ class PkgConfigTest < Test::Unit::TestCase
|
|
167
167
|
private
|
168
168
|
def pkg_config(package, *args)
|
169
169
|
args.unshift("--define-variable=libdir=#{@custom_libdir}")
|
170
|
-
args = args.collect {|arg| arg.dump}.join(
|
170
|
+
args = args.collect {|arg| arg.dump}.join(" ")
|
171
171
|
`pkg-config #{args} #{package}`.strip
|
172
172
|
end
|
173
173
|
|
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.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-unit
|