glib2 1.2.6 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/mkmf-gnome2.rb CHANGED
@@ -155,13 +155,14 @@ def add_depend_package_path(target_name, target_source_dir, target_build_dir)
155
155
 
156
156
  case RUBY_PLATFORM
157
157
  when /cygwin|mingw|mswin/
158
+ library_base_name = "ruby-#{target_name.gsub(/-/, '_')}"
158
159
  case RUBY_PLATFORM
159
160
  when /cygwin|mingw/
160
161
  $LDFLAGS << " -L#{target_build_dir}"
161
- $libs << " -lruby-#{target_name}"
162
+ $libs << " -l#{library_base_name}"
162
163
  when /mswin/
163
164
  $DLDFLAGS << " /libpath:#{target_build_dir}"
164
- $libs << " libruby-#{target_name}.lib"
165
+ $libs << " lib#{library_base_name}.lib"
165
166
  end
166
167
  target_base_dir = Pathname.new(target_source_dir).parent.parent
167
168
  target_binary_base_dir = target_base_dir + "vendor" + "local"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glib2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6
4
+ version: 2.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-04 00:00:00.000000000 Z
12
+ date: 2013-04-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pkg-config
@@ -57,8 +57,13 @@ files:
57
57
  - lib/glib2.rb
58
58
  - lib/glib2/deprecatable.rb
59
59
  - lib/gnome2-raketask.rb
60
- - lib/gnome2-win32-binary-build-task.rb
61
- - lib/gnome2-win32-binary-download-task.rb
60
+ - lib/gnome2/rake/external-package.rb
61
+ - lib/gnome2/rake/native-binary-build-task.rb
62
+ - lib/gnome2/rake/package-task.rb
63
+ - lib/gnome2/rake/package.rb
64
+ - lib/gnome2/rake/source-download-task.rb
65
+ - lib/gnome2/rake/win32-binary-build-task.rb
66
+ - lib/gnome2/rake/win32-binary-download-task.rb
62
67
  - lib/mkmf-gnome2.rb
63
68
  - ext/glib2/depend
64
69
  - ext/glib2/extconf.rb
@@ -1,250 +0,0 @@
1
- # Copyright(C) 2012 Ruby-GNOME2 Project.
2
- #
3
- # This program is licenced under the same license of Ruby-GNOME2.
4
-
5
- require "open-uri"
6
- require "pathname"
7
-
8
- class GNOME2Win32BinaryBuildTask
9
- include Rake::DSL
10
-
11
- def initialize(configuration)
12
- @configuration = configuration
13
- @configuration.build_packages.each do |package|
14
- package[:compression_method] ||= "gz"
15
- end
16
- define
17
- end
18
-
19
- private
20
- def define
21
- namespace :win32 do
22
- namespace :builder do
23
- task :before
24
- define_download_tasks
25
- define_build_tasks
26
- build_tasks = build_packages.collect do |package|
27
- "win32:builder:build:#{package[:name]}"
28
- end
29
- desc "Build Windows binaries"
30
- task :build => build_tasks
31
- task :after
32
- end
33
- desc "download source and build Windows binaries"
34
- task :build => ["win32:builder:before",
35
- "win32:builder:build",
36
- "win32:builder:after"]
37
- end
38
- end
39
-
40
- def define_download_tasks
41
- namespace :download do
42
- build_packages.each do |package|
43
- base = "#{package[:name]}-#{package[:version]}"
44
- tar = "#{base}.tar.#{package[:compression_method]}"
45
- tar_url = "#{download_base_url(package)}/#{tar}"
46
- tar_full_path = download_dir + tar
47
-
48
- desc "Download #{package[:label]} into #{download_dir}."
49
- task package[:name] => tar_full_path.to_s
50
-
51
- directory_path = tar_full_path.dirname
52
- directory directory_path.to_s
53
- file tar_full_path.to_s => directory_path.to_s do
54
- rake_output_message "downloading... #{tar_url}"
55
- open(tar_url) do |downloaded_tar|
56
- tar_full_path.open("wb") do |tar_file|
57
- tar_file.print(downloaded_tar.read)
58
- end
59
- end
60
- end
61
- end
62
- end
63
- end
64
-
65
- def define_build_tasks
66
- namespace :build do
67
- prepare_task_names = []
68
- namespace :prepare do
69
- prepare_task_names << "pkg_config"
70
- task :pkg_config do
71
- depended_packages = @configuration.build_dependencies
72
- use_packages = [@configuration.package.name] + depended_packages
73
- pkg_config_path = use_packages.collect do |package|
74
- "../#{package}/#{@configuration.relative_binary_dir}/lib/pkgconfig"
75
- end
76
- ENV["PKG_CONFIG_PATH"] = pkg_config_path.collect do |path|
77
- File.expand_path(path)
78
- end.join(":")
79
- ENV["PKG_CONFIG_LIBDIR"] = rcairo_win32_pkgconfig_path
80
- end
81
- end
82
-
83
- full_prepare_task_names = prepare_task_names.collect do |name|
84
- "win32:builder:build:prepare:#{name}"
85
- end
86
- task :prepare => full_prepare_task_names
87
-
88
- build_packages.each do |package|
89
- download_task = "win32:builder:download:#{package[:name]}"
90
- desc "Build #{package[:label]} and install it into #{dist_dir}."
91
- task package[:name] => [:prepare, download_task] do
92
- package_tmp_dir = tmp_dir + package[:name]
93
- rm_rf(package_tmp_dir)
94
- mkdir_p(package_tmp_dir)
95
-
96
- base = "#{package[:name]}-#{package[:version]}"
97
- tar = "#{base}.tar.#{package[:compression_method]}"
98
- tar_full_path = download_dir + tar
99
- Dir.chdir(package_tmp_dir.to_s) do
100
- sh("tar", "xf", tar_full_path.to_s) or exit(false)
101
- end
102
-
103
- Dir.chdir((package_tmp_dir + base).to_s) do
104
- (package[:patches] || []).each do |patch|
105
- sh("patch -p1 < #{patches_dir}/#{patch}")
106
- end
107
- (package[:remove_paths] || []).each do |path|
108
- rm_rf(path)
109
- end
110
- sh("./autogen.sh") if package[:need_autogen]
111
- sh("autoreconf --install") if package[:need_autoreconf]
112
- sh("./configure",
113
- "CPPFLAGS=#{cppflags(package)}",
114
- "LDFLAGS=#{ldflags(package)}",
115
- "--prefix=#{dist_dir}",
116
- "--host=#{@configuration.build_host}",
117
- *package[:configure_args]) or exit(false)
118
- common_make_args = []
119
- common_make_args << "GLIB_COMPILE_SCHEMAS=glib-compile-schemas"
120
- build_make_args = common_make_args.dup
121
- install_make_args = common_make_args.dup
122
- if package[:support_concurrent_build]
123
- make_n_jobs = ENV["MAKE_N_JOBS"]
124
- build_make_args << "-j#{make_n_jobs}" if make_n_jobs
125
- end
126
- ENV["GREP_OPTIONS"] = "--text"
127
- sh("nice", "make", *build_make_args) or exit(false)
128
- sh("make", "install", *install_make_args) or exit(false)
129
-
130
- package_license_dir = license_dir + package[:name]
131
- mkdir_p(package_license_dir)
132
- package_license_files = ["AUTHORS", "COPYING", "COPYING.LIB"]
133
- package_license_files = package_license_files.reject do |file|
134
- not File.exist?(file)
135
- end
136
- cp(package_license_files, package_license_dir)
137
- bundled_packages = package[:bundled_packages] || []
138
- bundled_packages.each do |bundled_package|
139
- bundled_package_license_dir = license_dir + bundled_package[:name]
140
- mkdir_p(bundled_package_license_dir)
141
- license_files = bundled_package[:license_files].collect do |file|
142
- File.join(bundled_package[:path], file)
143
- end
144
- cp(license_files, bundled_package_license_dir)
145
- end
146
- end
147
- end
148
- end
149
- end
150
- end
151
-
152
- def build_packages
153
- @configuration.build_packages
154
- end
155
-
156
- def dist_dir
157
- Pathname.new(@configuration.absolute_binary_dir)
158
- end
159
-
160
- def license_dir
161
- dist_dir + "share" + "license"
162
- end
163
-
164
- def package_root_dir
165
- Pathname.new(@configuration.package.root_dir)
166
- end
167
-
168
- def tmp_dir
169
- package_root_dir + "tmp"
170
- end
171
-
172
- def download_dir
173
- tmp_dir + "download"
174
- end
175
-
176
- def patches_dir
177
- package_root_dir + "patches"
178
- end
179
-
180
- def glib2_dir
181
- package_root_dir.parent + "glib2"
182
- end
183
-
184
- def glib2_include_path
185
- "#{glib2_dir}/vendor/local/include"
186
- end
187
-
188
- def glib2_lib_path
189
- "#{glib2_dir}/vendor/local/lib"
190
- end
191
-
192
- def rcairo_win32_dir
193
- package_root_dir.parent.parent + "rcairo.win32"
194
- end
195
-
196
- def rcairo_win32_pkgconfig_path
197
- "#{rcairo_win32_dir}/vendor/local/lib/pkgconfig"
198
- end
199
-
200
- def rcairo_win32_include_path
201
- "#{rcairo_win32_dir}/vendor/local/include"
202
- end
203
-
204
- def rcairo_win32_lib_path
205
- "#{rcairo_win32_dir}/vendor/local/lib"
206
- end
207
-
208
- def download_base_url(package)
209
- download_base_url = package[:download_base_url]
210
- return download_base_url if download_base_url
211
-
212
- case package[:download_site]
213
- when :gnome
214
- download_base_url = "http://ftp.gnome.org/pub/gnome/sources"
215
- release_series = package[:version].gsub(/\A(\d+\.\d+).+\z/, '\1')
216
- download_base_url << "/#{package[:name]}/#{release_series}"
217
- end
218
- download_base_url
219
- end
220
-
221
- def cppflags(package)
222
- include_paths = package[:include_paths] || []
223
- if @configuration.build_dependencies.include?("glib2")
224
- include_paths += [glib2_include_path]
225
- end
226
- include_paths += [
227
- rcairo_win32_include_path,
228
- dist_dir + 'include',
229
- ]
230
- cppflags = include_paths.collect do |path|
231
- "-I#{path}"
232
- end
233
- cppflags.join(" ")
234
- end
235
-
236
- def ldflags(package)
237
- library_paths = package[:library_paths] || []
238
- if @configuration.build_dependencies.include?("glib2")
239
- library_paths += [glib2_lib_path]
240
- end
241
- library_paths += [
242
- rcairo_win32_lib_path,
243
- dist_dir + 'lib',
244
- ]
245
- ldflags = library_paths.collect do |path|
246
- "-L#{path}"
247
- end
248
- ldflags.join(" ")
249
- end
250
- end