wxruby3 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/wx/version.rb +1 -1
- data/rakelib/gem.rake +1 -1
- data/rakelib/lib/config/mingw.rb +4 -101
- data/rakelib/lib/config/pkgman/linux.rb +31 -8
- data/rakelib/lib/config/pkgman/mingw.rb +112 -0
- data/rakelib/lib/director/window.rb +5 -0
- data/tests/test_gdi_object.rb +2 -2
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d56d06b3a74584ca43ec7314bc816c34175dbb7c68d722dfb88f2d1702dc295b
|
4
|
+
data.tar.gz: 60d6432e98d834f8eaea4e0e13c8a2bed3fd8a9419cc6331d74c945f9695d223
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef773e93094cfad19757c3d7ecfed29135d920a9f4e810521eadd6b226b8e13a10a735763853c1061d0256ce5fc84a2d5b0c28810874c99443c2a3e2548b753d
|
7
|
+
data.tar.gz: 92df4dfe100a6ec2c4353451d237a1a1819ac2777ac1fdbc9a4a8e6cb4996e8fc3254454582a5465e97c7613eaebca4a29e26935c87286798c24c5d235ef2d36
|
data/README.md
CHANGED
@@ -101,7 +101,7 @@ Currently the following are fully supported:
|
|
101
101
|
|
102
102
|
| Platform | Ruby version(s) | wxWidgets version(s) |
|
103
103
|
|------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|----------------------|
|
104
|
-
| Windows 10
|
104
|
+
| Windows >= 10 | Ruby >= 2.5<br>(RubyInstaller MSYS2-DevKit) | wxWidgets >= 3.2 |
|
105
105
|
| Linux (tested; all major AMD64 and ARM64 distributions: Ubuntu, Debian, Fedora, OpenSuSE and ArchLinux)<br>(most likely also i686) | Ruby >= 2.5 | wxWidgets >= 3.2 |
|
106
106
|
| MacOS >= 10.10 using Cocoa (tested on AMD64 and ARM64 M1/M2 Chip) | Ruby >= 2.5 (MacPorts, Homebrew, ruby-install, RVM) | wxWidgets >= 3.2 |
|
107
107
|
|
data/lib/wx/version.rb
CHANGED
data/rakelib/gem.rake
CHANGED
@@ -79,7 +79,7 @@ file WXRuby3::Gem.gem_file => WXRuby3::Gem.manifest do
|
|
79
79
|
gem.add_dependency 'rake'
|
80
80
|
gem.add_dependency 'minitest', '~> 5.15'
|
81
81
|
gem.add_dependency 'test-unit', '~> 3.5'
|
82
|
-
gem.add_dependency 'plat4m', '~> 1.
|
82
|
+
gem.add_dependency 'plat4m', '~> 1.1'
|
83
83
|
gem.rdoc_options <<
|
84
84
|
'--exclude=\\.dll' <<
|
85
85
|
'--exclude=\\.so' <<
|
data/rakelib/lib/config/mingw.rb
CHANGED
@@ -7,6 +7,7 @@
|
|
7
7
|
###
|
8
8
|
|
9
9
|
require_relative './unixish'
|
10
|
+
require_relative 'pkgman/mingw'
|
10
11
|
|
11
12
|
require 'uri'
|
12
13
|
|
@@ -26,13 +27,6 @@ module WXRuby3
|
|
26
27
|
|
27
28
|
module Platform
|
28
29
|
|
29
|
-
SWIG_URL = 'https://sourceforge.net/projects/swig/files/swigwin/swigwin-4.2.0/swigwin-4.2.0.zip/download'
|
30
|
-
SWIG_ZIP = 'swigwin-4.2.0.zip'
|
31
|
-
|
32
|
-
DOXYGEN_URL = 'https://www.doxygen.nl/files/doxygen-1.10.0.windows.x64.bin.zip'
|
33
|
-
|
34
|
-
GIT_URL = 'https://github.com/git-for-windows/git/releases/download/v2.43.0.windows.1/MinGit-2.43.0-64-bit.zip'
|
35
|
-
|
36
30
|
def self.included(base)
|
37
31
|
base.class_eval do
|
38
32
|
include Config::UnixLike
|
@@ -85,71 +79,10 @@ module WXRuby3
|
|
85
79
|
|
86
80
|
def install_prerequisites
|
87
81
|
pkg_deps = super
|
88
|
-
|
89
|
-
# autoinstall or not?
|
90
|
-
unless wants_autoinstall?
|
91
|
-
STDERR.puts <<~__ERROR_TXT
|
92
|
-
ERROR: This system lacks installed versions of the following required software packages:
|
93
|
-
#{pkg_deps.join(', ')}
|
94
|
-
|
95
|
-
Install these packages and try again.
|
96
|
-
__ERROR_TXT
|
97
|
-
exit(1)
|
98
|
-
end
|
99
|
-
# if SWIG was not found in the PATH
|
100
|
-
if pkg_deps.include?('swig')
|
101
|
-
$stdout.print 'Installing SWIG...' if run_silent?
|
102
|
-
# download and install SWIG
|
103
|
-
fname = download_and_install(SWIG_URL, SWIG_ZIP, 'swig.exe')
|
104
|
-
$stdout.puts 'done!' if run_silent?
|
105
|
-
Config.instance.log_progress("Installed #{fname}")
|
106
|
-
set_config('swig', fname)
|
107
|
-
Config.save
|
108
|
-
end
|
109
|
-
# if doxygen was not found in the PATH
|
110
|
-
if pkg_deps.include?('doxygen')
|
111
|
-
$stdout.print 'Installing Doxygen...' if run_silent?
|
112
|
-
# download and install doxygen
|
113
|
-
fname = download_and_install(DOXYGEN_URL, File.basename(URI(DOXYGEN_URL).path), 'doxygen.exe', 'doxygen')
|
114
|
-
$stdout.puts 'done!' if run_silent?
|
115
|
-
Config.instance.log_progress("Installed #{fname}")
|
116
|
-
set_config('doxygen', fname)
|
117
|
-
Config.save
|
118
|
-
end
|
119
|
-
# if git was not found in the PATH
|
120
|
-
if pkg_deps.include?('git')
|
121
|
-
$stdout.print 'Installing Git...' if run_silent?
|
122
|
-
# download and install doxygen
|
123
|
-
fname = download_and_install(GIT_URL, File.basename(URI(GIT_URL).path), 'git.exe', 'git')
|
124
|
-
$stdout.puts 'done!' if run_silent?
|
125
|
-
Config.instance.log_progress("Installed #{fname}")
|
126
|
-
set_config('git', fname)
|
127
|
-
Config.save
|
128
|
-
end
|
129
|
-
end
|
82
|
+
PkgManager.install(pkg_deps)
|
130
83
|
[]
|
131
84
|
end
|
132
85
|
|
133
|
-
# only called after src gem build
|
134
|
-
def cleanup_prerequisites
|
135
|
-
tmp_tool_root = File.join(ENV['HOME'].gsub("\\", '/'), '.wxruby3')
|
136
|
-
path = get_cfg_string('swig')
|
137
|
-
unless path.empty? || !path.start_with?(tmp_tool_root)
|
138
|
-
path = File.dirname(path) while File.dirname(path) != tmp_tool_root
|
139
|
-
rm_rf(path)
|
140
|
-
end
|
141
|
-
path = get_cfg_string('doxygen')
|
142
|
-
unless path.empty? || !path.start_with?(tmp_tool_root)
|
143
|
-
path = File.dirname(path) while File.dirname(path) != tmp_tool_root
|
144
|
-
rm_rf(path)
|
145
|
-
end
|
146
|
-
path = get_cfg_string('git')
|
147
|
-
unless path.empty? || !path.start_with?(tmp_tool_root)
|
148
|
-
path = File.dirname(path) while File.dirname(path) != tmp_tool_root
|
149
|
-
rm_rf(path)
|
150
|
-
end
|
151
|
-
end
|
152
|
-
|
153
86
|
def expand(cmd)
|
154
87
|
super("bash -c \"#{cmd}\"")
|
155
88
|
end
|
@@ -164,38 +97,8 @@ module WXRuby3
|
|
164
97
|
|
165
98
|
private
|
166
99
|
|
167
|
-
def
|
168
|
-
|
169
|
-
tmp_tool_root = File.join(ENV['HOME'].gsub("\\", '/'), '.wxruby3')
|
170
|
-
dest = unpack_to ? File.join(tmp_tool_root, unpack_to) : File.join(tmp_tool_root, File.basename(zip, '.*'))
|
171
|
-
mkdir(tmp_tool_root) unless File.directory?(tmp_tool_root)
|
172
|
-
# download
|
173
|
-
chdir(tmp_tool_root) do
|
174
|
-
unless download_file(url, zip)
|
175
|
-
STDERR.puts "ERROR: Failed to download installation package for #{exe}"
|
176
|
-
exit(1)
|
177
|
-
end
|
178
|
-
# unpack
|
179
|
-
unless sh("powershell Expand-Archive -LiteralPath '#{zip}' -DestinationPath #{dest} -Force")
|
180
|
-
STDERR.puts "ERROR: Failed to unpack installation package for #{exe}"
|
181
|
-
exit(1)
|
182
|
-
end
|
183
|
-
# cleanup
|
184
|
-
rm_f(zip)
|
185
|
-
end
|
186
|
-
# find executable
|
187
|
-
find_exe(dest, exe)
|
188
|
-
end
|
189
|
-
|
190
|
-
def find_exe(path, exe)
|
191
|
-
fp = Dir.glob(File.join(path, '*')).find { |p| File.file?(p) && File.basename(p) == exe }
|
192
|
-
unless fp
|
193
|
-
Dir.glob(File.join(path, '*')).each do |p|
|
194
|
-
fp = find_exe(p, exe) if File.directory?(p)
|
195
|
-
return fp if fp
|
196
|
-
end
|
197
|
-
end
|
198
|
-
fp
|
100
|
+
def wx_configure
|
101
|
+
bash('./configure --prefix=`pwd`/install --disable-tests --without-subdirs --without-regex --with-expat=builtin --with-zlib=builtin --disable-debug_info')
|
199
102
|
end
|
200
103
|
|
201
104
|
def wx_make
|
@@ -14,11 +14,33 @@ module WXRuby3
|
|
14
14
|
|
15
15
|
module PkgManager
|
16
16
|
|
17
|
+
class PlatformDependencies
|
18
|
+
def initialize(*defaults)
|
19
|
+
@dependencies = ::Hash.new
|
20
|
+
@dependencies.default = ::Hash.new(defaults.flatten)
|
21
|
+
end
|
22
|
+
|
23
|
+
def add(distro, *deps, release: nil)
|
24
|
+
@dependencies[distro] ||= ::Hash.new
|
25
|
+
if release
|
26
|
+
@dependencies[distro][release] = deps.flatten
|
27
|
+
else
|
28
|
+
@dependencies[distro].default = deps.flatten
|
29
|
+
end
|
30
|
+
self
|
31
|
+
end
|
32
|
+
|
33
|
+
def get(distro, release: nil)
|
34
|
+
@dependencies[distro][release]
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
17
38
|
PLATFORM_DEPS = {
|
18
|
-
debian: %w[libgtk-3-dev libwebkit2gtk-4.0-dev libgspell-1-dev libunwind-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcurl4-openssl-dev libsecret-1-dev libnotify-dev]
|
19
|
-
|
20
|
-
|
21
|
-
|
39
|
+
debian: PlatformDependencies.new(%w[libgtk-3-dev libwebkit2gtk-4.0-dev libgspell-1-dev libunwind-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcurl4-openssl-dev libsecret-1-dev libnotify-dev])
|
40
|
+
.add('ubuntu', %w[libgtk-3-dev libwebkit2gtk-4.1-dev libgspell-1-dev libunwind-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcurl4-openssl-dev libsecret-1-dev libnotify-dev], release: '24.04'),
|
41
|
+
rhel: PlatformDependencies.new(%w[expat-devel findutils gspell-devel gstreamer1-plugins-base-devel gtk3-devel libcurl-devel libjpeg-devel libnotify-devel libpng-devel libSM-devel libsecret-devel libtiff-devel SDL-devel webkit2gtk4.1-devel zlib-devel]),
|
42
|
+
suse: PlatformDependencies.new(%w[gtk3-devel webkit2gtk3-devel gspell-devel gstreamer-devel gstreamer-plugins-base-devel libcurl-devel libsecret-devel libnotify-devel libSDL-devel zlib-devel libjpeg-devel libpng-devel]),
|
43
|
+
arch: PlatformDependencies.new(%w[pkg-config gtk3 webkit2gtk gspell libunwind gstreamer curl libsecret libnotify libpng12])
|
22
44
|
}
|
23
45
|
PLATFORM_ALTS = {
|
24
46
|
suse: { 'g++' => 'gcc-c++' },
|
@@ -41,7 +63,7 @@ module WXRuby3
|
|
41
63
|
|
42
64
|
Make sure the following packages (or equivalent) are installed and than try again with `--no-autoinstall`:
|
43
65
|
#{pkgs.join(', ')}
|
44
|
-
|
66
|
+
__ERROR_TXT
|
45
67
|
exit(1)
|
46
68
|
end
|
47
69
|
# can we install?
|
@@ -63,7 +85,7 @@ module WXRuby3
|
|
63
85
|
#{pkgs.join(', ')}
|
64
86
|
|
65
87
|
Install these packages and try again.
|
66
|
-
|
88
|
+
__ERROR_TXT
|
67
89
|
exit(1)
|
68
90
|
end
|
69
91
|
# do the actual install
|
@@ -73,7 +95,7 @@ module WXRuby3
|
|
73
95
|
#{pkgs.join(', ')}
|
74
96
|
|
75
97
|
Fix any problems or install these packages yourself and try again.
|
76
|
-
|
98
|
+
__ERROR_TXT
|
77
99
|
if WXRuby3.config.run_silent?
|
78
100
|
$stderr.puts "For error details check #{WXRuby3.config.silent_log_name}"
|
79
101
|
end
|
@@ -90,7 +112,8 @@ module WXRuby3
|
|
90
112
|
end
|
91
113
|
|
92
114
|
def platform_pkgs
|
93
|
-
PLATFORM_DEPS[WXRuby3.config.sysinfo.os.variant.to_sym]
|
115
|
+
deps = PLATFORM_DEPS[WXRuby3.config.sysinfo.os.variant.to_sym]
|
116
|
+
deps ? deps.get(WXRuby3.config.sysinfo.os.distro, release: WXRuby3.config.sysinfo.os.release) : []
|
94
117
|
end
|
95
118
|
|
96
119
|
def add_platform_pkgs(pkgs)
|
@@ -0,0 +1,112 @@
|
|
1
|
+
# Copyright (c) 2023 M.J.N. Corino, The Netherlands
|
2
|
+
#
|
3
|
+
# This software is released under the MIT license.
|
4
|
+
|
5
|
+
###
|
6
|
+
# wxRuby3 buildtools platform pkg manager base
|
7
|
+
###
|
8
|
+
|
9
|
+
module WXRuby3
|
10
|
+
|
11
|
+
module Config
|
12
|
+
|
13
|
+
module Platform
|
14
|
+
|
15
|
+
module PkgManager
|
16
|
+
|
17
|
+
XTRA_PLATFORM_DEPS = %w[python]
|
18
|
+
|
19
|
+
class << self
|
20
|
+
|
21
|
+
def install(pkgs)
|
22
|
+
# do we need to install anything?
|
23
|
+
if !pkgs.empty? || builds_wxwidgets?
|
24
|
+
# check windows distro compatibility
|
25
|
+
unless no_autoinstall? || pkgman
|
26
|
+
# do we need to build wxWidgets?
|
27
|
+
pkgs.concat(XTRA_PLATFORM_DEPS) if builds_wxwidgets?
|
28
|
+
$stderr.puts <<~__ERROR_TXT
|
29
|
+
ERROR: Do not know how to install required packages for distro type '#{WXRuby3.config.sysinfo.os.variant}'.
|
30
|
+
|
31
|
+
Make sure the following packages (or equivalent) are installed and than try again with `--no-autoinstall`:
|
32
|
+
#{pkgs.join(', ')}
|
33
|
+
__ERROR_TXT
|
34
|
+
exit(1)
|
35
|
+
end
|
36
|
+
# can we install?
|
37
|
+
unless no_autoinstall? || pkgman
|
38
|
+
$stderr.puts 'ERROR: Do not know how to check for or install required packages. Please install manually and than try again with `--no-autoinstall`.'
|
39
|
+
exit(1)
|
40
|
+
end
|
41
|
+
# do we need to build wxWidgets?
|
42
|
+
if builds_wxwidgets?
|
43
|
+
# add platform specific packages for wxWidgets
|
44
|
+
pkgs.concat(XTRA_PLATFORM_DEPS)
|
45
|
+
end
|
46
|
+
# do we actually have any packages to install?
|
47
|
+
unless pkgs.empty?
|
48
|
+
# autoinstall or not?
|
49
|
+
unless wants_autoinstall?
|
50
|
+
$stderr.puts <<~__ERROR_TXT
|
51
|
+
ERROR: This system may lack installed versions of the following required software packages:
|
52
|
+
#{pkgs.join(', ')}
|
53
|
+
|
54
|
+
Install these packages and try again.
|
55
|
+
__ERROR_TXT
|
56
|
+
exit(1)
|
57
|
+
end
|
58
|
+
# do the actual install
|
59
|
+
unless run(pkgman.make_install_command(*pkgs))
|
60
|
+
$stderr.puts <<~__ERROR_TXT
|
61
|
+
ERROR: Failed to install all or some of the following required software packages:
|
62
|
+
#{pkgs.join(', ')}
|
63
|
+
|
64
|
+
Fix any problems or install these packages yourself and try again.
|
65
|
+
__ERROR_TXT
|
66
|
+
if WXRuby3.config.run_silent?
|
67
|
+
$stderr.puts "For error details check #{WXRuby3.config.silent_log_name}"
|
68
|
+
end
|
69
|
+
exit(1)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
private
|
76
|
+
|
77
|
+
def pkgman
|
78
|
+
@pkgman ||= WXRuby3.config.sysinfo.os.pkgman
|
79
|
+
end
|
80
|
+
|
81
|
+
def builds_wxwidgets?
|
82
|
+
Config.get_config('with-wxwin') && Config.get_cfg_string('wxwin').empty?
|
83
|
+
end
|
84
|
+
|
85
|
+
def no_autoinstall?
|
86
|
+
Config.get_config('autoinstall') == false
|
87
|
+
end
|
88
|
+
|
89
|
+
def wants_autoinstall?
|
90
|
+
WXRuby3.config.wants_autoinstall?
|
91
|
+
end
|
92
|
+
|
93
|
+
def run(cmd)
|
94
|
+
$stdout.print "Running #{cmd}..."
|
95
|
+
rc = WXRuby3.config.bash(cmd)
|
96
|
+
$stderr.puts(rc ? 'done!' : 'FAILED!')
|
97
|
+
rc
|
98
|
+
end
|
99
|
+
|
100
|
+
def expand(cmd)
|
101
|
+
`#{is_root? ? '' : 'sudo '}#{cmd}`
|
102
|
+
end
|
103
|
+
|
104
|
+
end
|
105
|
+
|
106
|
+
end
|
107
|
+
|
108
|
+
end
|
109
|
+
|
110
|
+
end
|
111
|
+
|
112
|
+
end
|
@@ -315,6 +315,11 @@ module WXRuby3
|
|
315
315
|
"#{spec.class_name(citem)}::WarpPointer",
|
316
316
|
"#{spec.class_name(citem)}::AdjustForLayoutDirection",
|
317
317
|
"#{spec.class_name(citem)}::IsTransparentBackgroundSupported")
|
318
|
+
if Config.instance.features_set?('USE_ACCESSIBILITY')
|
319
|
+
if Config.instance.wx_version > '3.2.4'
|
320
|
+
spec.no_proxy "#{spec.class_name(citem)}::CreateAccessible"
|
321
|
+
end
|
322
|
+
end
|
318
323
|
end
|
319
324
|
end
|
320
325
|
if spec.module_name == 'wxWindow'
|
data/tests/test_gdi_object.rb
CHANGED
@@ -12,14 +12,14 @@ class TestGDIObjects < Test::Unit::TestCase
|
|
12
12
|
frame = Wx::Frame.new(nil)
|
13
13
|
frame.set_icon(ico)
|
14
14
|
GC.start
|
15
|
-
ico_cpy = frame.
|
15
|
+
ico_cpy = frame.get_icons.get_icon_by_index(0)
|
16
16
|
GC.start
|
17
17
|
assert(ico_cpy.ok?)
|
18
18
|
assert_not_equal(ico.object_id, ico_cpy.object_id)
|
19
19
|
ico = nil
|
20
20
|
ico_cpy = nil
|
21
21
|
GC.start
|
22
|
-
ico_cpy = frame.
|
22
|
+
ico_cpy = frame.get_icons.get_icon_by_index(0)
|
23
23
|
GC.start
|
24
24
|
assert(ico_cpy.ok?)
|
25
25
|
assert_not_equal(ico.object_id, ico_cpy.object_id)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wxruby3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Corino
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '1.
|
75
|
+
version: '1.1'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '1.
|
82
|
+
version: '1.1'
|
83
83
|
description: wxRuby3 is a Ruby library providing an extension for the wxWidgets C++
|
84
84
|
UI framework
|
85
85
|
email: mcorino@m2c-software.nl
|
@@ -425,6 +425,7 @@ files:
|
|
425
425
|
- rakelib/lib/config/mingw.rb
|
426
426
|
- rakelib/lib/config/pkgman/linux.rb
|
427
427
|
- rakelib/lib/config/pkgman/macosx.rb
|
428
|
+
- rakelib/lib/config/pkgman/mingw.rb
|
428
429
|
- rakelib/lib/config/unixish.rb
|
429
430
|
- rakelib/lib/config/unknown.rb
|
430
431
|
- rakelib/lib/core/include/client_data.inc
|