[cairo-commit] rcairo ChangeLog, 1.119, 1.120 NEWS, 1.3, 1.4 pkg-config.rb, NONE, 1.1

Kouhei Sutou commit at pdx.freedesktop.org
Sat Mar 10 03:54:24 PST 2007


Committed by: kou

Update of /cvs/cairo/rcairo
In directory kemper:/tmp/cvs-serv13499

Modified Files:
	ChangeLog NEWS 
Added Files:
	pkg-config.rb 
Log Message:
* NEWS: added 1.4.1 entry.
* src/rb_cairo.c (Cairo::BINDINGS_VERSION): 1.6.0 -> 1.4.1 for
  releasing 1.4.1.
* pkg-config.rb: re-added.


Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/rcairo/ChangeLog,v
retrieving revision 1.119
retrieving revision 1.120
diff -u -d -r1.119 -r1.120
--- ChangeLog	6 Mar 2007 14:21:37 -0000	1.119
+++ ChangeLog	10 Mar 2007 11:54:17 -0000	1.120
@@ -1,3 +1,12 @@
+2007-03-10  Kouhei Sutou  <kou at cozmixng.org>
+
+	* NEWS: added 1.4.1 entry.
+
+	* pkg-config.rb: re-added.
+
+	* src/rb_cairo.c (Cairo::BINDINGS_VERSION): 1.6.0 -> 1.4.1 for
+	releasing 1.4.1.
+
 2007-03-06  Kouhei Sutou  <kou at cozmixng.org>
 
 	* src/rb_cairo.c (Cairo::BINDINGS_VERSION): 1.4.0 -> 1.6.0.

Index: NEWS
===================================================================
RCS file: /cvs/cairo/rcairo/NEWS,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- NEWS	6 Mar 2007 12:28:38 -0000	1.3
+++ NEWS	10 Mar 2007 11:54:17 -0000	1.4
@@ -1,3 +1,10 @@
+Release 1.4.1 (2007-03-10 Kouhei Sutou <kou at cozmixng.org>)
+==========================================================
+
+Features
+--------
+  * Add missing pkg-config.rb.
+
 Release 1.4.0 (2007-03-06 Kouhei Sutou <kou at cozmixng.org>)
 ==========================================================
 

--- NEW FILE: pkg-config.rb ---
#
# pkg-config.rb
#
# Wrapper of pkg-config tool.
#
# Copyright(C) 2003-2005 Ruby-GNOME2 Project.
#
# This program is licenced under the same
# license of Ruby-GNOME2.
#

require 'mkmf'
require 'shellwords'

module PKGConfig
  @@cmd = with_config('pkg-config', ENV["PKG_CONFIG"] ||  'pkg-config')
  if /mswin32/ =~ RUBY_PLATFORM and /^cl\b/ =~ Config::CONFIG['CC']
    @@cmd += ' --msvc-syntax'
  end

  @@list = {}
  `#{@@cmd} --list-all`.chomp.split(/\n/).each{|v| 
    pkg, name, desc = /(\S+?)\s+(.*?)\s-\s(.*)/.match(v).to_a[1..3]
    @@list[pkg] = [name, desc]
  }

  module_function
  def exist?(pkg)
    system("#{@@cmd} --exists #{pkg}")
  end

  def libs(pkg)
    `#{@@cmd} --libs #{pkg}`.chomp
  end

  def libs_only_L(pkg)
    `#{@@cmd} --libs-only-L #{pkg}`.chomp
  end

  def libs_only_l(pkg)
    `#{@@cmd} --libs-only-l #{pkg}`.chomp
  end

  def cflags(pkg)
    `#{@@cmd} --cflags #{pkg}`.chomp
  end

  def cflags_only_I(pkg)
    `#{@@cmd} --cflags-only-I #{pkg}`.chomp
  end

  def cflags_only_other(pkg)
    `#{@@cmd} --cflags-only-other #{pkg}`.chomp
  end

  def variable(pkg, var)
    `#{@@cmd} --variable=#{var} #{pkg}`.chomp
  end

  def modversion(pkg)
    `#{@@cmd} --modversion #{pkg}`.chomp
  end

  def version
    `#{@@cmd} --version`.chomp
  end

  def list_all
    # Returns [pkg, name, description]
    @@list.keys.collect{|key| [key] + @@list[key]}.sort
  end

  def name(pkg)
    @@list[pkg][0]
  end

  def description(pkg)
    @@list[pkg][1]
  end

  def provides(pkg)
    `#{@@cmd} --print-provides #{pkg}`.chomp
  end

  def requires(pkg)
    `#{@@cmd} --print-requires #{pkg}`.chomp.gsub("\n", ", ") 
  end

  def check_version?(pkg, major = 0, minor = 0, micro = 0)
    return false unless exist?(pkg)
    ver = modversion(pkg).split(".").collect{|item| item.to_i}
    (0..2).each {|i| ver[i] = 0 unless ver[i]}

    (ver[0] > major ||
     (ver[0] == major && ver[1] > minor) ||
     (ver[0] == major && ver[1] == minor &&
      ver[2] >= micro))
  end

  def have_package(pkg, major = nil, minor = 0, micro = 0)
    if major.nil?
      STDOUT.print("checking for #{pkg}... ")
    else
      STDOUT.print("checking for #{pkg} version (>= #{major}.#{minor}.#{micro})... ")
    end
    major ||= 0
    STDOUT.flush
    if check_version?(pkg, major, minor, micro)
      STDOUT.print "yes\n"
      libraries = libs_only_l(pkg)
      dldflags = libs(pkg)
      dldflags = (Shellwords.shellwords(dldflags) - Shellwords.shellwords(libraries)).map{|s| /\s/ =~ s ? "\"#{s}\"" : s }.join(' ')
      $libs   += ' ' + libraries
      if /mswin32/ =~ RUBY_PLATFORM
	$DLDFLAGS += ' ' + dldflags
      else
	$LDFLAGS += ' ' + dldflags
      end
      $CFLAGS += ' ' + cflags(pkg)
      true
    else
      STDOUT.print "no\n"
      false
    end
  end
end



More information about the cairo-commit mailing list