tebako 0.5.12 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CMakeLists.txt +107 -196
- data/README.adoc +82 -22
- data/common.env +1 -1
- data/exe/tebako-packager +15 -9
- data/lib/tebako/cli.rb +25 -32
- data/lib/tebako/cli_helpers.rb +53 -44
- data/lib/tebako/cli_rubies.rb +75 -0
- data/lib/tebako/error.rb +17 -2
- data/lib/tebako/packager/pass1.rb +71 -6
- data/lib/tebako/packager/pass2.rb +58 -79
- data/lib/tebako/packager/patch_libraries.rb +138 -0
- data/lib/tebako/packager/patch_literals.rb +150 -70
- data/lib/tebako/packager.rb +28 -2
- data/lib/tebako/version.rb +1 -1
- data/src/tebako-main.cpp +1 -38
- data/version.txt +1 -1
- metadata +4 -2
data/lib/tebako/packager.rb
CHANGED
@@ -48,10 +48,11 @@ module Tebako
|
|
48
48
|
|
49
49
|
FILES_TO_RESTORE_MSYS = %w[
|
50
50
|
ruby.c
|
51
|
-
win32/win32.c
|
52
51
|
win32/file.c
|
53
|
-
win32/dir.h
|
54
52
|
].freeze
|
53
|
+
# Do not need to restore cygwin/GNUmakefile.in
|
54
|
+
# because it is patched (differently) both on pass 1 and pass2
|
55
|
+
# cygwin/GNUmakefile.in
|
55
56
|
|
56
57
|
FILES_TO_RESTORE_MUSL = %w[
|
57
58
|
thread_pthread.c
|
@@ -70,6 +71,19 @@ module Tebako
|
|
70
71
|
RUBYGEMS_VERSION = "3.4.22"
|
71
72
|
|
72
73
|
class << self
|
74
|
+
# Create implib
|
75
|
+
def create_implib(src_dir, package_src_dir, app_name, ruby_ver)
|
76
|
+
puts " ... creating Windows import library"
|
77
|
+
File.open(def_fname(src_dir, app_name), "w") do |file|
|
78
|
+
file.puts "LIBRARY #{out_fname(app_name)}"
|
79
|
+
file.puts File.read(File.join(src_dir, "tebako.def"))
|
80
|
+
end
|
81
|
+
params = ["dlltool", "-d", def_fname(src_dir, app_name), "-D", out_fname(app_name),
|
82
|
+
"--output-lib", lib_fname(package_src_dir, ruby_ver)]
|
83
|
+
out, st = Open3.capture2e(*params)
|
84
|
+
raise Tebako::Error, "Failed to create import library:\n #{out}" unless st.exitstatus.zero?
|
85
|
+
end
|
86
|
+
|
73
87
|
# Deploy
|
74
88
|
def deploy(src_dir, tbd, gflength)
|
75
89
|
puts "-- Running deploy script"
|
@@ -132,6 +146,18 @@ module Tebako
|
|
132
146
|
|
133
147
|
private
|
134
148
|
|
149
|
+
def def_fname(src_dir, app_name)
|
150
|
+
File.join(src_dir, "#{app_name}.def")
|
151
|
+
end
|
152
|
+
|
153
|
+
def out_fname(app_name)
|
154
|
+
File.join("#{app_name}.exe")
|
155
|
+
end
|
156
|
+
|
157
|
+
def lib_fname(src_dir, ruby_ver)
|
158
|
+
File.join(src_dir, "lib", "libx64-ucrt-ruby#{ruby_ver[0]}#{ruby_ver[2]}0.a")
|
159
|
+
end
|
160
|
+
|
135
161
|
def install_gem(tbd, name, ver = nil)
|
136
162
|
puts " ... installing #{name} gem#{" version #{ver}" if ver}"
|
137
163
|
PatchHelpers.with_env(DEPLOY_ENV) do
|
data/lib/tebako/version.rb
CHANGED
data/src/tebako-main.cpp
CHANGED
@@ -35,6 +35,7 @@
|
|
35
35
|
#include <fcntl.h>
|
36
36
|
|
37
37
|
#include <string>
|
38
|
+
#include <cstdint>
|
38
39
|
|
39
40
|
#ifdef _WIN32
|
40
41
|
#include <winsock2.h>
|
@@ -148,41 +149,3 @@ extern "C" int tebako_main(int* argc, char*** argv) {
|
|
148
149
|
extern "C" const char* tebako_mount_point(void) {
|
149
150
|
return tebako::fs_mount_point;
|
150
151
|
}
|
151
|
-
|
152
|
-
#ifdef RB_W32
|
153
|
-
|
154
|
-
#if !defined(RUBY_WIN32_H)
|
155
|
-
struct stati128 {
|
156
|
-
_dev_t st_dev;
|
157
|
-
unsigned __int64 st_ino;
|
158
|
-
__int64 st_inohigh;
|
159
|
-
unsigned short st_mode;
|
160
|
-
short st_nlink;
|
161
|
-
short st_uid;
|
162
|
-
short st_gid;
|
163
|
-
_dev_t st_rdev;
|
164
|
-
__int64 st_size;
|
165
|
-
__time64_t st_atime;
|
166
|
-
long st_atimensec;
|
167
|
-
__time64_t st_mtime;
|
168
|
-
long st_mtimensec;
|
169
|
-
__time64_t st_ctime;
|
170
|
-
long st_ctimensec;
|
171
|
-
};
|
172
|
-
#endif
|
173
|
-
|
174
|
-
extern "C" int tebako_file_load_ok(const char *path) {
|
175
|
-
int ret = 0;
|
176
|
-
|
177
|
-
if (within_tebako_memfs(path)) {
|
178
|
-
int fd = tebako_open(2, path, O_RDONLY);
|
179
|
-
if (fd != -1) {
|
180
|
-
struct STAT_TYPE st;
|
181
|
-
ret = (tebako_fstat(fd, &st)==0) ? 1:0;
|
182
|
-
tebako_close(fd);
|
183
|
-
}
|
184
|
-
}
|
185
|
-
return ret;
|
186
|
-
}
|
187
|
-
|
188
|
-
#endif
|
data/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.6.0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tebako
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -65,11 +65,13 @@ files:
|
|
65
65
|
- lib/tebako.rb
|
66
66
|
- lib/tebako/cli.rb
|
67
67
|
- lib/tebako/cli_helpers.rb
|
68
|
+
- lib/tebako/cli_rubies.rb
|
68
69
|
- lib/tebako/error.rb
|
69
70
|
- lib/tebako/packager.rb
|
70
71
|
- lib/tebako/packager/pass1.rb
|
71
72
|
- lib/tebako/packager/pass2.rb
|
72
73
|
- lib/tebako/packager/patch_helpers.rb
|
74
|
+
- lib/tebako/packager/patch_libraries.rb
|
73
75
|
- lib/tebako/packager/patch_literals.rb
|
74
76
|
- lib/tebako/version.rb
|
75
77
|
- resources/tebako-fs.cpp.in
|