[DRE-commits] [ruby-pkg-config] 09/19: New upstream version 1.2.2

Daisuke Higuchi dai at moszumanska.debian.org
Sat Jul 15 03:42:38 UTC 2017


This is an automated email from the git hooks/post-receive script.

dai pushed a commit to branch master
in repository ruby-pkg-config.

commit 804a2050a464a883b071872739a893ce65748837
Author: HIGUCHI Daisuke (VDR dai) <dai at debian.org>
Date:   Sat Jul 15 12:02:29 2017 +0900

    New upstream version 1.2.2
---
 NEWS                      |  6 ++++++
 lib/pkg-config.rb         | 19 +++++++++++++++++++
 lib/pkg-config/version.rb |  2 +-
 3 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 317bfa3..d20401d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,11 @@
 = NEWS
 
+== 1.2.2 - 2017-05-29
+
+=== Improvements
+
+  * Supported path normalization for MSYS2.
+
 == 1.2.1 - 2017-05-29
 
 === Improvements
diff --git a/lib/pkg-config.rb b/lib/pkg-config.rb
index cf0b017..60511f0 100644
--- a/lib/pkg-config.rb
+++ b/lib/pkg-config.rb
@@ -213,6 +213,7 @@ class PackageConfig
     end
     all_cflags = normalize_cflags(Shellwords.split(cflags_set.join(" ")))
     path_flags, other_flags = all_cflags.partition {|flag| /\A-I/ =~ flag}
+    path_flags = normalize_path_flags(path_flags, "-I")
     path_flags = remove_duplicated_include_paths(path_flags)
     path_flags = path_flags.reject do |flag|
       flag == "-I/usr/include"
@@ -225,6 +226,23 @@ class PackageConfig
     [path_flags, other_flags]
   end
 
+  def normalize_path_flags(path_flags, prefix)
+    path_flags.collect do |path_flag|
+      path = path_flag.sub(prefix, "")
+      case RUBY_PLATFORM
+      when "x86-mingw32"
+        unless /\A[a-z]:/i === path
+          path = Dir.glob("c:/msys{32,64,*}").first + path
+        end
+      when "x64-mingw32"
+        unless /\A[a-z]:/i === path
+          path = Dir.glob("c:/msys{64,*}").first + path
+        end
+      end
+      "#{prefix}#{path}"
+    end
+  end
+
   def normalize_cflags(cflags)
     normalized_cflags = []
     enumerator = cflags.to_enum
@@ -253,6 +271,7 @@ class PackageConfig
     all_libs = [declaration("Libs")] + all_libs
     all_libs = all_libs.join(" ").gsub(/-([Ll]) /, '\1').split.uniq
     path_flags, other_flags = all_libs.partition {|flag| /\A-L/ =~ flag}
+    path_flags = normalize_path_flags(path_flags, "-L")
     path_flags = path_flags.reject do |flag|
       /\A-L\/usr\/lib(?:64|x32)?\z/ =~ flag
     end
diff --git a/lib/pkg-config/version.rb b/lib/pkg-config/version.rb
index 7f1839f..797d747 100644
--- a/lib/pkg-config/version.rb
+++ b/lib/pkg-config/version.rb
@@ -15,5 +15,5 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
 module PKGConfig
-  VERSION = "1.2.1"
+  VERSION = "1.2.2"
 end

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-pkg-config.git



More information about the Pkg-ruby-extras-commits mailing list