Hello community, here is the log from the commit of package rubygem-pkg-config for openSUSE:Factory checked in at 2020-02-19 12:39:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-pkg-config (Old) and /work/SRC/openSUSE:Factory/.rubygem-pkg-config.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-pkg-config" Wed Feb 19 12:39:21 2020 rev:20 rq:773834 version:1.4.1 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-pkg-config/rubygem-pkg-config.changes 2019-04-03 09:24:20.007711192 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-pkg-config.new.26092/rubygem-pkg-config.changes 2020-02-19 12:39:21.691488430 +0100 @@ -1,0 +2,46 @@ +Mon Feb 10 15:24:25 UTC 2020 - Stephan Kulow <[email protected]> + +- updated to version 1.4.1 + see installed NEWS + + == 1.4.1 - 2020-02-10 + + === Improvements + + * Added support for cycled depended .pc such as freetype2.pc and + harfbuzz.pc on PLD Linux. + [Reported by Jakub Bogusz] + + === Thanks + + * Jakub Bogusz + + == 1.4.0 - 2019-10-24 + + === Improvements + + * Improved Homebrew detection. + + == 1.3.9 - 2019-09-28 + + === Improvements + + * Added support for absolute path in Requires. + [GitHub#18][Reported by Josh Huckabee] + + === Thanks + + * Josh Huckabee + + == 1.3.8 - 2019-08-13 + + === Improvements + + * Added support for -framework on macOS. + [GitHub:ruby-gnome2/ruby-gnome2#1287][Reported by Viko] + + === Thanks + + * Viko + +------------------------------------------------------------------- Old: ---- pkg-config-1.3.7.gem New: ---- pkg-config-1.4.1.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-pkg-config.spec ++++++ --- /var/tmp/diff_new_pack.6XSIfd/_old 2020-02-19 12:39:22.463489916 +0100 +++ /var/tmp/diff_new_pack.6XSIfd/_new 2020-02-19 12:39:22.467489924 +0100 @@ -1,7 +1,7 @@ # # spec file for package rubygem-pkg-config # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,7 @@ # Name: rubygem-pkg-config -Version: 1.3.7 +Version: 1.4.1 Release: 0 %define mod_name pkg-config %define mod_full_name %{mod_name}-%{version} @@ -32,7 +32,7 @@ BuildRequires: %{rubygem gem2rpm} BuildRequires: %{ruby} BuildRequires: ruby-macros >= 5 -Url: https://github.com/ruby-gnome2/pkg-config +URL: https://github.com/ruby-gnome/pkg-config Source: https://rubygems.org/gems/%{mod_full_name}.gem Source1: gem2rpm.yml Summary: A pkg-config implementation for Ruby ++++++ pkg-config-1.3.7.gem -> pkg-config-1.4.1.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/NEWS new/NEWS --- old/NEWS 2019-03-17 06:46:23.000000000 +0100 +++ new/NEWS 2020-02-10 03:33:39.000000000 +0100 @@ -1,5 +1,45 @@ = NEWS +== 1.4.1 - 2020-02-10 + +=== Improvements + + * Added support for cycled depended .pc such as freetype2.pc and + harfbuzz.pc on PLD Linux. + [Reported by Jakub Bogusz] + +=== Thanks + + * Jakub Bogusz + +== 1.4.0 - 2019-10-24 + +=== Improvements + + * Improved Homebrew detection. + +== 1.3.9 - 2019-09-28 + +=== Improvements + + * Added support for absolute path in Requires. + [GitHub#18][Reported by Josh Huckabee] + +=== Thanks + + * Josh Huckabee + +== 1.3.8 - 2019-08-13 + +=== Improvements + + * Added support for -framework on macOS. + [GitHub:ruby-gnome2/ruby-gnome2#1287][Reported by Viko] + +=== Thanks + + * Viko + == 1.3.7 - 2019-03-17 === Improvements diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.rdoc new/README.rdoc --- old/README.rdoc 2019-03-17 06:46:23.000000000 +0100 +++ new/README.rdoc 2020-02-10 03:33:39.000000000 +0100 @@ -14,14 +14,8 @@ == Install -=== Package - # gem install pkg-config -=== No package - - # ruby setup.rb - == Documents * TODO @@ -29,11 +23,11 @@ == Source There is the pkg-config repository at GitHub: -http://github.com/rcairo/pkg-config +http://github.com/ruby-gnome/pkg-config == Copyright -Copyright 2008-2011 Kouhei Sutou <[email protected]> +Copyright 2008-2019 Kouhei Sutou <[email protected]> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/pkg-config/version.rb new/lib/pkg-config/version.rb --- old/lib/pkg-config/version.rb 2019-03-17 06:46:23.000000000 +0100 +++ new/lib/pkg-config/version.rb 2020-02-10 03:33:39.000000000 +0100 @@ -15,5 +15,5 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module PKGConfig - VERSION = "1.3.7" + VERSION = "1.4.1" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/pkg-config.rb new/lib/pkg-config.rb --- old/lib/pkg-config.rb 2019-03-17 06:46:23.000000000 +0100 +++ new/lib/pkg-config.rb 2020-02-10 03:33:39.000000000 +0100 @@ -1,4 +1,4 @@ -# Copyright 2008-2019 Kouhei Sutou <[email protected]> +# Copyright 2008-2020 Sutou Kouhei <[email protected]> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -15,15 +15,14 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA begin - require "pkg-config/version" + require_relative "pkg-config/version" rescue LoadError end +require "English" +require "pathname" require "rbconfig" - -require 'shellwords' -require 'English' -require 'pathname' +require "shellwords" class PackageConfig SEPARATOR = File::PATH_SEPARATOR @@ -122,6 +121,7 @@ def compute_native_pkg_config_prefix pkg_config = native_pkg_config return nil unless pkg_config.absolute? + return nil unless pkg_config.exist? pkg_config_prefix = pkg_config.parent.parent if File::ALT_SEPARATOR @@ -134,10 +134,19 @@ end end + attr_reader :name attr_reader :paths attr_accessor :msvc_syntax def initialize(name, options={}) - @name = name + if Pathname(name).absolute? + @pc_path = name + @path_position = 0 + @name = File.basename(@pc_path, ".*") + else + @pc_path = nil + @path_position = nil + @name = name + end @options = options path = @options[:path] || ENV["PKG_CONFIG_PATH"] @paths = [path, guess_default_path].compact.join(SEPARATOR).split(SEPARATOR) @@ -220,29 +229,63 @@ end def pc_path - @paths.each do |path| - _pc_path = File.join(path, "#{@name}.pc") - return _pc_path if File.exist?(_pc_path) + if @pc_path + return @pc_path if File.exist?(@pc_path) + else + @paths.each_with_index do |path, i| + _pc_path = File.join(path, "#{@name}.pc") + if File.exist?(_pc_path) + @path_position = i + 1 + return _pc_path + end + end end nil end + protected + def path_position + @path_position + end + + def collect_requires(processed_packages={}, &block) + packages = [] + targets = yield(self) + targets.each do |name| + next if processed_packages.key?(name) + package = self.class.new(name, @options) + processed_packages[name] = package + packages << package + packages.concat(package.collect_requires(processed_packages, &block)) + end + packages_without_self = packages.reject do |package| + package.name == @name + end + packages_without_self.uniq do |package| + package.name + end + end + private - def collect_cflags - cflags_set = [declaration("Cflags")] - cflags_set += private_required_packages.collect do |package| - self.class.new(package, @options).cflags + def sort_packages(packages) + packages.sort_by.with_index do |package, i| + [package.path_position, i] end - cflags_set += required_packages.collect do |package| - self.class.new(package, @options).cflags + end + + def collect_cflags + target_packages = sort_packages([self, *all_required_packages]) + cflags_set = [] + target_packages.each do |package| + cflags_set << package.declaration("Cflags") 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" end + path_flags = path_flags.uniq if @msvc_syntax path_flags = path_flags.collect do |flag| flag.gsub(/\A-I/, "/I") @@ -284,21 +327,19 @@ normalized_cflags end - def remove_duplicated_include_paths(path_flags) - path_flags.uniq - end - def collect_libs - all_libs = required_packages.collect do |package| - self.class.new(package, @options).libs + target_packages = sort_packages(required_packages + [self]) + libs_set = [] + target_packages.each do |package| + libs_set << package.declaration("Libs") end - 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} + all_flags = split_lib_flags(libs_set.join(" ")) + path_flags, other_flags = all_flags.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 + path_flags = path_flags.uniq if @msvc_syntax path_flags = path_flags.collect do |flag| flag.gsub(/\A-L/, "/libpath:") @@ -314,6 +355,29 @@ [path_flags, other_flags] end + def split_lib_flags(libs_command_line) + all_flags = {} + flags = [] + in_option = false + libs_command_line.gsub(/-([Ll]) /, "\\1").split.each do |arg| + if in_option + flags << arg + in_option = false + else + case arg + when /-[lL]/ + next if all_flags.key?(arg) + all_flags[arg] = true + flags << arg + in_option = true + else + flags << arg + end + end + end + flags + end + IDENTIFIER_RE = /[a-zA-Z\d_\.]+/ def parse_pc raise ".pc for #{@name} doesn't exist." unless exist? @@ -321,7 +385,7 @@ @declarations = {} File.open(pc_path) do |input| input.each_line do |line| - line = line.gsub(/#.*/, '').strip + line = line.gsub(/#.*/, "").strip next if line.empty? case line when /^(#{IDENTIFIER_RE})=/ @@ -335,7 +399,7 @@ def parse_requires(requires) return [] if requires.nil? - requires_without_version = requires.gsub(/[<>]?=\s*[\d.a-zA-Z_-]+\s*/, '') + requires_without_version = requires.gsub(/[<>]?=\s*[\d.a-zA-Z_-]+\s*/, "") requires_without_version.split(/[,\s]+/) end @@ -403,14 +467,13 @@ homebrew_repository_candidates << pkg_config_prefix + "Homebrew" homebrew_repository_candidates << pkg_config_prefix end - else - brew = self.class.__send__(:search_executable_from_path, "brew") - if brew - homebrew_repository = `brew --repository`.chomp - homebrew_repository_candidates << Pathname(homebrew_repository) - end end - homebrew_repository_candidates.each do |candidate| + brew = self.class.__send__(:search_executable_from_path, "brew") + if brew + homebrew_repository = `brew --repository`.chomp + homebrew_repository_candidates << Pathname(homebrew_repository) + end + homebrew_repository_candidates.uniq.each do |candidate| path = candidate + "Library/Homebrew/os/mac/pkgconfig/#{mac_os_version}" paths << path.to_s if path.exist? end @@ -420,21 +483,15 @@ end def required_packages - requires.reject do |package| - @name == package - end.uniq - end - - def private_required_packages - requires_private.reject do |package| - @name == package - end.uniq + collect_requires do |package| + package.requires + end end def all_required_packages - (requires_private + requires.reverse).reject do |package| - @name == package - end.uniq + collect_requires do |package| + package.requires_private + package.requires + end end def normalize_paths(paths) @@ -458,7 +515,7 @@ end def msvc? - /mswin/.match(RUBY_PLATFORM) and /^cl\b/.match(RbConfig::CONFIG['CC']) + /mswin/.match(RUBY_PLATFORM) and /^cl\b/.match(RbConfig::CONFIG["CC"]) end def package_config(package) @@ -533,18 +590,18 @@ dldflags = libs(pkg) dldflags = (Shellwords.shellwords(dldflags) - Shellwords.shellwords(libraries)) - dldflags = dldflags.map {|s| /\s/ =~ s ? "\"#{s}\"" : s }.join(' ') - $libs += ' ' + libraries + dldflags = dldflags.map {|s| /\s/ =~ s ? "\"#{s}\"" : s }.join(" ") + $libs += " " + libraries if /mswin/ =~ RUBY_PLATFORM - $DLDFLAGS += ' ' + dldflags + $DLDFLAGS += " " + dldflags else - $LDFLAGS += ' ' + dldflags + $LDFLAGS += " " + dldflags end - $CFLAGS += ' ' + cflags_only_other(pkg) + $CFLAGS += " " + cflags_only_other(pkg) if defined?($CXXFLAGS) - $CXXFLAGS += ' ' + cflags_only_other(pkg) + $CXXFLAGS += " " + cflags_only_other(pkg) end - $INCFLAGS += ' ' + cflags_only_I(pkg) + $INCFLAGS += " " + cflags_only_I(pkg) end enough_version end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2019-03-17 06:46:23.000000000 +0100 +++ new/metadata 2020-02-10 03:33:39.000000000 +0100 @@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: pkg-config version: !ruby/object:Gem::Version - version: 1.3.7 + version: 1.4.1 platform: ruby authors: - Kouhei Sutou autorequire: bindir: bin cert_chain: [] -date: 2019-03-17 00:00:00.000000000 Z +date: 2020-02-10 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: test-unit @@ -69,7 +69,7 @@ - lib/pkg-config/version.rb - test/run-test.rb - test/test_pkg_config.rb -homepage: https://github.com/ruby-gnome2/pkg-config +homepage: https://github.com/ruby-gnome/pkg-config licenses: - LGPLv2+ metadata: @@ -90,7 +90,7 @@ version: '0' requirements: [] rubyforge_project: -rubygems_version: 2.7.6 +rubygems_version: 2.7.6.2 signing_key: specification_version: 4 summary: A pkg-config implementation for Ruby diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_pkg_config.rb new/test/test_pkg_config.rb --- old/test/test_pkg_config.rb 2019-03-17 06:46:23.000000000 +0100 +++ new/test/test_pkg_config.rb 2020-02-10 03:33:39.000000000 +0100 @@ -17,10 +17,10 @@ end def test_exist? - assert(system('pkg-config --exists cairo')) + assert(system("pkg-config --exists cairo")) assert(@cairo.exist?) - assert(system('pkg-config --exists cairo-png')) + assert(system("pkg-config --exists cairo-png")) assert(@cairo_png.exist?) end @@ -36,14 +36,65 @@ assert_pkg_config("cairo-png", ["--cflags-only-I"], @cairo_png.cflags_only_I) end + def split_lib_flags(libs_command_line) + @cairo.__send__(:split_lib_flags, libs_command_line) + end + + def test_split_libs + assert_equal([ + "-L/usr/local/Cellar/gtk+3/3.24.10/lib", + "-L/usr/local/Cellar/pango/1.44.3/lib", + "-L/usr/local/Cellar/harfbuzz/2.5.3/lib", + "-L/usr/local/Cellar/gdk-pixbuf/2.38.1_1/lib", + "-L/usr/local/Cellar/cairo/1.16.0_2/lib", + "-L/usr/local/Cellar/glib/2.60.6/lib", + "-L/usr/local/opt/gettext/lib", + "-lgdk-3", + "-framework", "Cocoa", + "-framework", "Carbon", + "-framework", "CoreGraphics", + "-lpangocairo-1.0", + "-lpango-1.0", + "-lharfbuzz", + "-lgdk_pixbuf-2.0", + "-lcairo-gobject", + "-lcairo", + "-lgobject-2.0", + "-lglib-2.0", + "-lintl" + ], + split_lib_flags("-L/usr/local/Cellar/gtk+3/3.24.10/lib " + + "-L/usr/local/Cellar/pango/1.44.3/lib " + + "-L/usr/local/Cellar/harfbuzz/2.5.3/lib " + + "-L/usr/local/Cellar/gdk-pixbuf/2.38.1_1/lib " + + "-L/usr/local/Cellar/cairo/1.16.0_2/lib " + + "-L/usr/local/Cellar/glib/2.60.6/lib " + + "-L/usr/local/opt/gettext/lib " + + "-lgdk-3 " + + "-framework Cocoa " + + "-framework Carbon " + + "-framework CoreGraphics " + + "-lpangocairo-1.0 " + + "-lpango-1.0 " + + "-lharfbuzz " + + "-lgdk_pixbuf-2.0 " + + "-lcairo-gobject " + + "-lcairo " + + "-lgobject-2.0 " + + "-lglib-2.0 " + + "-lintl")) + end + def test_libs assert_pkg_config("cairo", ["--libs"], @cairo.libs) assert_pkg_config("cairo-png", ["--libs"], @cairo_png.libs) + end + def test_libs_msvc @cairo.msvc_syntax = true result = pkg_config("cairo", "--libs") msvc_result = result.gsub(/-lcairo\b/, "cairo.lib") - msvc_result = msvc_result.gsub(/-L/, '/libpath:') + msvc_result = msvc_result.gsub(/-L/, "/libpath:") assert_not_equal(msvc_result, result) assert_equal(msvc_result, @cairo.libs) end @@ -51,10 +102,12 @@ def test_libs_only_l assert_pkg_config("cairo", ["--libs-only-l"], @cairo.libs_only_l) assert_pkg_config("cairo-png", ["--libs-only-l"], @cairo_png.libs_only_l) + end + def test_libs_only_l_msvc @cairo_png.msvc_syntax = true result = pkg_config("cairo-png", "--libs-only-l") - msvc_result = result.gsub(/-l(cairo|png[0-9]+|z)\b/, '\1.lib') + msvc_result = result.gsub(/-l(cairo|png[0-9]+|z)\b/, "\\1.lib") assert_not_equal(msvc_result, result) assert_equal(msvc_result, @cairo_png.libs_only_l) end @@ -62,10 +115,12 @@ def test_libs_only_L assert_pkg_config("cairo", ["--libs-only-L"], @cairo.libs_only_L) assert_pkg_config("cairo-png", ["--libs-only-L"], @cairo_png.libs_only_L) + end + def test_libs_only_L_msvc @cairo_png.msvc_syntax = true result = pkg_config("cairo-png", "--libs-only-L") - msvc_result = result.gsub(/-L/, '/libpath:') + msvc_result = result.gsub(/-L/, "/libpath:") assert_not_equal(msvc_result, result) assert_equal(msvc_result, @cairo_png.libs_only_L) end @@ -112,7 +167,7 @@ private def pkg_config(package, *args) args.unshift("--define-variable=libdir=#{@custom_libdir}") - args = args.collect {|arg| arg.dump}.join(' ') + args = args.collect {|arg| arg.dump}.join(" ") `pkg-config #{args} #{package}`.strip end
