glib2 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -143,6 +143,7 @@ extern gpointer rbgobj_instance_from_ruby_object(VALUE obj);
143
143
  extern VALUE rbgobj_ruby_object_from_instance(gpointer instance);
144
144
  extern VALUE rbgobj_ruby_object_from_instance2(gpointer instance, gboolean alloc);
145
145
  extern VALUE rbgobj_ruby_object_from_instance_with_unref(gpointer instance);
146
+ extern void rbgobj_instance_unref(gpointer instance);
146
147
 
147
148
  extern void rbgobj_add_relative(VALUE obj, VALUE relative);
148
149
  extern void rbgobj_invalidate_relatives(VALUE obj);
@@ -33,6 +33,10 @@
33
33
  # define rb_str_new_cstr(c_string) rb_str_new2(c_string)
34
34
  #endif
35
35
 
36
+ #ifndef HAVE_RB_EXC_NEW_STR
37
+ # define rb_exc_new_str(klass, message) rb_exc_new3(klass, message)
38
+ #endif
39
+
36
40
  #ifndef G_VALUE_INIT
37
41
  # define G_VALUE_INIT { 0, { { 0 } } }
38
42
  #endif
@@ -119,6 +123,7 @@ G_GNUC_INTERNAL char *rg_obj_constant_lookup(const char *name);
119
123
 
120
124
  G_GNUC_INTERNAL void Init_gutil(void);
121
125
  G_GNUC_INTERNAL void Init_gutil_callback(void);
126
+ G_GNUC_INTERNAL void Init_glib_gettext(void);
122
127
  G_GNUC_INTERNAL void Init_glib_int64(void);
123
128
  G_GNUC_INTERNAL void Init_glib_error(void);
124
129
  G_GNUC_INTERNAL void Init_glib_threads(void);
@@ -157,9 +162,7 @@ G_GNUC_INTERNAL void Init_gobject_typeinstance(void);
157
162
  G_GNUC_INTERNAL void Init_gobject_gvalue(void);
158
163
  G_GNUC_INTERNAL void Init_gobject_gvaluetypes(void);
159
164
  G_GNUC_INTERNAL void Init_gobject_gboxed(void);
160
- #if GLIB_CHECK_VERSION(2,6,0)
161
165
  G_GNUC_INTERNAL void Init_gobject_gstrv(void);
162
- #endif
163
166
  G_GNUC_INTERNAL void Init_gobject_value_array(void);
164
167
  G_GNUC_INTERNAL void Init_gobject_genumflags(void);
165
168
  G_GNUC_INTERNAL void Init_gobject_genums(void);
data/lib/glib2.rb CHANGED
@@ -93,6 +93,10 @@ end
93
93
 
94
94
  base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path
95
95
  vendor_dir = base_dir + "vendor" + "local"
96
+ if vendor_dir.exist?
97
+ require "cairo"
98
+ end
99
+
96
100
  GLib.prepend_dll_path(vendor_dir + "bin")
97
101
  begin
98
102
  major, minor, _ = RUBY_VERSION.split(/\./)
@@ -19,6 +19,8 @@
19
19
  module GNOME2
20
20
  module Rake
21
21
  class ExternalPackage < Struct.new(:name,
22
+ :base_name,
23
+ :archive_base_name,
22
24
  :label,
23
25
  :version,
24
26
  :download_site,
@@ -43,11 +45,11 @@ module GNOME2
43
45
  end
44
46
 
45
47
  def base_name
46
- "#{name}-#{version}"
48
+ super || "#{name}-#{version}"
47
49
  end
48
50
 
49
51
  def archive_base_name
50
- "#{base_name}.tar.#{compression_method}"
52
+ super || "#{base_name}.tar.#{compression_method}"
51
53
  end
52
54
 
53
55
  def archive_url
@@ -95,7 +97,7 @@ module GNOME2
95
97
  case download_site
96
98
  when :gnome
97
99
  base_url = "http://ftp.gnome.org/pub/gnome/sources"
98
- release_series = version.gsub(/\A(\d+\.\d+).+\z/, '\1')
100
+ release_series = version.gsub(/\A(\d+\.\d+)(?:[^\d].*)?\z/, '\1')
99
101
  base_url << "/#{name}/#{release_series}"
100
102
  else
101
103
  base_url = nil
@@ -107,7 +109,9 @@ module GNOME2
107
109
  :include_paths,
108
110
  :library_paths,
109
111
  :configure_args,
112
+ :cc_args,
110
113
  :patches,
114
+ :built_file,
111
115
  :need_autogen,
112
116
  :need_autoreconf,
113
117
  :build_concurrently,
@@ -135,10 +139,18 @@ module GNOME2
135
139
  super || []
136
140
  end
137
141
 
142
+ def cc_args
143
+ super || []
144
+ end
145
+
138
146
  def patches
139
147
  super || []
140
148
  end
141
149
 
150
+ def built_file
151
+ super || nil
152
+ end
153
+
142
154
  def need_autogen?
143
155
  need_autogen.nil? ? false : need_autogen
144
156
  end
@@ -159,6 +171,7 @@ module GNOME2
159
171
  class NativeConfiguration < Struct.new(:build,
160
172
  :configure_args,
161
173
  :patches,
174
+ :built_file,
162
175
  :need_autogen,
163
176
  :need_autoreconf,
164
177
  :build_concurrently)
@@ -181,6 +194,10 @@ module GNOME2
181
194
  super || []
182
195
  end
183
196
 
197
+ def built_file
198
+ super || nil
199
+ end
200
+
184
201
  def need_autogen?
185
202
  need_autogen.nil? ? false : need_autogen
186
203
  end
@@ -52,41 +52,58 @@ module GNOME2
52
52
  def define_build_tasks
53
53
  namespace :build do
54
54
  build_packages.each do |package|
55
- download_task = "source:downloader:download:#{package.name}"
56
- desc "Build #{package.label} and install it into #{dist_dir}."
57
- task package.name => [download_task] do
58
- package_tmp_dir = @package.tmp_dir + package.name
59
- rm_rf(package_tmp_dir)
60
- mkdir_p(package_tmp_dir)
61
-
62
- tar_full_path = @package.download_dir + package.archive_base_name
63
- Dir.chdir(package_tmp_dir.to_s) do
64
- sh("tar", "xf", tar_full_path.to_s) or exit(false)
65
- end
66
-
67
- Dir.chdir((package_tmp_dir + package.base_name).to_s) do
68
- package.native.patches.each do |patch|
69
- sh("patch -p1 < #{@package.patches_dir}/#{patch}")
55
+ namespace package.name do
56
+ download_task = "source:downloader:download:#{package.name}"
57
+ built_file = package.native.built_file
58
+ if built_file
59
+ built_file = dist_dir + built_file
60
+ file built_file.to_s do
61
+ ::Rake::Task[download_task].invoke
62
+ build_package_task_body(package)
70
63
  end
71
- sh("./autogen.sh") if package.native.need_autogen?
72
- sh("autoreconf --install") if package.native.need_autoreconf?
73
- sh("./configure",
74
- "PKG_CONFIG_PATH=#{pkg_config_path}",
75
- "--prefix=#{dist_dir}",
76
- *package.native.configure_args) or exit(false)
77
- common_make_args = []
78
- common_make_args << "GLIB_COMPILE_SCHEMAS=glib-compile-schemas"
79
- build_make_args = common_make_args.dup
80
- install_make_args = common_make_args.dup
81
- if package.native.build_concurrently?
82
- make_n_jobs = ENV["MAKE_N_JOBS"]
83
- build_make_args << "-j#{make_n_jobs}" if make_n_jobs
64
+ task :build => built_file.to_s
65
+ else
66
+ task :build => [download_task] do
67
+ build_patckage_task_body(package)
84
68
  end
85
- sh("nice", "make", *build_make_args) or exit(false)
86
- sh("make", "install", *install_make_args) or exit(false)
87
69
  end
88
70
  end
71
+ desc "Build #{package.label} and install it into #{dist_dir}."
72
+ task package.name => "native:builder:build:#{package.name}:build"
73
+ end
74
+ end
75
+ end
76
+
77
+ def build_package_task_body(package)
78
+ package_tmp_dir = @package.tmp_dir + package.name
79
+ rm_rf(package_tmp_dir)
80
+ mkdir_p(package_tmp_dir)
81
+
82
+ tar_full_path = @package.download_dir + package.archive_base_name
83
+ Dir.chdir(package_tmp_dir.to_s) do
84
+ sh("tar", "xf", tar_full_path.to_s) or exit(false)
85
+ end
86
+
87
+ Dir.chdir((package_tmp_dir + package.base_name).to_s) do
88
+ package.native.patches.each do |patch|
89
+ sh("patch -p1 < #{@package.patches_dir}/#{patch}")
90
+ end
91
+ sh("./autogen.sh") if package.native.need_autogen?
92
+ sh("autoreconf --install") if package.native.need_autoreconf?
93
+ sh("./configure",
94
+ "PKG_CONFIG_PATH=#{pkg_config_path}",
95
+ "--prefix=#{dist_dir}",
96
+ *package.native.configure_args) or exit(false)
97
+ common_make_args = []
98
+ common_make_args << "GLIB_COMPILE_SCHEMAS=glib-compile-schemas"
99
+ build_make_args = common_make_args.dup
100
+ install_make_args = common_make_args.dup
101
+ if package.native.build_concurrently?
102
+ make_n_jobs = ENV["MAKE_N_JOBS"]
103
+ build_make_args << "-j#{make_n_jobs}" if make_n_jobs
89
104
  end
105
+ sh("nice", "make", *build_make_args) or exit(false)
106
+ sh("make", "install", *install_make_args) or exit(false)
90
107
  end
91
108
  end
92
109
 
@@ -131,7 +131,7 @@ module GNOME2
131
131
  "{ext,sample,test,test-unit}/**/*"]
132
132
  files.existing!
133
133
  s.files = files
134
- s.required_ruby_version = @required_ruby_version || ">= 1.8.5"
134
+ s.required_ruby_version = @required_ruby_version || ">= 1.9.3"
135
135
  s.post_install_message = @post_install_message
136
136
  @dependency_configuration.apply(s)
137
137
  end
@@ -180,6 +180,16 @@ module GNOME2
180
180
  end
181
181
  end
182
182
  spec.files += win32_files
183
+ stage_path = "#{ext.tmp_dir}/#{ext.cross_platform}/stage"
184
+ win32_files.each do |win32_file|
185
+ next unless File.file?(win32_file)
186
+ stage_win32_file = "#{stage_path}/#{win32_file}"
187
+ stage_win32_binary_dir = File.dirname(stage_win32_file)
188
+ directory stage_win32_binary_dir
189
+ file stage_win32_file => [stage_win32_binary_dir, win32_file] do
190
+ cp win32_file, stage_win32_file
191
+ end
192
+ end
183
193
  end
184
194
  @cross_compiling_hooks.each do |hook|
185
195
  hook.call(spec)
@@ -60,7 +60,8 @@ module GNOME2
60
60
  task :before
61
61
  task :after
62
62
  desc "Download #{package.label} into #{download_dir}."
63
- task package[:name] => [:before, tar_full_path.to_s, :after]
63
+ # task package[:name] => [:before, tar_full_path.to_s, :after]
64
+ task package[:name] => tar_full_path.to_s
64
65
 
65
66
  directory_path = tar_full_path.dirname
66
67
  directory directory_path.to_s
@@ -48,6 +48,11 @@ class GNOME2Win32BinaryBuildTask
48
48
  end.join(":")
49
49
  ENV["PKG_CONFIG_LIBDIR"] = rcairo_win32_pkgconfig_path
50
50
  end
51
+
52
+ prepare_task_names << "pkg_config_for_build"
53
+ task :pkg_config_for_build do
54
+ ENV["PKG_CONFIG_FOR_BUILD"] = "env - pkg-config"
55
+ end
51
56
  end
52
57
 
53
58
  full_prepare_task_names = prepare_task_names.collect do |name|
@@ -59,8 +64,19 @@ class GNOME2Win32BinaryBuildTask
59
64
  namespace package.name do
60
65
  task :before
61
66
  download_task = "source:downloader:download:#{package.name}"
62
- task :build => [:prepare, download_task] do
63
- build_package_task_body(package)
67
+ built_file = package.windows.built_file
68
+ if built_file
69
+ built_file = dist_dir + built_file
70
+ file built_file.to_s do
71
+ Rake::Task["win32:builder:build:prepare"].invoke
72
+ Rake::Task[download_task].invoke
73
+ build_package_task_body(package)
74
+ end
75
+ task :build => built_file.to_s
76
+ else
77
+ task :build => [:prepare, download_task] do
78
+ build_package_task_body(package)
79
+ end
64
80
  end
65
81
  task :after
66
82
  end
@@ -92,7 +108,7 @@ class GNOME2Win32BinaryBuildTask
92
108
  end
93
109
  sh("./autogen.sh") if package.windows.need_autogen?
94
110
  sh("autoreconf --install") if package.windows.need_autoreconf?
95
- cc_env = "CC=#{@package.windows.build_host}-gcc"
111
+ cc_env = "CC=#{cc(package)}"
96
112
  sh("./configure",
97
113
  cc_env,
98
114
  "CPPFLAGS=#{cppflags(package)}",
@@ -101,6 +117,7 @@ class GNOME2Win32BinaryBuildTask
101
117
  "--host=#{@package.windows.build_host}",
102
118
  *package.windows.configure_args) or exit(false)
103
119
  common_make_args = []
120
+ common_make_args << "MAKE=make"
104
121
  common_make_args << "GLIB_COMPILE_SCHEMAS=glib-compile-schemas"
105
122
  if package.windows.use_cc_environment_variable?
106
123
  common_make_args << cc_env
@@ -175,6 +192,14 @@ class GNOME2Win32BinaryBuildTask
175
192
  "#{rcairo_win32_dir}/vendor/local/lib"
176
193
  end
177
194
 
195
+ def cc(package)
196
+ cc_command_line = [
197
+ "#{@package.windows.build_host}-gcc",
198
+ *package.windows.cc_args,
199
+ ]
200
+ cc_command_line.compact.join(" ")
201
+ end
202
+
178
203
  def cppflags(package)
179
204
  include_paths = package.windows.include_paths
180
205
  if @package.windows.build_dependencies.include?("glib2")
data/lib/mkmf-gnome2.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # Extended mkmf for Ruby-GNOME2 and Ruby/GLib based libraries.
5
5
  #
6
- # Copyright(C) 2003-2011 Ruby-GNOME2 Project.
6
+ # Copyright(C) 2003-2013 Ruby-GNOME2 Project.
7
7
  #
8
8
  # This program is licenced under the same
9
9
  # license of Ruby-GNOME2.
@@ -11,13 +11,7 @@
11
11
 
12
12
  require 'English'
13
13
  require 'mkmf'
14
- begin
15
- require 'pkg-config'
16
- rescue LoadError
17
- require 'rubygems'
18
- gem 'pkg-config'
19
- require 'pkg-config'
20
- end
14
+ require 'pkg-config'
21
15
  require 'glib-mkenums'
22
16
 
23
17
  $CFLAGS += " #{ENV['CFLAGS']}" if ENV['CFLAGS']
metadata CHANGED
@@ -1,46 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glib2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
5
- prerelease:
4
+ version: 2.0.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - The Ruby-GNOME2 Project Team
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-05-26 00:00:00.000000000 Z
11
+ date: 2013-12-28 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: pkg-config
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: test-unit
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '2'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '2'
46
41
  description: Ruby/GLib2 is a Ruby binding of GLib-2.x.
@@ -76,6 +71,7 @@ files:
76
71
  - ext/glib2/rbglib_convert.c
77
72
  - ext/glib2/rbglib_error.c
78
73
  - ext/glib2/rbglib_fileutils.c
74
+ - ext/glib2/rbglib_gettext.c
79
75
  - ext/glib2/rbglib_i18n.c
80
76
  - ext/glib2/rbglib_int64.c
81
77
  - ext/glib2/rbglib_io_constants.c
@@ -165,26 +161,25 @@ files:
165
161
  - test/test_win32.rb
166
162
  homepage: http://ruby-gnome2.sourceforge.jp/
167
163
  licenses: []
164
+ metadata: {}
168
165
  post_install_message:
169
166
  rdoc_options: []
170
167
  require_paths:
171
168
  - lib
172
169
  required_ruby_version: !ruby/object:Gem::Requirement
173
- none: false
174
170
  requirements:
175
- - - ! '>='
171
+ - - '>='
176
172
  - !ruby/object:Gem::Version
177
- version: 1.8.5
173
+ version: 1.9.3
178
174
  required_rubygems_version: !ruby/object:Gem::Requirement
179
- none: false
180
175
  requirements:
181
- - - ! '>='
176
+ - - '>='
182
177
  - !ruby/object:Gem::Version
183
178
  version: '0'
184
179
  requirements: []
185
180
  rubyforge_project:
186
- rubygems_version: 1.8.23
181
+ rubygems_version: 2.0.14
187
182
  signing_key:
188
- specification_version: 3
183
+ specification_version: 4
189
184
  summary: Ruby/GLib2 is a Ruby binding of GLib-2.x.
190
185
  test_files: []