webkit2-gtk 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 42437c735091fd6ff308c043fed8be8aa7028aa9
4
+ data.tar.gz: cf1cd6b2d88fad14eb3850de499f49bbeb33ddf2
5
+ SHA512:
6
+ metadata.gz: 009d7f274371d24237c8a3ec05ec10ab9a9260bbfd43405e55ed881eea0bd602e67567ea54a959cf9ba2f05444f4e8ee51af8536e0c1763c43c05cd472f19617
7
+ data.tar.gz: 0428b3de1bfa01a410ea0e1dfc3ab7aa6aaae5434729e464abb7e219245b891edf6ebd9c27ceece33a1a177d1af657e18c31186b1c9ce02f7df7e17f062af81b
data/Rakefile ADDED
@@ -0,0 +1,123 @@
1
+ # -*- ruby -*-
2
+ #
3
+ # Copyright (C) 2015 Ruby-GNOME2 Project Team
4
+ #
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation; either
8
+ # version 2.1 of the License, or (at your option) any later version.
9
+ #
10
+ # This library is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ # Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public
16
+ # License along with this library; if not, write to the Free Software
17
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
+
19
+ $LOAD_PATH.unshift("./../glib2/lib")
20
+ require "gnome2/rake/package-task"
21
+
22
+ package_task = GNOME2::Rake::PackageTask.new do |package|
23
+ package.summary = "Ruby/WebKit2GTK is a Ruby binding of WebKit2GTK+."
24
+ package.description = "Ruby/WebKit2GTK is a Ruby binding of WebKit2GTK+."
25
+ package.dependency.gem.runtime = ["gobject-introspection", "gtk3"]
26
+ package.dependency.gem.development = ["test-unit-notify"]
27
+ package.windows.packages = []
28
+ package.windows.dependencies = []
29
+ package.windows.build_dependencies = [
30
+ "glib2",
31
+ "gio2",
32
+ "gobject-introspection",
33
+ "atk",
34
+ "pango",
35
+ "gdk_pixbuf2",
36
+ "gdk3",
37
+ "gstreamer",
38
+ ]
39
+ package.windows.gobject_introspection_dependencies = [
40
+ "gio2",
41
+ "atk",
42
+ "gdk_pixbuf2",
43
+ "pango",
44
+ "gdk3",
45
+ "gstreamer",
46
+ ]
47
+
48
+ gstreamer_relative_binary_dir =
49
+ package.package.project_root_dir +
50
+ "gstreamer" +
51
+ package.windows.relative_binary_dir
52
+ gstreamer_absolute_binary_dir = gstreamer_relative_binary_dir.expand_path
53
+
54
+ rcairo_relative_binary_dir =
55
+ package.package.project_root_dir.parent +
56
+ "rcairo.#{package.windows.build_architecture_suffix}" +
57
+ package.windows.relative_binary_dir
58
+ rcairo_absolute_binary_dir = rcairo_relative_binary_dir.expand_path
59
+
60
+ package.external_packages = [
61
+ {
62
+ :name => "libwebp",
63
+ :download_base_url => "http://downloads.webmproject.org/releases/webp",
64
+ :label => "WebP",
65
+ :version => "0.4.3",
66
+ :windows => {
67
+ :built_file => "bin/libwebp-5.dll",
68
+ },
69
+ },
70
+ {
71
+ :name => "libxslt",
72
+ :version => "1.1.28",
73
+ :download_base_url => "ftp://xmlsoft.org/libxslt",
74
+ :compression_method => "gz",
75
+ :windows => {
76
+ :built_file => "bin/libxslt-1.dll",
77
+ :configure_args => [
78
+ "--without-python",
79
+ "--with-libxml-prefix=#{rcairo_absolute_binary_dir}",
80
+ ],
81
+ :patches => [
82
+ "libxslt-1.1.28-add-mkdir-fallback.diff",
83
+ ],
84
+ },
85
+ },
86
+ {
87
+ :name => "webkitgtk",
88
+ :download_base_url => "http://webkitgtk.org/releases",
89
+ :label => "WebKitGTK+",
90
+ :version => "2.8.5",
91
+ :compression_method => "xz",
92
+ :windows => {
93
+ :cmake_args => [
94
+ "-DPORT=GTK",
95
+ "-DZLIB_INCLUDE_DIR=#{rcairo_absolute_binary_dir}/include",
96
+ "-DZLIB_LIBRARY=#{rcairo_absolute_binary_dir}/lib",
97
+ "-DPNG_PNG_INCLUDE_DIR=#{rcairo_absolute_binary_dir}/include",
98
+ "-DPNG_LIBRARY=#{rcairo_absolute_binary_dir}/lib",
99
+ "-DJPEG_INCLUDE_DIR=#{gstreamer_absolute_binary_dir}/include",
100
+ "-DJPEG_LIBRARY=#{gstreamer_absolute_binary_dir}/lib",
101
+ "-DFONTCONFIG_INCLUDE_DIR=#{rcairo_absolute_binary_dir}/include",
102
+ "-DFONTCONFIG_LIBRARIES=#{rcairo_absolute_binary_dir}/lib",
103
+ "-DSQLITE_INCLUDE_DIR=#{gstreamer_absolute_binary_dir}/include",
104
+ "-DSQLITE_LIBRARIES=#{gstreamer_absolute_binary_dir}/lib",
105
+ "-DENABLE_PLUGIN_PROCESS_GTK2=OFF",
106
+ "-DENABLE_X11_TARGET=OFF",
107
+ ],
108
+ :patches => [
109
+ ],
110
+ },
111
+ },
112
+ ]
113
+ end
114
+ package_task.define
115
+
116
+ namespace :dependency do
117
+ desc "Install depenencies"
118
+ task :install do
119
+ # TODO: Install libwebkit2gtk-4.0-37 on Debian.
120
+ end
121
+ end
122
+
123
+ task :build => "dependency:install"
@@ -0,0 +1,33 @@
1
+ # Copyright (C) 2015 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ module WebKit2Gtk
18
+ module Version
19
+ STRING = [MAJOR, MINOR, MICRO].join(".")
20
+
21
+ class << self
22
+ def or_later?(major, minor, micro=nil)
23
+ micro ||= 0
24
+ version = [
25
+ MAJOR,
26
+ MINOR,
27
+ MICRO,
28
+ ]
29
+ (version <=> [major, minor, micro]) >= 0
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,87 @@
1
+ # Copyright (C) 2015 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ require "gobject-introspection"
18
+ require "gtk3"
19
+
20
+ base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path
21
+ vendor_dir = base_dir + "vendor" + "local"
22
+ vendor_bin_dir = vendor_dir + "bin"
23
+ GLib.prepend_dll_path(vendor_bin_dir)
24
+
25
+ module WebKit2Gtk
26
+ class << self
27
+ def const_missing(name)
28
+ init
29
+ if const_defined?(name)
30
+ const_get(name)
31
+ else
32
+ super
33
+ end
34
+ end
35
+
36
+ def init
37
+ class << self
38
+ remove_method(:init)
39
+ remove_method(:const_missing)
40
+ end
41
+ Gtk.init if Gtk.respond_to?(:init)
42
+ loader = Loader.new(self)
43
+ loader.load
44
+ end
45
+ end
46
+
47
+ class Loader < GObjectIntrospection::Loader
48
+ NAMESPACE = "WebKit2"
49
+
50
+ def load
51
+ super(NAMESPACE)
52
+ end
53
+
54
+ private
55
+ def pre_load(repository, namespace)
56
+ define_version_module
57
+ end
58
+
59
+ def post_load(repository, namespace)
60
+ require_libraries
61
+ end
62
+
63
+ def define_version_module
64
+ @version_module = Module.new
65
+ @base_module.const_set("Version", @version_module)
66
+ end
67
+
68
+ def require_libraries
69
+ require "webkit2-gtk/version"
70
+ end
71
+
72
+ def initialize_post(object)
73
+ super
74
+ return unless object.is_a?(GLib::Object)
75
+ self.class.reference_gobject(object, :sink => true)
76
+ end
77
+
78
+ def load_constant_info(info)
79
+ case info.name
80
+ when /_VERSION\z/
81
+ @version_module.const_set($PREMATCH, info.value)
82
+ else
83
+ super
84
+ end
85
+ end
86
+ end
87
+ end
data/sample/browser.rb ADDED
@@ -0,0 +1,30 @@
1
+ # Copyright (C) 2015 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ require "webkit2-gtk"
18
+
19
+ window = Gtk::Window.new
20
+ window.signal_connect("destroy") do
21
+ Gtk.main_quit
22
+ end
23
+
24
+ view = WebKit2Gtk::WebView.new
25
+ view.load_uri("http://webkitgtk.org/")
26
+
27
+ window.add(view)
28
+ window.show_all
29
+
30
+ Gtk.main
data/test/run-test.rb ADDED
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Copyright (C) 2015 Ruby-GNOME2 Project Team
4
+ #
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation; either
8
+ # version 2.1 of the License, or (at your option) any later version.
9
+ #
10
+ # This library is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ # Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public
16
+ # License along with this library; if not, write to the Free Software
17
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
+
19
+ ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..")
20
+ ruby_gnome2_base = File.expand_path(ruby_gnome2_base)
21
+
22
+ glib_base = File.join(ruby_gnome2_base, "glib2")
23
+ gio_base = File.join(ruby_gnome2_base, "gio2")
24
+ atk_base = File.join(ruby_gnome2_base, "atk")
25
+ pango_base = File.join(ruby_gnome2_base, "pango")
26
+ gdk_pixbuf_base = File.join(ruby_gnome2_base, "gdk_pixbuf2")
27
+ gdk3_base = File.join(ruby_gnome2_base, "gdk3")
28
+ gtk3_base = File.join(ruby_gnome2_base, "gtk3")
29
+ gobject_introspection_base = File.join(ruby_gnome2_base, "gobject-introspection")
30
+ cairo_gobject_base = File.join(ruby_gnome2_base, "cairo-gobject")
31
+ webkit2_gtk_base = File.join(ruby_gnome2_base, "webkit2-gtk")
32
+
33
+ modules = [
34
+ [glib_base, "glib2"],
35
+ [gio_base, "gio2"],
36
+ [atk_base, "atk"],
37
+ [pango_base, "pango"],
38
+ [gdk_pixbuf_base, "gdk_pixbuf2"],
39
+ [gdk3_base, "gdk3"],
40
+ [gtk3_base, "gtk3"],
41
+ [gobject_introspection_base, "gobject-introspection"],
42
+ [cairo_gobject_base, "cairo-gobject"],
43
+ [webkit2_gtk_base, "webkit2-gtk"],
44
+ ]
45
+ modules.each do |target, module_name|
46
+ if File.exist?("Makefile") and system("which make > /dev/null")
47
+ `make -C #{target.dump} > /dev/null` or exit(false)
48
+ end
49
+ $LOAD_PATH.unshift(File.join(target, "ext", module_name))
50
+ $LOAD_PATH.unshift(File.join(target, "lib"))
51
+ end
52
+
53
+ $LOAD_PATH.unshift(File.join(glib_base, "test"))
54
+ require "glib-test-init"
55
+
56
+ $LOAD_PATH.unshift(File.join(gobject_introspection_base, "test"))
57
+ require "gobject-introspection-test-utils"
58
+
59
+ $LOAD_PATH.unshift(File.join(webkit2_gtk_base, "test"))
60
+ require "webkit2-gtk-test-utils"
61
+
62
+ require "webkit2-gtk"
63
+
64
+ repository = GObjectIntrospection::Repository.default
65
+ begin
66
+ repository.require(WebKit2Gtk::Loader::NAMESPACE)
67
+ rescue GLib::Error
68
+ puts("Omit because typelib file doesn't exist: #{$!.message}")
69
+ exit(true)
70
+ end
71
+
72
+ exit Test::Unit::AutoRunner.run(true)
@@ -0,0 +1,61 @@
1
+ # Copyright (C) 2015 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ class TestWebKit2GtkWebView < Test::Unit::TestCase
18
+ def setup
19
+ @view = WebKit2Gtk::WebView.new
20
+ @http_server = WEBrick::HTTPServer.new(:Port => 0)
21
+ @http_server.mount_proc("/") do |request, response|
22
+ response.body = "Hello"
23
+ end
24
+ @http_server_thread = Thread.new do
25
+ @http_server.start
26
+ end
27
+ end
28
+
29
+ def teardown
30
+ @http_server.shutdown
31
+ @http_server_thread.join
32
+ end
33
+
34
+ def http_url
35
+ port = @http_server[:Port]
36
+ "http://127.0.0.1:#{port}/"
37
+ end
38
+
39
+ test "#load_uri" do
40
+ loaded = false
41
+
42
+ loop = GLib::MainLoop.new
43
+ timeout_id = GLib::Timeout.add(1000) do
44
+ timeout_id = nil
45
+ loop.quit
46
+ GLib::Source::REMOVE
47
+ end
48
+ @view.signal_connect("load-changed") do |view, event|
49
+ case event
50
+ when WebKit2Gtk::LoadEvent::FINISHED
51
+ GLib::Source.remove(timeout_id) if timeout_id
52
+ loaded = true
53
+ loop.quit
54
+ end
55
+ end
56
+ @view.load_uri(http_url)
57
+ loop.run
58
+
59
+ assert_true(loaded)
60
+ end
61
+ end
@@ -0,0 +1,28 @@
1
+ # Copyright (C) 2015 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ require "test-unit"
18
+
19
+ require "webrick"
20
+
21
+ module WebKit2GtkTestUtils
22
+ def only_webkit2_gtk_version(major, minor, micro=nil)
23
+ micro ||= 0
24
+ unless WebKit2Gtk.or_later?(major, minor, micro)
25
+ omit("Require WebKit2Gtk >= #{major}.#{minor}.#{micro}")
26
+ end
27
+ end
28
+ end
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: webkit2-gtk
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.0.1
5
+ platform: ruby
6
+ authors:
7
+ - The Ruby-GNOME2 Project Team
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-09-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: gobject-introspection
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 3.0.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 3.0.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: gtk3
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 3.0.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 3.0.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: test-unit-notify
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Ruby/WebKit2GTK is a Ruby binding of WebKit2GTK+.
56
+ email: ruby-gnome2-devel-en@lists.sourceforge.net
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - Rakefile
62
+ - lib/webkit2-gtk.rb
63
+ - lib/webkit2-gtk/version.rb
64
+ - sample/browser.rb
65
+ - test/run-test.rb
66
+ - test/test-webkit2-gtk-webview.rb
67
+ - test/webkit2-gtk-test-utils.rb
68
+ homepage: http://ruby-gnome2.sourceforge.jp/
69
+ licenses:
70
+ - LGPLv2.1 or later
71
+ metadata: {}
72
+ post_install_message:
73
+ rdoc_options: []
74
+ require_paths:
75
+ - lib
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: 1.9.3
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ requirements: []
87
+ rubyforge_project:
88
+ rubygems_version: 2.2.2
89
+ signing_key:
90
+ specification_version: 4
91
+ summary: Ruby/WebKit2GTK is a Ruby binding of WebKit2GTK+.
92
+ test_files: []