cairo 1.15.5 → 1.15.6

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: 545be4c560e22983be8169429b783e70c01c1855
4
- data.tar.gz: 7ae533f9a6fd0dcae742c78408439cce5007c91a
3
+ metadata.gz: 007c7489fb46c312b9c375faf51671f0825bc671
4
+ data.tar.gz: 52c3bc6c7da0bc6f7cba623bf18b057660b10923
5
5
  SHA512:
6
- metadata.gz: c09cb5a5e95657a0a8f86673fe00f3f095bf08d89c27bffd5e0fd7dbfaa1067f12c46a5a796e1dc5f6fde63a458e945ab614826e34e671a6b17c0ad5614eba19
7
- data.tar.gz: 4b73469f19cb8d4162ce5be0bca482e85d5954b1729e903dbcdb69e97c6abf2f5475ade9879ac9309e96dddb23b403ee91955b5dd178e93f72656f36380fc0cd
6
+ metadata.gz: e9b828ee8dd0ddc26e23b0776cd74370dc7e75df0eba637ce735e02014f83515e4e87faf6be649f0d2bf96319ff793f5de03e3ba14a33be6ddc4329e545bcd3a
7
+ data.tar.gz: 675d66af657fd007ef68b5fe53710072d5f49b6eca5dbc43727624922ac53dd339f957c11b1c6c97c7bdfda68464cac9d8d48dda64349263cec2e5b87f4c13db
data/NEWS CHANGED
@@ -1,3 +1,16 @@
1
+ Release 1.15.6 (2017-04-27) Kouhei Sutou <kou@cozmixng.org>
2
+ ===========================================================
3
+
4
+ Improvements
5
+ ------------
6
+
7
+ * Added Cairo::Context#refrence_count.
8
+ * Windows: Update bundled libraries:
9
+ * zlib: 1.2.10 -> 1.2.11
10
+ * libpng: 1.6.27 -> 1.6.29
11
+ * FreeType: 2.7 -> 2.7.1
12
+ * Used native-package-installer gem.
13
+
1
14
  Release 1.15.5 (2017-01-14) Kouhei Sutou <kou@cozmixng.org>
2
15
  ===========================================================
3
16
 
data/Rakefile CHANGED
@@ -442,8 +442,8 @@ windows_task = WindowsTask.new(spec) do |task|
442
442
  task.packages = [
443
443
  {
444
444
  :name => "zlib",
445
- :version => "1.2.10",
446
- :download_base_url => "https://downloads.sourceforge.net/project/libpng/zlib/1.2.10",
445
+ :version => "1.2.11",
446
+ :download_base_url => "https://downloads.sourceforge.net/project/libpng/zlib/1.2.11",
447
447
  :compression_method => "gz",
448
448
  :windows => {
449
449
  :builder => ZlibBuilder.new,
@@ -452,16 +452,16 @@ windows_task = WindowsTask.new(spec) do |task|
452
452
  },
453
453
  {
454
454
  :name => "libpng",
455
- :version => "1.6.27",
456
- :download_base_url => "https://downloads.sourceforge.net/project/libpng/libpng16/1.6.27",
455
+ :version => "1.6.29",
456
+ :download_base_url => "https://downloads.sourceforge.net/project/libpng/libpng16/1.6.29",
457
457
  :windows => {
458
458
  :built_file => "bin/libpng16-16.dll",
459
459
  },
460
460
  },
461
461
  {
462
462
  :name => "freetype",
463
- :version => "2.7",
464
- :download_base_url => "https://downloads.sourceforge.net/project/freetype/freetype2/2.7",
463
+ :version => "2.7.1",
464
+ :download_base_url => "https://downloads.sourceforge.net/project/freetype/freetype2/2.7.1",
465
465
  :compression_method => "bz2",
466
466
  :windows => {
467
467
  :built_file => "bin/libfreetype-7.dll",
@@ -6,12 +6,8 @@ require 'English'
6
6
  require 'mkmf'
7
7
  require 'fileutils'
8
8
 
9
- begin
10
- require 'pkg-config'
11
- rescue LoadError
12
- require 'rubygems'
13
- require 'pkg-config'
14
- end
9
+ require "pkg-config"
10
+ require "native-package-installer"
15
11
 
16
12
  checking_for(checking_message("GCC")) do
17
13
  if macro_defined?("__GNUC__", "")
@@ -47,119 +43,6 @@ checking_for(checking_message("Win32 OS")) do
47
43
  end
48
44
  end
49
45
 
50
- def package_platform
51
- if File.exist?("/etc/debian_version")
52
- :debian
53
- elsif File.exist?("/etc/fedora-release")
54
- :fedora
55
- elsif File.exist?("/etc/redhat-release")
56
- :redhat
57
- elsif find_executable("brew")
58
- :homebrew
59
- elsif find_executable("port")
60
- :macports
61
- else
62
- :unknown
63
- end
64
- end
65
-
66
- def super_user?
67
- Process.uid.zero?
68
- end
69
-
70
- def normalize_native_package_info(native_package_info)
71
- native_package_info ||= {}
72
- native_package_info = native_package_info.dup
73
- native_package_info[:fedora] ||= native_package_info[:redhat]
74
- native_package_info
75
- end
76
-
77
- def install_missing_native_package(native_package_info)
78
- platform = package_platform
79
- native_package_info = normalize_native_package_info(native_package_info)
80
- package = native_package_info[platform]
81
- return false if package.nil?
82
-
83
- need_super_user_priviledge = true
84
- case platform
85
- when :debian
86
- install_command = "apt-get install -V -y #{package}"
87
- when :fedora, :redhat
88
- install_command = "yum install -y #{package}"
89
- when :homebrew
90
- need_super_user_priviledge = false
91
- install_command = "brew install #{package}"
92
- when :macports
93
- install_command = "port install -y #{package}"
94
- else
95
- return false
96
- end
97
-
98
- have_priviledge = (not need_super_user_priviledge or super_user?)
99
- unless have_priviledge
100
- sudo = find_executable("sudo")
101
- end
102
-
103
- installing_message = "installing '#{package}' native package... "
104
- message("%s", installing_message)
105
- failed_to_get_super_user_priviledge = false
106
-
107
- succeeded = false
108
- execution_result = ""
109
- File.open("mkmf.log") do |log|
110
- log.seek(0, IO::SEEK_END)
111
- if have_priviledge
112
- succeeded = xsystem(install_command)
113
- else
114
- if sudo
115
- install_command = "#{sudo} #{install_command}"
116
- succeeded = xsystem(install_command)
117
- else
118
- succeeded = false
119
- failed_to_get_super_user_priviledge = true
120
- end
121
- end
122
- executed_command_line = log.gets
123
- execution_result = log.read
124
- end
125
-
126
- if failed_to_get_super_user_priviledge
127
- result_message = "require super user privilege"
128
- else
129
- result_message = succeeded ? "succeeded" : "failed"
130
- end
131
- Logging.postpone do
132
- "#{installing_message}#{result_message}\n"
133
- end
134
- message("#{result_message}\n")
135
-
136
- error_message = nil
137
- unless succeeded
138
- if failed_to_get_super_user_priviledge
139
- error_message = <<-EOM
140
- '#{package}' native package is required.
141
- Run the following command as super user to install required native package:
142
- \# #{install_command}
143
- EOM
144
- else
145
- error_message = <<-EOM
146
- Failed to run '#{install_command}':
147
- --
148
- #{execution_result.chomp}
149
- --
150
- EOM
151
- end
152
- end
153
- if error_message
154
- message("%s", error_message)
155
- Logging.message("%s", error_message)
156
- end
157
-
158
- Logging.message("--------------------\n\n")
159
-
160
- succeeded
161
- end
162
-
163
46
  def required_pkg_config_package(package_info, native_package_info=nil)
164
47
  if package_info.is_a?(Array)
165
48
  required_package_info = package_info
@@ -169,7 +52,7 @@ def required_pkg_config_package(package_info, native_package_info=nil)
169
52
  return true if PKGConfig.have_package(*required_package_info)
170
53
 
171
54
  native_package_info ||= {}
172
- return false unless install_missing_native_package(native_package_info)
55
+ return false unless NativePackageInstaller.install(native_package_info)
173
56
 
174
57
  PKGConfig.have_package(*required_package_info)
175
58
  end
@@ -5,7 +5,7 @@
5
5
  * $Author: kou $
6
6
  * $Date: 2008-09-19 12:56:27 $
7
7
  *
8
- * Copyright 2006-2016 Kouhei Sutou <kou@cozmixng.org>
8
+ * Copyright 2006-2017 Kouhei Sutou <kou@cozmixng.org>
9
9
  * Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
10
10
  * Copyright 2004-2005 MenTaLguY <mental@rydia.com>
11
11
  *
@@ -73,7 +73,7 @@ RB_CAIRO_BEGIN_DECLS
73
73
 
74
74
  #define RB_CAIRO_VERSION_MAJOR 1
75
75
  #define RB_CAIRO_VERSION_MINOR 15
76
- #define RB_CAIRO_VERSION_MICRO 5
76
+ #define RB_CAIRO_VERSION_MICRO 6
77
77
 
78
78
  RB_CAIRO_VAR VALUE rb_mCairo;
79
79
  RB_CAIRO_VAR VALUE rb_cCairo_Context;
@@ -127,7 +127,7 @@ VALUE rb_mCairo_PDFMetadata = Qnil;
127
127
  #define CAIRO_REGION_OVERLAP_MIN CAIRO_REGION_OVERLAP_IN
128
128
  #define CAIRO_REGION_OVERLAP_MAX CAIRO_REGION_OVERLAP_PART
129
129
 
130
- #if CAIRO_CHECK_VERSION(1, 15, 6)
130
+ #if CAIRO_CHECK_VERSION(1, 15, 5)
131
131
  # define CAIRO_PDF_OUTLINE_FLAGS_MIN CAIRO_PDF_OUTLINE_FLAG_OPEN
132
132
  # define CAIRO_PDF_OUTLINE_FLAGS_MAX CAIRO_PDF_OUTLINE_FLAG_ITALIC
133
133
  #else
@@ -692,7 +692,7 @@ Init_cairo_constants (void)
692
692
  #if CAIRO_CHECK_VERSION(1, 15, 4)
693
693
  rb_mCairo_PDFOutlineFlags =
694
694
  rb_define_module_under (rb_mCairo, "PDFOutlineFlags");
695
- # if CAIRO_CHECK_VERSION(1, 15, 6)
695
+ # if CAIRO_CHECK_VERSION(1, 15, 5)
696
696
  rb_define_const (rb_mCairo_PDFOutlineFlags, "OPEN",
697
697
  INT2NUM (CAIRO_PDF_OUTLINE_FLAG_OPEN));
698
698
  rb_define_const (rb_mCairo_PDFOutlineFlags, "BOLD",
@@ -129,6 +129,18 @@ cr_destroy_with_destroy_check (VALUE self)
129
129
  return Qnil;
130
130
  }
131
131
 
132
+ static VALUE
133
+ cr_get_reference_count (VALUE self)
134
+ {
135
+ cairo_t *cr;
136
+ unsigned int reference_count;
137
+
138
+ cr = _SELF;
139
+ reference_count = cairo_get_reference_count (cr);
140
+
141
+ return UINT2NUM (reference_count);
142
+ }
143
+
132
144
  static VALUE
133
145
  cr_s_wrap (VALUE self, VALUE pointer)
134
146
  {
@@ -1673,6 +1685,8 @@ Init_cairo_context (void)
1673
1685
  /* Functions for manipulating state objects */
1674
1686
  rb_define_method (rb_cCairo_Context, "initialize", cr_initialize, 1);
1675
1687
  rb_define_method (rb_cCairo_Context, "destroy", cr_destroy, 0);
1688
+ rb_define_method (rb_cCairo_Context, "reference_count",
1689
+ cr_get_reference_count, 0);
1676
1690
 
1677
1691
  rb_define_method (rb_cCairo_Context, "save", cr_save, 0);
1678
1692
  rb_define_method (rb_cCairo_Context, "restore", cr_restore, 0);
@@ -465,6 +465,18 @@ cr_surface_destroy (VALUE self)
465
465
  return self;
466
466
  }
467
467
 
468
+ static VALUE
469
+ cr_surface_get_reference_count (VALUE self)
470
+ {
471
+ cairo_surface_t *surface;
472
+ unsigned int reference_count;
473
+
474
+ surface = _SELF;
475
+ reference_count = cairo_surface_get_reference_count (surface);
476
+
477
+ return UINT2NUM (reference_count);
478
+ }
479
+
468
480
  static VALUE
469
481
  cr_surface_finish (VALUE self)
470
482
  {
@@ -1998,6 +2010,8 @@ Init_cairo_surface (void)
1998
2010
  cr_surface_get_device, 0);
1999
2011
  #endif
2000
2012
  rb_define_method (rb_cCairo_Surface, "destroy", cr_surface_destroy, 0);
2013
+ rb_define_method (rb_cCairo_Surface, "reference_count",
2014
+ cr_surface_get_reference_count, 0);
2001
2015
  rb_define_method (rb_cCairo_Surface, "finish", cr_surface_finish, 0);
2002
2016
  rb_define_method (rb_cCairo_Surface, "content", cr_surface_get_content, 0);
2003
2017
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cairo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.15.5
4
+ version: 1.15.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-14 00:00:00.000000000 Z
11
+ date: 2017-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pkg-config
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.1.5
27
+ - !ruby/object:Gem::Dependency
28
+ name: native-package-installer
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement