[DRE-commits] [ruby-cairo] 03/05: Imported Upstream version 1.12.8

Christian Hofstaedtler zeha at moszumanska.debian.org
Mon Dec 23 19:32:10 UTC 2013


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

zeha pushed a commit to branch master
in repository ruby-cairo.

commit aa087db34afe3f76650b4e0731d9d13f75ac0f0d
Author: Christian Hofstaedtler <zeha at debian.org>
Date:   Mon Dec 23 20:24:09 2013 +0100

    Imported Upstream version 1.12.8
---
 Gemfile                      |   2 +-
 NEWS                         |  38 +++++++++++++++++++++++
 README.rdoc                  |   2 +-
 Rakefile                     |  71 ++++++++++++++++++++++++++++++++++---------
 checksums.yaml.gz            | Bin 0 -> 268 bytes
 ext/cairo/rb_cairo.h         |   2 +-
 ext/cairo/rb_cairo_surface.c |   2 ++
 lib/cairo/papers.rb          |  24 +++++++++++++++
 metadata.yml                 |  49 ++++++++++++-----------------
 test/test_image_surface.rb   |  28 +++++++++++++++++
 10 files changed, 171 insertions(+), 47 deletions(-)

diff --git a/Gemfile b/Gemfile
index eee9408..2a1fdc6 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,5 +1,5 @@
 # -*- mode: ruby; coding: utf-8 -*-
 
-source "http://rubygems.org/"
+source "https://rubygems.org/"
 
 gemspec
diff --git a/NEWS b/NEWS
index 0918a38..65749c8 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,41 @@
+Release 1.12.8 (2013-12-23) Kouhei Sutou <kou at cozmixng.org>
+===========================================================
+
+Fixes
+-----
+
+  * Bundled missing libwinpthread-1.dll into gem for Windows.
+    [Reported by Masafumi Yokoyama]
+
+Thanks
+------
+
+  * Masafumi Yokoyama
+
+Release 1.12.7 (2013-12-23) Kouhei Sutou <kou at cozmixng.org>
+===========================================================
+
+Improvements
+------------
+
+  * Added paper sizes of ISO B series and JIS B series.
+    [Patch by 5.5]
+  * Added Windows binary for Ruby 2.1.0.
+  * Updated bundled cairo to 1.12.16 from 1.12.14 for Windows.
+
+Fixes
+-----
+
+  * Fixed a bug that Cairo::ImageSurface.new(cloned_data, ...)
+    changes both the original data and the cloned data.
+    [Patch by Naoyuki Hirayama]
+
+Thanks
+------
+
+  * 5.5
+  * Naoyuki Hirayama
+
 Release 1.12.6 (2013-05-24) Kouhei Sutou <kou at cozmixng.org>
 ===========================================================
 
diff --git a/README.rdoc b/README.rdoc
index a72c42f..165d964 100644
--- a/README.rdoc
+++ b/README.rdoc
@@ -12,7 +12,7 @@ http://cairographics.org/
 
 == Dependencies
 
-* ruby >= 1.8 (1.9.2 also supported!)
+* ruby >= 1.9.3 (2.0.0 also supported!)
 * cairo >= 1.2.0 (1.12.0 also supported!)
 
 == Install
diff --git a/Rakefile b/Rakefile
index 6f98d82..2d44e75 100644
--- a/Rakefile
+++ b/Rakefile
@@ -36,16 +36,27 @@ end
 
 binary_dir = File.join("vendor", "local")
 Rake::ExtensionTask.new("cairo", spec) do |ext|
+  ext.cross_platform = ["x86-mingw32"]
   ext.cross_compile = true
-  ext.cross_compiling do |spec|
-    if /mingw|mswin/ =~ spec.platform.to_s
+  ext.cross_compiling do |_spec|
+    if /mingw|mswin/ =~ _spec.platform.to_s
       binary_files = []
       Find.find(binary_dir) do |name|
         next unless File.file?(name)
         next if /\.zip\z/i =~ name
         binary_files << name
       end
-      spec.files += binary_files
+      _spec.files += binary_files
+
+      stage_path = "#{ext.tmp_dir}/#{_spec.platform}/stage"
+      binary_files.each do |binary_file|
+        stage_binary_file = "#{stage_path}/#{binary_file}"
+        stage_binary_dir = File.dirname(stage_binary_file)
+        directory stage_binary_dir
+        file stage_binary_file => [stage_binary_dir, binary_file] do
+          cp(binary_file, stage_binary_file)
+        end
+      end
     end
   end
 end
@@ -158,10 +169,32 @@ class WindowsTask
 
   private
   def define_download_task
+    define_gcc_task
     define_source_download_task
     define_build_task
   end
 
+  def define_gcc_task
+    namespace :windows do
+      namespace :gcc do
+        namespace :dll do
+          desc "Bundle GCC related DLLs"
+          task :bundle do
+            dll_names = ["libgcc_s_sjlj-1.dll", "libwinpthread-1.dll"]
+            dll_names.each do |dll_name|
+              cp(absolete_gcc_dll_path(dll_name), install_dir + "bin")
+            end
+          end
+        end
+      end
+    end
+  end
+
+  def absolete_gcc_dll_path(dll_name)
+    build_host = @packages.first.windows.build_host
+    `#{build_host}-gcc -print-file-name=#{dll_name}`.strip
+  end
+
   def define_source_download_task
     namespace :source do
       tasks = []
@@ -175,7 +208,7 @@ class WindowsTask
 
           desc "Download #{package.name} source"
           task :download => archive_path.to_s
-          tasks << (Rake.application.current_scope + ["download"]).join(":")
+          tasks << join_task_name(Rake.application.current_scope, "download")
         end
       end
       desc "Download sources"
@@ -212,15 +245,24 @@ class WindowsTask
 
           desc "Build #{package.label} package"
           task :build => built_file.to_s
-          tasks << (Rake.application.current_scope + ["build"]).join(":")
+          tasks << join_task_name(Rake.application.current_scope, "build")
         end
       end
       desc "Build packages"
-      task :build => tasks
+      task :build => ["windows:gcc:dll:bundle"] + tasks
+    end
+  end
+
+  def join_task_name(current_scope, task_name)
+    if Rake.const_defined?(:Scope)
+      current_scope.path_with_task_name(task_name)
+    else
+      (current_scope + [task_name]).join(":")
     end
   end
 
   def build(package)
+    ENV["PATH"] = ["#{install_dir}/bin", ENV["PATH"]].join(File::PATH_SEPARATOR)
     ENV["PKG_CONFIG_LIBDIR"] = "#{install_dir}/lib/pkgconfig"
     ENV["PKG_CONFIG_PATH"] = [
       ruby_glib2_pkg_config_path,
@@ -371,16 +413,16 @@ windows_task = WindowsTask.new(spec) do |task|
     },
     {
       :name => "libpng",
-      :version => "1.6.2",
-      :download_base_url => "http://sourceforge.net/projects/libpng/files/libpng16/1.6.2",
+      :version => "1.6.8",
+      :download_base_url => "http://sourceforge.net/projects/libpng/files/libpng16/1.6.8",
       :windows => {
         :built_file => "bin/libpng16-16.dll",
       },
     },
     {
       :name => "freetype",
-      :version => "2.4.12",
-      :download_base_url => "http://sourceforge.net/projects/freetype/files/freetype2/2.4.12",
+      :version => "2.5.2",
+      :download_base_url => "http://sourceforge.net/projects/freetype/files/freetype2/2.5.2",
       :compression_method => "bz2",
       :windows => {
         :built_file => "bin/libfreetype-6.dll",
@@ -400,7 +442,7 @@ windows_task = WindowsTask.new(spec) do |task|
     },
     {
       :name => "fontconfig",
-      :version => "2.10.92",
+      :version => "2.11.0",
       :download_base_url => "http://www.freedesktop.org/software/fontconfig/release",
       :compression_method => "bz2",
       :windows => {
@@ -410,14 +452,15 @@ windows_task = WindowsTask.new(spec) do |task|
           "--disable-docs",
         ],
         :patches => [
-          "fontconfig-2.10.92-disable-mktemp-s.diff",
+          "fontconfig-2.11.0-disable-mktemp-s.diff",
+          "fontconfig-2.11.0-disable-test.diff",
         ],
         :need_autoreconf => true,
       },
     },
     {
       :name => "pixman",
-      :version => "0.30.0",
+      :version => "0.32.4",
       :download_site => :cairo,
       :compression_method => "gz",
       :windows => {
@@ -426,7 +469,7 @@ windows_task = WindowsTask.new(spec) do |task|
     },
     {
       :name => "cairo",
-      :version => "1.12.14",
+      :version => "1.12.16",
       :download_site => :cairo,
       :windows => {
         :built_file => "bin/libcairo-2.dll",
diff --git a/checksums.yaml.gz b/checksums.yaml.gz
new file mode 100644
index 0000000..f1bd05f
Binary files /dev/null and b/checksums.yaml.gz differ
diff --git a/ext/cairo/rb_cairo.h b/ext/cairo/rb_cairo.h
index 011e48a..3559362 100644
--- a/ext/cairo/rb_cairo.h
+++ b/ext/cairo/rb_cairo.h
@@ -73,7 +73,7 @@ RB_CAIRO_BEGIN_DECLS
 
 #define RB_CAIRO_VERSION_MAJOR 1
 #define RB_CAIRO_VERSION_MINOR 12
-#define RB_CAIRO_VERSION_MICRO 6
+#define RB_CAIRO_VERSION_MICRO 8
 
 RB_CAIRO_VAR VALUE rb_mCairo;
 RB_CAIRO_VAR VALUE rb_cCairo_Context;
diff --git a/ext/cairo/rb_cairo_surface.c b/ext/cairo/rb_cairo_surface.c
index e14c422..44f5f24 100644
--- a/ext/cairo/rb_cairo_surface.c
+++ b/ext/cairo/rb_cairo_surface.c
@@ -935,6 +935,8 @@ cr_image_surface_create_for_data (VALUE self, VALUE rb_data, VALUE format,
 {
   unsigned char *data;
 
+  rb_data = StringValue (rb_data);
+  rb_str_modify (rb_data);
   data = (unsigned char *)StringValuePtr (rb_data);
 
   return cairo_image_surface_create_for_data (data,
diff --git a/lib/cairo/papers.rb b/lib/cairo/papers.rb
index aa66fa4..a3b2932 100644
--- a/lib/cairo/papers.rb
+++ b/lib/cairo/papers.rb
@@ -15,6 +15,30 @@ module Cairo
      [37, 52, "A9"],
      [26, 37, "A10"],
 
+     [1000, 1414 , "ISO_B0"],
+     [707, 1000 , "ISO_B1"],
+     [500, 707 , "ISO_B2"],
+     [353, 500 , "ISO_B3"],
+     [250, 353 , "ISO_B4"],
+     [176, 250 , "ISO_B5"],
+     [125, 176 , "ISO_B6"],
+     [88, 125 , "ISO_B7"],
+     [62, 88 , "ISO_B8"],
+     [44, 62 , "ISO_B9"],
+     [31, 44 , "ISO_B10"],
+
+     [1030, 1456, "JIS_B0"],
+     [728, 1030, "JIS_B1"],
+     [515, 728, "JIS_B2"],
+     [364, 515, "JIS_B3"],
+     [257, 364, "JIS_B4"],
+     [182, 257, "JIS_B5"],
+     [128, 182, "JIS_B6"],
+     [91, 128, "JIS_B7"],
+     [64, 91, "JIS_B8"],
+     [45, 64, "JIS_B9"],
+     [32, 45, "JIS_B10"],
+
      [1030, 1456, "B0"],
      [728, 1030, "B1"],
      [515, 728, "B2"],
diff --git a/metadata.yml b/metadata.yml
index c208112..ad088ba 100644
--- a/metadata.yml
+++ b/metadata.yml
@@ -1,94 +1,83 @@
 --- !ruby/object:Gem::Specification
 name: cairo
 version: !ruby/object:Gem::Version
-  version: 1.12.6
-  prerelease: 
+  version: 1.12.8
 platform: ruby
 authors:
 - Kouhei Sutou
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2013-05-24 00:00:00.000000000 Z
+date: 2013-12-23 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: pkg-config
   requirement: !ruby/object:Gem::Requirement
-    none: false
     requirements:
-    - - ! '>='
+    - - '>='
       - !ruby/object:Gem::Version
         version: '0'
   type: :runtime
   prerelease: false
   version_requirements: !ruby/object:Gem::Requirement
-    none: false
     requirements:
-    - - ! '>='
+    - - '>='
       - !ruby/object:Gem::Version
         version: '0'
 - !ruby/object:Gem::Dependency
   name: bundler
   requirement: !ruby/object:Gem::Requirement
-    none: false
     requirements:
-    - - ! '>='
+    - - '>='
       - !ruby/object:Gem::Version
         version: '0'
   type: :development
   prerelease: false
   version_requirements: !ruby/object:Gem::Requirement
-    none: false
     requirements:
-    - - ! '>='
+    - - '>='
       - !ruby/object:Gem::Version
         version: '0'
 - !ruby/object:Gem::Dependency
   name: test-unit-notify
   requirement: !ruby/object:Gem::Requirement
-    none: false
     requirements:
-    - - ! '>='
+    - - '>='
       - !ruby/object:Gem::Version
         version: '0'
   type: :development
   prerelease: false
   version_requirements: !ruby/object:Gem::Requirement
-    none: false
     requirements:
-    - - ! '>='
+    - - '>='
       - !ruby/object:Gem::Version
         version: '0'
 - !ruby/object:Gem::Dependency
   name: rake-compiler
   requirement: !ruby/object:Gem::Requirement
-    none: false
     requirements:
-    - - ! '>='
+    - - '>='
       - !ruby/object:Gem::Version
         version: '0'
   type: :development
   prerelease: false
   version_requirements: !ruby/object:Gem::Requirement
-    none: false
     requirements:
-    - - ! '>='
+    - - '>='
       - !ruby/object:Gem::Version
         version: '0'
 - !ruby/object:Gem::Dependency
   name: packnga
   requirement: !ruby/object:Gem::Requirement
-    none: false
     requirements:
-    - - ! '>='
+    - - '>='
       - !ruby/object:Gem::Version
         version: '0'
   type: :development
   prerelease: false
   version_requirements: !ruby/object:Gem::Requirement
-    none: false
     requirements:
-    - - ! '>='
+    - - '>='
       - !ruby/object:Gem::Version
         version: '0'
 description: Ruby bindings for cairo
@@ -179,33 +168,33 @@ files:
 - test/test_xml_surface.rb
 - test/test_exception.rb
 - test/test_text_cluster.rb
+- test/test_image_surface.rb
 - test/test_color.rb
 - test/test_font_options.rb
 - test/test_constants.rb
 homepage: http://cairographics.org/rcairo
 licenses:
 - Ruby's
+metadata: {}
 post_install_message: 
 rdoc_options: []
 require_paths:
 - lib
 required_ruby_version: !ruby/object:Gem::Requirement
-  none: false
   requirements:
-  - - ! '>='
+  - - '>='
     - !ruby/object:Gem::Version
       version: '0'
 required_rubygems_version: !ruby/object:Gem::Requirement
-  none: false
   requirements:
-  - - ! '>='
+  - - '>='
     - !ruby/object:Gem::Version
       version: '0'
 requirements: []
 rubyforge_project: cairo
-rubygems_version: 1.8.23
+rubygems_version: 2.0.14
 signing_key: 
-specification_version: 3
+specification_version: 4
 summary: Ruby bindings for cairo
 test_files:
 - test/test_surface.rb
@@ -228,7 +217,7 @@ test_files:
 - test/test_xml_surface.rb
 - test/test_exception.rb
 - test/test_text_cluster.rb
+- test/test_image_surface.rb
 - test/test_color.rb
 - test/test_font_options.rb
 - test/test_constants.rb
-has_rdoc: 
diff --git a/test/test_image_surface.rb b/test/test_image_surface.rb
new file mode 100644
index 0000000..9906f3e
--- /dev/null
+++ b/test/test_image_surface.rb
@@ -0,0 +1,28 @@
+require 'cairo'
+
+class ImageSurfaceTest < Test::Unit::TestCase
+  include CairoTestUtils
+
+  def test_cloned_data
+    width = 10
+    height = 10
+    original_surface = Cairo::ImageSurface.new(:a1, width, height)
+
+    original_data = original_surface.data
+    cloned_data = original_data.clone
+
+    cloned_surface = Cairo::ImageSurface.new(cloned_data,
+                                             :a1, width, height,
+                                             original_surface.stride)
+
+    Cairo::Context.new(cloned_surface) do |context|
+      context.set_source_rgb(255, 255, 255)
+      context.scale(width, height)
+      context.move_to(0, 0)
+      context.line_to(1, 1)
+      context.stroke
+    end
+
+    assert_not_equal(original_data, cloned_data)
+  end
+end

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



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