glib2 3.3.2 → 3.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2011-2019 Ruby-GNOME2 Project Team
4
4
  * Copyright (C) 2006 Sjoerd Simons
5
5
  *
6
6
  * This library is free software; you can redistribute it and/or
@@ -83,7 +83,7 @@ value_array_from_ruby(const VALUE from, GValue *to)
83
83
 
84
84
  args.ary = rb_ary_to_ary(from);
85
85
  args.n = RARRAY_LEN(args.ary);
86
- args.result = g_value_array_new(args.n);
86
+ args.result = g_value_array_new((guint)args.n);
87
87
 
88
88
  rb_rescue(value_array_from_ruby_body, (VALUE)&args,
89
89
  value_array_from_ruby_rescue, (VALUE)&args);
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2011-2015 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2011-2019 Ruby-GNOME2 Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -181,7 +181,7 @@ rval2glist_body(VALUE data)
181
181
  {
182
182
  struct rval2glist_args *args = (struct rval2glist_args *)data;
183
183
  VALUE rb_array;
184
- int i, n;
184
+ long i, n;
185
185
 
186
186
  rb_array = rbg_to_array(args->rb_array);
187
187
  n = RARRAY_LEN(rb_array);
@@ -229,7 +229,7 @@ rval2gslist_body(VALUE data)
229
229
  {
230
230
  struct rval2gslist_args *args = (struct rval2gslist_args *)data;
231
231
  VALUE rb_array;
232
- int i, n;
232
+ long i, n;
233
233
 
234
234
  rb_array = rbg_to_array(args->rb_array);
235
235
  n = RARRAY_LEN(rb_array);
data/glib2.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  # -*- ruby -*-
2
2
  #
3
- # Copyright (C) 2018 Ruby-GNOME2 Project Team
3
+ # Copyright (C) 2018-2019 Ruby-GNOME2 Project Team
4
4
  #
5
5
  # This library is free software; you can redistribute it and/or
6
6
  # modify it under the terms of the GNU Lesser General Public
@@ -46,7 +46,7 @@ Gem::Specification.new do |s|
46
46
  s.files += Dir.glob("sample/**/*")
47
47
  s.files += Dir.glob("test/**/*")
48
48
 
49
- s.add_runtime_dependency("pkg-config", ">= 1.2.2")
49
+ s.add_runtime_dependency("pkg-config", ">= 1.3.5")
50
50
  s.add_runtime_dependency("native-package-installer", ">= 1.0.3")
51
51
  s.add_development_dependency("test-unit", ">= 2")
52
52
 
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013-2018 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2013-2019 Ruby-GNOME2 Project Team
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -14,8 +14,6 @@
14
14
  # License along with this library; if not, write to the Free Software
15
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
- require "open-uri"
18
-
19
17
  module GNOME2
20
18
  module Rake
21
19
  class ExternalPackage < Struct.new(:name,
@@ -104,24 +102,8 @@ module GNOME2
104
102
  end
105
103
 
106
104
  def latest_version
107
- case download_site
108
- when :gnome
109
- latest_version_gnome
110
- when :freedesktop
111
- latest_version_freedesktop
112
- when :freedesktop_gstreamer
113
- latest_version_freedesktop_gstreamer
114
- when :gnu
115
- latest_version_gnu
116
- when :webkitgtk
117
- latest_version_webkitgtk
118
- when :icu
119
- latest_version_icu
120
- when :github
121
- latest_version_github
122
- else
123
- nil
124
- end
105
+ warn("this feature is no longer supported.")
106
+ nil
125
107
  end
126
108
 
127
109
  private
@@ -133,194 +115,6 @@ module GNOME2
133
115
  end
134
116
  end
135
117
 
136
- def download_site_base_url
137
- case download_site
138
- when :gnome
139
- base_url = gnome_base_url
140
- release_series = version.gsub(/\A(\d+\.\d+)(?:[^\d].*)?\z/, '\1')
141
- base_url << "/#{download_name}/#{release_series}"
142
- when :freedesktop
143
- base_url = freedesktop_base_url
144
- base_url << "/#{download_name}/release"
145
- when :freedesktop_gstreamer
146
- base_url = freedesktop_gstreamer_base_url
147
- base_url << "/#{download_name}"
148
- when :gnu
149
- base_url = gnu_base_url
150
- base_url << "/#{download_name}"
151
- when :webkitgtk
152
- base_url = webkitgtk_base_url
153
- when :icu
154
- base_url = "#{icu_base_url}/#{version}"
155
- when :github
156
- base_url = github_base_url
157
- base_url << "/#{download_name}/releases/download/#{version}"
158
- else
159
- base_url = nil
160
- end
161
- base_url
162
- end
163
-
164
- def gnome_base_url
165
- "http://ftp.gnome.org/pub/gnome/sources"
166
- end
167
-
168
- def freedesktop_base_url
169
- "https://www.freedesktop.org/software"
170
- end
171
-
172
- def freedesktop_gstreamer_base_url
173
- "https://gstreamer.freedesktop.org/src"
174
- end
175
-
176
- def gnu_base_url
177
- "https://ftp.gnu.org/pub/gnu"
178
- end
179
-
180
- def webkitgtk_base_url
181
- "https://webkitgtk.org/releases"
182
- end
183
-
184
- def icu_base_url
185
- "http://download.icu-project.org/files/icu4c"
186
- end
187
-
188
- def github_base_url
189
- "https://github.com"
190
- end
191
-
192
- def sort_versions(versions)
193
- versions.sort_by do |version|
194
- version.split(".").collect(&:to_i)
195
- end
196
- end
197
-
198
- def latest_version_gnome
199
- base_url = "#{gnome_base_url}/#{download_name}"
200
- minor_versions = []
201
- open(base_url) do |index|
202
- index.read.scan(/<a (.+?)>/) do |content,|
203
- case content
204
- when /href="(\d+(?:\.\d+)*)\/?"/
205
- minor_version = $1
206
- next if development_minor_version_gnome?(minor_version)
207
- minor_versions << minor_version
208
- end
209
- end
210
- end
211
- return nil if minor_versions.empty?
212
-
213
- latest_minor_version = sort_versions(minor_versions).last
214
- versions = []
215
- open("#{base_url}/#{latest_minor_version}") do |index|
216
- index.read.scan(/<a (.+?)>/) do |content,|
217
- case content
218
- when /href="#{Regexp.escape(name)}-
219
- (\d+(?:\.\d+)*)
220
- \.tar\.#{Regexp.escape(compression_method)}"/x
221
- versions << $1
222
- end
223
- end
224
- end
225
- sort_versions(versions).last
226
- end
227
-
228
- def development_minor_version_gnome?(minor_version)
229
- minor_version.split(".").last.to_i.odd?
230
- end
231
-
232
- def latest_version_freedesktop
233
- base_url = "#{freedesktop_base_url}/#{download_name}/release"
234
- versions = []
235
- open(base_url) do |index|
236
- index.read.scan(/<a (.+?)>/) do |content,|
237
- case content
238
- when /href="#{Regexp.escape(name)}-
239
- (\d+(?:\.\d+)*)
240
- \.tar\.#{Regexp.escape(compression_method)}"/x
241
- versions << $1
242
- end
243
- end
244
- end
245
- sort_versions(versions).last
246
- end
247
-
248
- def latest_version_freedesktop_gstreamer
249
- base_url = "#{freedesktop_gstreamer_base_url}/#{download_name}"
250
- versions = []
251
- open(base_url) do |index|
252
- index.read.scan(/<a (.+?)>/) do |content,|
253
- case content
254
- when /href="#{Regexp.escape(name)}-
255
- (\d+(?:\.\d+)*)
256
- \.tar\.#{Regexp.escape(compression_method)}"/x
257
- version = $1
258
- next if development_version_freedesktop_gstreamer?(version)
259
- versions << version
260
- end
261
- end
262
- end
263
- sort_versions(versions).last
264
- end
265
-
266
- def development_version_freedesktop_gstreamer?(version)
267
- version.split(".")[1].to_i.odd?
268
- end
269
-
270
- def latest_version_gnu
271
- base_url = "#{gnu_base_url}/#{download_name}"
272
- versions = []
273
- open(base_url) do |index|
274
- index.read.scan(/<a (.+?)>/) do |content,|
275
- case content
276
- when /href="#{Regexp.escape(name)}-
277
- (\d+(?:\.\d+)*)
278
- \.tar\.#{Regexp.escape(compression_method)}"/x
279
- version = $1
280
- versions << version
281
- end
282
- end
283
- end
284
- sort_versions(versions).last
285
- end
286
-
287
- def latest_version_webkitgtk
288
- base_url = webkitgtk_base_url
289
- versions = []
290
- open(base_url) do |index|
291
- index.read.scan(/<a (.+?)>/) do |content,|
292
- case content
293
- when /href="#{Regexp.escape(name)}-
294
- (\d+(?:\.\d+)*)
295
- \.tar\.#{Regexp.escape(compression_method)}"/x
296
- versions << $1
297
- end
298
- end
299
- end
300
- sort_versions(versions).last
301
- end
302
-
303
- def latest_version_icu
304
- base_url = icu_base_url
305
- versions = []
306
- open(base_url) do |index|
307
- index.read.scan(/<a (.+?)>/) do |content,|
308
- case content
309
- when /href="(\d+(?:\.\d+)+)\/"/x
310
- versions << $1
311
- end
312
- end
313
- end
314
- sort_versions(versions).last
315
- end
316
-
317
- def latest_version_github
318
- latest_url = "#{github_base_url}/#{download_name}/releases/latest"
319
- open(latest_url) do |latest_page|
320
- return latest_page.base_uri.path.split("/").last
321
- end
322
- end
323
-
324
118
  class WindowsConfiguration < Struct.new(:build,
325
119
  :include_paths,
326
120
  :library_paths,
@@ -1,6 +1,4 @@
1
- # -*- ruby -*-
2
- #
3
- # Copyright (C) 2013-2018 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2013-2019 Ruby-GNOME2 Project Team
4
2
  #
5
3
  # This library is free software; you can redistribute it and/or
6
4
  # modify it under the terms of the GNU Lesser General Public
@@ -16,107 +14,14 @@
16
14
  # License along with this library; if not, write to the Free Software
17
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
16
 
19
- require "rake"
20
-
21
17
  module GNOME2
22
18
  module Rake
23
19
  class NativeBinaryBuildTask
24
- include ::Rake::DSL
25
-
26
20
  def initialize(package)
27
21
  @package = package
28
22
  end
29
23
 
30
24
  def define
31
- namespace :native do
32
- namespace :builder do
33
- task :before
34
- define_build_tasks
35
- build_tasks = build_packages.collect do |package|
36
- "native:builder:build:#{package.name}"
37
- end
38
- task :build => build_tasks
39
- task :after
40
- end
41
-
42
- desc "Build binaries for build environment"
43
- task :build => [
44
- "native:builder:before",
45
- "native:builder:build",
46
- "native:builder:after",
47
- ]
48
- end
49
- end
50
-
51
- private
52
- def define_build_tasks
53
- namespace :build do
54
- build_packages.each do |package|
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)
63
- end
64
- task :build => built_file.to_s
65
- else
66
- task :build => [download_task] do
67
- build_package_task_body(package)
68
- end
69
- end
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 + "native" + 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
- package_dir_path =
88
- package_tmp_dir + package.base_name + package.base_dir_in_package
89
- Dir.chdir(package_dir_path.to_s) do
90
- package.native.patches.each do |patch|
91
- sh("patch -p1 < #{@package.patches_dir}/#{patch}")
92
- end
93
- build_dir = "build"
94
- env = []
95
- env << "PKG_CONFIG_PATH=#{pkg_config_path}"
96
- env << "GLIB_COMPILE_SCHEMAS=glib-compile-schemas"
97
- sh("env",
98
- *env,
99
- "meson",
100
- build_dir,
101
- "--prefix=#{dist_dir}",
102
- "--libdir=lib") or exit(false)
103
- sh("env", *env, "nice", "ninja", "-C", build_dir) or exit(false)
104
- sh("env", *env, "ninja", "-C", build_dir, "install") or exit(false)
105
- end
106
- end
107
-
108
- def build_packages
109
- @package.external_packages.select do |package|
110
- package.native.build?
111
- end
112
- end
113
-
114
- def dist_dir
115
- @package.native.absolute_binary_dir
116
- end
117
-
118
- def pkg_config_path
119
- dist_dir + "lib/pkgconfig"
120
25
  end
121
26
  end
122
27
  end
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- # Copyright(C) 2011-2015 Ruby-GNOME2 Project.
1
+ # Copyright(C) 2011-2019 Ruby-GNOME2 Project.
4
2
  #
5
3
  # This program is licenced under the same license of Ruby-GNOME2.
6
4
 
@@ -9,7 +7,6 @@ require "pathname"
9
7
 
10
8
  require "rubygems"
11
9
  require "rubygems/package_task"
12
- require "rake/extensiontask"
13
10
  require "gnome2/rake/package"
14
11
  require "gnome2/rake/external-package"
15
12
  require "gnome2/rake/source-download-task"
@@ -48,15 +45,13 @@ module GNOME2
48
45
  end
49
46
 
50
47
  def cross_compiling(&block)
48
+ warn("cross compile support is dropped.")
51
49
  @cross_compiling_hooks << block
52
50
  end
53
51
 
54
52
  def define
55
53
  task :default => :build
56
54
  define_spec
57
- define_source_tasks
58
- define_native_tasks
59
- define_windows_tasks
60
55
  define_package_tasks
61
56
  end
62
57
 
@@ -127,12 +122,9 @@ module GNOME2
127
122
  @dependency_configuration = DependencyConfiguration.new(self)
128
123
  end
129
124
 
130
- def cross_platform
131
- "#{windows.build_architecture}-mingw32"
132
- end
133
-
134
125
  def define_spec
135
126
  @spec ||= Gem::Specification.new do |s|
127
+ warn("spec generation is deprecated. Use .gemspec instead.")
136
128
  s.name = @name
137
129
  s.summary = @summary
138
130
  s.description = @description
@@ -161,146 +153,6 @@ module GNOME2
161
153
  end
162
154
  end
163
155
 
164
- def define_source_tasks
165
- define_source_download_tasks
166
- end
167
-
168
- def define_source_download_tasks
169
- task = SourceDownloadTask.new(@package)
170
- task.define
171
- end
172
-
173
- def define_native_tasks
174
- define_native_build_tasks
175
- end
176
-
177
- def define_native_build_tasks
178
- task = NativeBinaryBuildTask.new(@package)
179
- task.define
180
- end
181
-
182
- def define_windows_tasks
183
- define_windows_extension_task
184
- define_windows_download_task
185
- define_windows_build_task
186
- define_windows_version_update_task
187
- end
188
-
189
- def so_base_name
190
- @name.gsub(/-/, "_")
191
- end
192
-
193
- def define_windows_extension_task
194
- ::Rake::ExtensionTask.new(so_base_name, @spec) do |ext|
195
- ext.cross_platform = cross_platform
196
- ext.ext_dir = "ext/#{@name}"
197
- ext.cross_compile = true
198
- ext.cross_compiling do |spec|
199
- if /mingw|mswin/ =~ spec.platform.to_s
200
- spec.metadata.delete("msys2_mingw_dependencies")
201
-
202
- windows_binary_dir = @package.windows.relative_binary_dir
203
- windows_files = []
204
- if windows_binary_dir.exist?
205
- Find.find(windows_binary_dir.to_s) do |path|
206
- next unless File.file?(path)
207
- next if /\.zip\z/ =~ path
208
- windows_files << path
209
- end
210
- end
211
- spec.files += windows_files
212
- stage_path = "#{ext.tmp_dir}/#{ext.cross_platform}/stage"
213
- windows_files.each do |windows_file|
214
- stage_windows_file = "#{stage_path}/#{windows_file}"
215
- stage_windows_binary_dir = File.dirname(stage_windows_file)
216
- directory stage_windows_binary_dir
217
- stage_windows_file_dependencies = [
218
- stage_windows_binary_dir,
219
- windows_file,
220
- ]
221
- file stage_windows_file => stage_windows_file_dependencies do
222
- cp windows_file, stage_windows_file
223
- end
224
- end
225
- end
226
- @cross_compiling_hooks.each do |hook|
227
- hook.call(spec)
228
- end
229
- end
230
- end
231
-
232
- extconf_rb = "ext/#{@name}/extconf.rb"
233
- unless File.exist?(extconf_rb)
234
- native_task_name = "native:#{@name}:#{cross_platform}"
235
- if ::Rake::Task.task_defined?(native_task_name)
236
- ::Rake::Task[native_task_name].prerequisites.clear
237
- end
238
- end
239
- end
240
-
241
- def define_windows_download_task
242
- task = WindowsBinaryDownloadTask.new(@package)
243
- task.define
244
- end
245
-
246
- def define_windows_build_task
247
- windows_binary_build_task.define
248
- end
249
-
250
- def define_windows_version_update_task
251
- namespace :windows do
252
- namespace :version do
253
- task_names = []
254
- namespace :update do
255
- @package.external_packages.each do |package|
256
- task_names << package.name
257
- task package.name do
258
- latest_version = package.latest_version || package.version
259
- if package.version != latest_version
260
- update_package_version(package, latest_version)
261
- end
262
- end
263
- end
264
- end
265
-
266
- full_task_names = task_names.collect do |name|
267
- "windows:version:update:#{name}"
268
- end
269
- desc "Update Windows package versions"
270
- task :update => full_task_names
271
- end
272
- end
273
- end
274
-
275
- def update_package_version(package, latest_version)
276
- rakefile_path = ::Rake.application.rakefile
277
- rakefile_content = File.read(rakefile_path)
278
- updated_rakefile_content = ""
279
- in_package = false
280
- escaped_name = Regexp.escape(package.name)
281
- escaped_version = Regexp.escape(package.version)
282
- rakefile_content.each_line do |line|
283
- case line
284
- when /:name => "#{escaped_name}",/
285
- in_package = true
286
- updated_rakefile_content << line
287
- when /:version => "#{escaped_version}",/
288
- if in_package
289
- updated_rakefile_content << line.gsub(/#{escaped_version}/,
290
- latest_version)
291
- in_package = false
292
- else
293
- updated_rakefile_content << line
294
- end
295
- else
296
- updated_rakefile_content << line
297
- end
298
- end
299
- File.open(rakefile_path, "w") do |rakefile|
300
- rakefile.write(updated_rakefile_content)
301
- end
302
- end
303
-
304
156
  def define_package_tasks
305
157
  Gem::PackageTask.new(@spec) do |pkg|
306
158
  end