pkg-config 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d606c8e484eaba6b266086bb721c1fd7297b00e
4
- data.tar.gz: '09e2b18fc2306f19c6f8c279a13e93544e5410e7'
3
+ metadata.gz: b047ecbdb15bee5ee7c7449fe449e1ba07bd32fc
4
+ data.tar.gz: 9c4721757a5e4f42f35630a094a7e411c05bc72b
5
5
  SHA512:
6
- metadata.gz: d19603dcfa45ad565d3a74dcd8ecb819afcf0e486afe67fbb4d716b06e8cf63e3bff5a0b32e8c185fb0ea34fc62c3866a69d49b7be97c1f3c6b8e142de4c5edd
7
- data.tar.gz: 9b7acfbe20f12f8fb52fe877d7f54104dcb894fa5bb178fd1b451ee3e1b11ff489ba904695b17aea34e892c57cb394984163527bd31537e0d116825d7e5407d6
6
+ metadata.gz: 3e0769d5c077a77512f8380714168858fc65e24a79c617719163c3f216e4b32f884821fe8969d1d1dfd20e46893ed1cd086f6330fbb9cfa760e11360bc74b61b
7
+ data.tar.gz: c25e658f05214807fdbf13ebe2c15e803416bbe0bad8b6ec8ac3bee588ab869e178c4cfb10376c49858f3beceb7fac83a84eeb21abdfbad27d1751173cd80131
data/NEWS CHANGED
@@ -1,5 +1,11 @@
1
1
  = NEWS
2
2
 
3
+ == 1.2.2 - 2017-05-29
4
+
5
+ === Improvements
6
+
7
+ * Supported path normalization for MSYS2.
8
+
3
9
  == 1.2.1 - 2017-05-29
4
10
 
5
11
  === Improvements
data/lib/pkg-config.rb CHANGED
@@ -213,6 +213,7 @@ class PackageConfig
213
213
  end
214
214
  all_cflags = normalize_cflags(Shellwords.split(cflags_set.join(" ")))
215
215
  path_flags, other_flags = all_cflags.partition {|flag| /\A-I/ =~ flag}
216
+ path_flags = normalize_path_flags(path_flags, "-I")
216
217
  path_flags = remove_duplicated_include_paths(path_flags)
217
218
  path_flags = path_flags.reject do |flag|
218
219
  flag == "-I/usr/include"
@@ -225,6 +226,23 @@ class PackageConfig
225
226
  [path_flags, other_flags]
226
227
  end
227
228
 
229
+ def normalize_path_flags(path_flags, prefix)
230
+ path_flags.collect do |path_flag|
231
+ path = path_flag.sub(prefix, "")
232
+ case RUBY_PLATFORM
233
+ when "x86-mingw32"
234
+ unless /\A[a-z]:/i === path
235
+ path = Dir.glob("c:/msys{32,64,*}").first + path
236
+ end
237
+ when "x64-mingw32"
238
+ unless /\A[a-z]:/i === path
239
+ path = Dir.glob("c:/msys{64,*}").first + path
240
+ end
241
+ end
242
+ "#{prefix}#{path}"
243
+ end
244
+ end
245
+
228
246
  def normalize_cflags(cflags)
229
247
  normalized_cflags = []
230
248
  enumerator = cflags.to_enum
@@ -253,6 +271,7 @@ class PackageConfig
253
271
  all_libs = [declaration("Libs")] + all_libs
254
272
  all_libs = all_libs.join(" ").gsub(/-([Ll]) /, '\1').split.uniq
255
273
  path_flags, other_flags = all_libs.partition {|flag| /\A-L/ =~ flag}
274
+ path_flags = normalize_path_flags(path_flags, "-L")
256
275
  path_flags = path_flags.reject do |flag|
257
276
  /\A-L\/usr\/lib(?:64|x32)?\z/ =~ flag
258
277
  end
@@ -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.2.1"
18
+ VERSION = "1.2.2"
19
19
  end
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.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou