tebako 0.6.0 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CMakeLists.txt +3 -3
- data/README.adoc +13 -13
- data/include/tebako/tebako-main.h +2 -1
- data/lib/tebako/cli_rubies.rb +6 -6
- data/lib/tebako/packager/pass1.rb +2 -0
- data/lib/tebako/packager/pass2.rb +35 -44
- data/lib/tebako/packager/patch_buildsystem.rb +125 -0
- data/lib/tebako/packager/patch_helpers.rb +10 -0
- data/lib/tebako/packager/patch_libraries.rb +12 -0
- data/lib/tebako/packager/patch_literals.rb +49 -59
- data/lib/tebako/version.rb +1 -1
- data/src/tebako-main.cpp +8 -1
- data/tools/ci-scripts/patch-fbthrift.sh +3 -56
- data/tools/ci-scripts/patch-folly.sh +52 -10
- data/version.txt +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d208b7629dd786cecb0861c1958099047988c471122286028d7b1ca047df3c33
|
4
|
+
data.tar.gz: 7246a876406c06abd60d05808d5686844f8bd3fda1c4a69384b3d4aaaab513d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa0eef41e50f5aa1fc52010c221004d7e5b038ae0b98a293e3731ce4a742e7e4ea8dcc7c166bb937dd8d74ec78573a88d63ee46e2028d5c71e41c05e1aa5f350
|
7
|
+
data.tar.gz: 78a564e010d2892bf0243de1b2b90c86bbe2c727f75196629132ee867b8f7116bb874044ec705cd6fc154ed85059a450773a38975c5d1f5d4c90d494055fa26a
|
data/CMakeLists.txt
CHANGED
@@ -560,9 +560,9 @@ else (${SETUP_MODE})
|
|
560
560
|
COMMAND ${GNU_BASH} -c "rm -f ${DATA_SRC_DIR}/**/*.a"
|
561
561
|
COMMAND ${GNU_BASH} -c "rm -f ${DATA_SRC_DIR}/**/*.o"
|
562
562
|
COMMAND ${GNU_BASH} -c "chmod +x ${DEPS_BIN_DIR}/mkdwarfs${EXE_SUFFIX}"
|
563
|
-
# No progress below is
|
564
|
-
# and it creates
|
565
|
-
# It may be fixable bit is very difficult to reproduce in
|
563
|
+
# No progress below is critical since in reporting mode mkdwarfs tries to work directly with terminal
|
564
|
+
# and it creates issues for stderr redirects (&2 > 1) used by Ninja and our test srcipts
|
565
|
+
# It may be fixable bit is very difficult to reproduce in test environment
|
566
566
|
COMMAND ${DEPS_BIN_DIR}/mkdwarfs -o ${DATA_BIN_FILE} -i ${DATA_SRC_DIR} --no-progress
|
567
567
|
COMMAND ${CMAKE_COMMAND} -E touch ${DEPS_SRC_DIR}/tebako/tebako-fs.cpp
|
568
568
|
DEPENDS setup source_filesystem
|
data/README.adoc
CHANGED
@@ -48,7 +48,7 @@ The Tebako packager supports the following versions of Ruby for packaging:
|
|
48
48
|
* 2.7.8 (Linux, MacOS)
|
49
49
|
* 3.0.6 (Linux, MacOS)
|
50
50
|
* 3.1.4 (Linux, MacOS, Windows)
|
51
|
-
* 3.2.3 (Linux, MacOS)
|
51
|
+
* 3.2.3 (Linux, MacOS, Windows)
|
52
52
|
|
53
53
|
Support of specific version including minor release requires some effort, sometimes extensive
|
54
54
|
but our goal is to be able to package all maintained Ruby releases.
|
@@ -129,31 +129,31 @@ brew install gnu-sed bash pkg-config bison flex binutils libffi gdbm zlib ncurse
|
|
129
129
|
double-conversion boost jemalloc fmt glog libevent libsodium lz4 xz libyaml openssl@3
|
130
130
|
----
|
131
131
|
|
132
|
-
|
132
|
+
=== Windows (2019, 2022)
|
133
133
|
|
134
|
-
|
134
|
+
The simplest approach is to use Ruby development environment provided by RubyInstaller, for example Ruby+Devkit 3.1.4-1.
|
135
135
|
|
136
|
-
|
136
|
+
Once it is installed use the following commands:
|
137
137
|
|
138
138
|
[source,sh]
|
139
139
|
----
|
140
|
-
|
140
|
+
ridk enable ucrt64
|
141
|
+
pacman -S git tar bison flex toolchain make cmake
|
142
|
+
boost diffutils libevent double-conversion
|
143
|
+
fmt glog dlfcn gtest autotools ncurses libyaml
|
141
144
|
----
|
142
145
|
|
143
|
-
|
146
|
+
== Installation
|
144
147
|
|
145
|
-
|
146
|
-
|
148
|
+
=== General
|
149
|
+
|
150
|
+
Tebako is distributed as a Ruby gem
|
147
151
|
|
148
152
|
[source,sh]
|
149
153
|
----
|
150
|
-
|
151
|
-
pacman -S git tar bison flex toolchain make cmake
|
152
|
-
boost diffutils libevent double-conversion
|
153
|
-
fmt glog dlfcn gtest autotools ncurses libyaml
|
154
|
+
gem install tebako
|
154
155
|
----
|
155
156
|
|
156
|
-
|
157
157
|
=== Quick setup on Ubuntu 20.04 on Docker
|
158
158
|
|
159
159
|
Launch a container on the target platform:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
2
|
*
|
3
|
-
* Copyright (c) 2021, [Ribose Inc](https://www.ribose.com).
|
3
|
+
* Copyright (c) 2021-2024, [Ribose Inc](https://www.ribose.com).
|
4
4
|
* All rights reserved.
|
5
5
|
* This file is a part of tebako
|
6
6
|
*
|
@@ -32,6 +32,7 @@ extern "C" {
|
|
32
32
|
#endif
|
33
33
|
int tebako_main(int* argc, char*** argv);
|
34
34
|
const char* tebako_mount_point(void);
|
35
|
+
int tebako_is_running_miniruby(void);
|
35
36
|
#ifdef RB_W32
|
36
37
|
int tebako_file_load_ok(const char *path);
|
37
38
|
#endif
|
data/lib/tebako/cli_rubies.rb
CHANGED
@@ -57,12 +57,12 @@ module Tebako
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def version_check_msys(version)
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
60
|
+
if Gem::Version.new(version) < Gem::Version.new(DEFAULT_RUBY_VERSION) && RUBY_PLATFORM =~ /msys|mingw|cygwin/
|
61
|
+
raise Tebako::Error.new(
|
62
|
+
"Windows packaging works for Ruby #{DEFAULT_RUBY_VERSION} or above, version #{version} is not supported",
|
63
|
+
252
|
64
|
+
)
|
65
|
+
end
|
66
66
|
end
|
67
67
|
|
68
68
|
def extend_ruby_version
|
@@ -27,6 +27,7 @@
|
|
27
27
|
|
28
28
|
require_relative "patch_literals"
|
29
29
|
require_relative "patch_helpers"
|
30
|
+
require_relative "patch_buildsystem"
|
30
31
|
|
31
32
|
# Tebako - an executable packager
|
32
33
|
module Tebako
|
@@ -159,6 +160,7 @@ module Tebako
|
|
159
160
|
private
|
160
161
|
|
161
162
|
include Tebako::Packager::PatchLiterals
|
163
|
+
include Tebako::Packager::PatchBuildsystem
|
162
164
|
|
163
165
|
def get_gnumakefile_in_patch_p1(ruby_ver) # rubocop:disable Metrics/MethodLength
|
164
166
|
objext = PatchHelpers.ruby32?(ruby_ver) ? "$(OBJEXT)" : "@OBJEXT@"
|
@@ -28,6 +28,7 @@
|
|
28
28
|
require_relative "patch_literals"
|
29
29
|
require_relative "patch_libraries"
|
30
30
|
require_relative "patch_helpers"
|
31
|
+
require_relative "patch_buildsystem"
|
31
32
|
|
32
33
|
# Tebako - an executable packager
|
33
34
|
module Tebako
|
@@ -40,7 +41,7 @@ module Tebako
|
|
40
41
|
|
41
42
|
patch_map.store("thread_pthread.c", LINUX_MUSL_THREAD_PTHREAD_PATCH) if ostype =~ /linux-musl/
|
42
43
|
|
43
|
-
if ostype
|
44
|
+
if PatchHelpers.msys?(ostype)
|
44
45
|
patch_map.merge!(get_msys_patches(ruby_ver))
|
45
46
|
elsif PatchHelpers.ruby3x?(ruby_ver)
|
46
47
|
# [TODO] Do we really need it for platforms other then Windows ??
|
@@ -52,47 +53,51 @@ module Tebako
|
|
52
53
|
|
53
54
|
private
|
54
55
|
|
56
|
+
include Tebako::Packager::PatchBuildsystem
|
55
57
|
include Tebako::Packager::PatchLiterals
|
56
58
|
|
57
59
|
def get_dir_c_patch(ostype)
|
58
|
-
|
60
|
+
pattern = PatchHelpers.msys?(ostype) ? "/* define system APIs */" : "#ifdef HAVE_GETATTRLIST"
|
61
|
+
dir_c_patch = PatchHelpers.patch_c_file(pattern)
|
59
62
|
dir_c_patch.merge!(DIR_C_BASE_PATCH)
|
63
|
+
dir_c_patch
|
60
64
|
end
|
61
65
|
|
62
|
-
def get_dln_c_patch(ostype)
|
66
|
+
def get_dln_c_patch(ostype, ruby_ver)
|
63
67
|
# Not using substitutions of dlxxx functions on Windows
|
64
68
|
dln_c_patch = {
|
65
69
|
"static const char funcname_prefix[sizeof(FUNCNAME_PREFIX) - 1] = FUNCNAME_PREFIX;" =>
|
66
|
-
"#{ostype
|
70
|
+
"#{PatchHelpers.msys?(ostype) ? C_FILE_SUBST_LESS : C_FILE_SUBST}\n" \
|
67
71
|
"static const char funcname_prefix[sizeof(FUNCNAME_PREFIX) - 1] = FUNCNAME_PREFIX;\n"
|
68
72
|
}
|
69
|
-
|
73
|
+
|
74
|
+
if PatchHelpers.msys?(ostype)
|
75
|
+
patch = PatchHelpers.ruby32?(ruby_ver) ? DLN_C_MSYS_PATCH : DLN_C_MSYS_PATCH_PRE32
|
76
|
+
dln_c_patch.merge!(patch)
|
77
|
+
end
|
78
|
+
|
70
79
|
dln_c_patch
|
71
80
|
end
|
72
81
|
|
73
|
-
def
|
74
|
-
|
75
|
-
|
82
|
+
def get_io_c_msys_patch(ruby_ver)
|
83
|
+
io_c_msys_patch = PatchHelpers.ruby32?(ruby_ver) ? IO_C_MSYS_PATCH : IO_C_MSYS_PATCH_PRE_32
|
84
|
+
io_c_msys_patch.merge(IO_C_MSYS_BASE_PATCH)
|
85
|
+
end
|
86
|
+
|
87
|
+
def get_io_c_patch(ostype, ruby_ver)
|
88
|
+
io_c_patch = PatchHelpers.patch_c_file("/* define system APIs */")
|
89
|
+
io_c_patch.merge!(get_io_c_msys_patch(ruby_ver)) if PatchHelpers.msys?(ostype)
|
76
90
|
io_c_patch
|
77
91
|
end
|
78
92
|
|
79
|
-
def
|
80
|
-
# For pass 2 we 'kill ruby.exp' regeneration
|
81
|
-
objext = PatchHelpers.ruby32?(ruby_ver) ? "$(OBJEXT)" : "@OBJEXT@"
|
93
|
+
def get_msys_mkconfig_rb_patches(ruby_ver)
|
82
94
|
{
|
83
|
-
"
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
"
|
88
|
-
|
89
|
-
"RUBYDEF = $(DLL_BASE_NAME).def" => GNUMAKEFILE_IN_WINMAIN_SUBST,
|
90
|
-
|
91
|
-
"$(RUBY_EXP): $(LIBRUBY_A)" => "dummy.exp: $(LIBRUBY_A) # tebako patched",
|
92
|
-
|
93
|
-
"$(PROGRAM): $(RUBY_INSTALL_NAME).res.#{objext}" =>
|
94
|
-
"$(PROGRAM): $(RUBY_INSTALL_NAME).res.#{objext} $(LIBRUBY_A) # tebako patched\n" \
|
95
|
-
"$(LIBRUBY_A): $(LIBRUBY_A_OBJS) $(INITOBJS) # tebako patched\n"
|
95
|
+
" if fast[name]" => TOOLS_MKCONFIG_RB_SUBST,
|
96
|
+
"when /RUBYGEMS/; next" =>
|
97
|
+
"when /RUBYGEMS/; next\n\n" \
|
98
|
+
"# Start of tebako patch\n" \
|
99
|
+
"when /MAINLIBS/; val = #{PatchLibraries.msys_base_libs(ruby_ver)}\n" \
|
100
|
+
"# End of tebako patch"
|
96
101
|
}
|
97
102
|
end
|
98
103
|
|
@@ -106,13 +111,15 @@ module Tebako
|
|
106
111
|
end
|
107
112
|
|
108
113
|
def get_patch_map_base(ostype, deps_lib_dir, ruby_ver)
|
114
|
+
mcrb_subst = PatchHelpers.msys?(ostype) ? get_msys_mkconfig_rb_patches(ruby_ver) : TOOL_MKCONFIG_RB_PATCH
|
109
115
|
{
|
110
116
|
"template/Makefile.in" => template_makefile_in_patch(ostype, deps_lib_dir, ruby_ver),
|
111
|
-
"tool/mkconfig.rb" =>
|
117
|
+
"tool/mkconfig.rb" => mcrb_subst,
|
112
118
|
"gem_prelude.rb" => GEM_PRELUDE_RB_PATCH,
|
113
|
-
"dir.c" => get_dir_c_patch(ostype), "dln.c" => get_dln_c_patch(ostype),
|
114
|
-
"io.c" => get_io_c_patch(ostype),
|
115
|
-
"
|
119
|
+
"dir.c" => get_dir_c_patch(ostype), "dln.c" => get_dln_c_patch(ostype, ruby_ver),
|
120
|
+
"io.c" => get_io_c_patch(ostype, ruby_ver), "main.c" => MAIN_C_PATCH,
|
121
|
+
"file.c" => PatchHelpers.patch_c_file("/* define system APIs */"),
|
122
|
+
"util.c" => PatchHelpers.patch_c_file("#ifndef S_ISDIR")
|
116
123
|
}
|
117
124
|
end
|
118
125
|
|
@@ -126,25 +133,9 @@ module Tebako
|
|
126
133
|
}
|
127
134
|
end
|
128
135
|
|
129
|
-
def patch_c_file(pattern)
|
130
|
-
{
|
131
|
-
pattern => "#{C_FILE_SUBST}\n#{pattern}"
|
132
|
-
}
|
133
|
-
end
|
134
|
-
|
135
136
|
def template_makefile_in_patch(ostype, deps_lib_dir, ruby_ver)
|
136
137
|
template_makefile_in_patch_two(ostype, ruby_ver).merge(mlibs_subst(ostype, deps_lib_dir, ruby_ver))
|
137
138
|
end
|
138
|
-
|
139
|
-
def template_makefile_in_patch_two(ostype, ruby_ver)
|
140
|
-
if ostype =~ /msys/
|
141
|
-
{ TEMPLATE_MAKEFILE_IN_BASE_PATTERN => TEMPLATE_MAKEFILE_IN_BASE_PATCH_MSYS }
|
142
|
-
elsif PatchHelpers.ruby31?(ruby_ver)
|
143
|
-
{ TEMPLATE_MAKEFILE_IN_BASE_PATTERN => TEMPLATE_MAKEFILE_IN_BASE_PATCH }
|
144
|
-
else
|
145
|
-
{ TEMPLATE_MAKEFILE_IN_BASE_PATTERN_PRE_3_1 => TEMPLATE_MAKEFILE_IN_BASE_PATCH_PRE_3_1 }
|
146
|
-
end
|
147
|
-
end
|
148
139
|
end
|
149
140
|
end
|
150
141
|
end
|
@@ -0,0 +1,125 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2023-2024 [Ribose Inc](https://www.ribose.com).
|
4
|
+
# All rights reserved.
|
5
|
+
# This file is a part of tebako
|
6
|
+
#
|
7
|
+
# Redistribution and use in source and binary forms, with or without
|
8
|
+
# modification, are permitted provided that the following conditions
|
9
|
+
# are met:
|
10
|
+
# 1. Redistributions of source code must retain the above copyright
|
11
|
+
# notice, this list of conditions and the following disclaimer.
|
12
|
+
# 2. Redistributions in binary form must reproduce the above copyright
|
13
|
+
# notice, this list of conditions and the following disclaimer in the
|
14
|
+
# documentation and/or other materials provided with the distribution.
|
15
|
+
#
|
16
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
18
|
+
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
19
|
+
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
|
20
|
+
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
21
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
22
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
23
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
24
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
25
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
26
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
|
28
|
+
require_relative "patch_helpers"
|
29
|
+
|
30
|
+
# Tebako - an executable packager
|
31
|
+
module Tebako
|
32
|
+
module Packager
|
33
|
+
# Ruby buildsystem patches (pass2)
|
34
|
+
module PatchBuildsystem
|
35
|
+
# This patch forces rebuild of extinit.c when exts.mk changes
|
36
|
+
# exts.mk changes when we rebuild extensions to make them statically linked
|
37
|
+
# [TODO] it is possible that we can build extensions statically on pass1 and it will
|
38
|
+
# eliminate the need for this patch
|
39
|
+
COMMON_MK_PATCH = {
|
40
|
+
"ext/extinit.c: $(srcdir)/template/extinit.c.tmpl $(PREP)" =>
|
41
|
+
"ext/extinit.c: $(srcdir)/template/extinit.c.tmpl $(PREP) $(EXTS_MK)"
|
42
|
+
}.freeze
|
43
|
+
|
44
|
+
# This patch changes libraries that are used for Ruby linking
|
45
|
+
# MAINLIBS is patched elsewhere (not with literal but dynamically)
|
46
|
+
# to haold the list of sattic libraries and related options
|
47
|
+
# Also we have to put LIBRUBYARG_STATIC instead of LIBRUBYARG to link with static libruby,
|
48
|
+
# configure's --disable-shared option does not do it
|
49
|
+
# Several variants depending on os and version
|
50
|
+
TEMPLATE_MAKEFILE_IN_BASE_PATTERN_PRE_3_1 =
|
51
|
+
"\t\t$(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) " \
|
52
|
+
"$(EXTOBJS) $(LIBRUBYARG) $(MAINLIBS) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@"
|
53
|
+
|
54
|
+
TEMPLATE_MAKEFILE_IN_BASE_PATCH_PRE_3_1 =
|
55
|
+
"# -- Start of tebako patch --\n" \
|
56
|
+
"\t\t$(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) " \
|
57
|
+
"$(EXTOBJS) $(LIBRUBYARG_STATIC) $(OUTFLAG)$@\n" \
|
58
|
+
"# -- End of tebako patch --"
|
59
|
+
|
60
|
+
TEMPLATE_MAKEFILE_IN_BASE_PATTERN =
|
61
|
+
"\t\t$(Q) $(PURIFY) $(CC) $(EXE_LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(EXTOBJS) " \
|
62
|
+
"$(LIBRUBYARG) $(MAINLIBS) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@"
|
63
|
+
|
64
|
+
TEMPLATE_MAKEFILE_IN_BASE_PATCH =
|
65
|
+
"# -- Start of tebako patch --\n" \
|
66
|
+
"\t\t$(Q) $(PURIFY) $(CC) $(EXE_LDFLAGS) $(XLDFLAGS) $(MAINOBJ) " \
|
67
|
+
"$(EXTOBJS) $(LIBRUBYARG_STATIC) $(OUTFLAG)$@\n" \
|
68
|
+
"# -- End of tebako patch --"
|
69
|
+
|
70
|
+
TEMPLATE_MAKEFILE_IN_BASE_PATCH_MSYS =
|
71
|
+
"# -- Start of tebako patch --\n" \
|
72
|
+
"\t\t$(Q) $(PURIFY) $(CC) $(EXE_LDFLAGS) $(XLDFLAGS) $(RUBY_EXP) $(MAINOBJ) " \
|
73
|
+
"$(EXTOBJS) $(LIBRUBYARG_STATIC) $(OUTFLAG)$@\n" \
|
74
|
+
"# -- End of tebako patch --"
|
75
|
+
|
76
|
+
def template_makefile_in_patch_two(ostype, ruby_ver)
|
77
|
+
if PatchHelpers.msys?(ostype)
|
78
|
+
{ TEMPLATE_MAKEFILE_IN_BASE_PATTERN => TEMPLATE_MAKEFILE_IN_BASE_PATCH_MSYS }
|
79
|
+
elsif PatchHelpers.ruby31?(ruby_ver)
|
80
|
+
{ TEMPLATE_MAKEFILE_IN_BASE_PATTERN => TEMPLATE_MAKEFILE_IN_BASE_PATCH }
|
81
|
+
else
|
82
|
+
{ TEMPLATE_MAKEFILE_IN_BASE_PATTERN_PRE_3_1 => TEMPLATE_MAKEFILE_IN_BASE_PATCH_PRE_3_1 }
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
# This MSYS specific thing ensure compilation of winmain.c
|
87
|
+
# Did try to understand why it did not work out of the box
|
88
|
+
GNUMAKEFILE_IN_WINMAIN_SUBST = <<~SUBST
|
89
|
+
RUBYDEF = $(DLL_BASE_NAME).def
|
90
|
+
|
91
|
+
# Start of tebako patch
|
92
|
+
WINMAINOBJ = win32/winmain.$(OBJEXT)
|
93
|
+
$(WINMAINOBJ): win32/winmain.c
|
94
|
+
# End of tebako patch
|
95
|
+
SUBST
|
96
|
+
|
97
|
+
# Other MSYS (GNUMakefile) specific patches
|
98
|
+
# - The same issue with libraries as for Makefile above
|
99
|
+
# - 'Kill' ruby.exp regeneration on pass2
|
100
|
+
# since we want to use outpu from pass1 for implib generation
|
101
|
+
# [VERY UGLY HACK]
|
102
|
+
# - Introduce LIBRUBY dependency on static extensions
|
103
|
+
# This is an addition to COMMON_MK_PATCH specified above
|
104
|
+
def get_gnumakefile_in_patch_p2(ruby_ver) # rubocop:disable Metrics/MethodLength
|
105
|
+
objext = PatchHelpers.ruby32?(ruby_ver) ? "$(OBJEXT)" : "@OBJEXT@"
|
106
|
+
|
107
|
+
{
|
108
|
+
"$(WPROGRAM): $(RUBYW_INSTALL_NAME).res.#{objext}" =>
|
109
|
+
"$(WPROGRAM): $(RUBYW_INSTALL_NAME).res.#{objext} $(WINMAINOBJ) # tebako patched",
|
110
|
+
|
111
|
+
"RUBYDEF = $(DLL_BASE_NAME).def" => GNUMAKEFILE_IN_WINMAIN_SUBST,
|
112
|
+
|
113
|
+
"$(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@" =>
|
114
|
+
"$(WINMAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(MAINLIBS) -o $@ # tebako patched",
|
115
|
+
|
116
|
+
"$(RUBY_EXP): $(LIBRUBY_A)" => "dummy.exp: $(LIBRUBY_A) # tebako patched",
|
117
|
+
|
118
|
+
"$(PROGRAM): $(RUBY_INSTALL_NAME).res.#{objext}" =>
|
119
|
+
"$(PROGRAM): $(RUBY_INSTALL_NAME).res.#{objext} $(LIBRUBY_A) # tebako patched\n" \
|
120
|
+
"$(LIBRUBY_A): $(LIBRUBY_A_OBJS) $(INITOBJS) # tebako patched\n"
|
121
|
+
}
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
@@ -61,6 +61,16 @@ module Tebako
|
|
61
61
|
out
|
62
62
|
end
|
63
63
|
|
64
|
+
def msys?(ostype)
|
65
|
+
ostype =~ /msys|cygwin|mingw/
|
66
|
+
end
|
67
|
+
|
68
|
+
def patch_c_file(pattern)
|
69
|
+
{
|
70
|
+
pattern => "#{PatchLiterals::C_FILE_SUBST}\n#{pattern}"
|
71
|
+
}
|
72
|
+
end
|
73
|
+
|
64
74
|
def recreate(dirname)
|
65
75
|
FileUtils.rm_rf(dirname, noop: nil, verbose: nil, secure: true)
|
66
76
|
FileUtils.mkdir(dirname)
|
@@ -109,6 +109,18 @@ module Tebako
|
|
109
109
|
SUBST
|
110
110
|
end
|
111
111
|
|
112
|
+
# Used for mkconfig.rb
|
113
|
+
def msys_base_libs(ruby_ver)
|
114
|
+
<<~SUBST
|
115
|
+
"-l:libtebako-fs.a -l:libdwarfs-wr.a -l:libdwarfs.a -l:libdwarfs_compression.a -l:libfolly.a -l:libfsst.a " \\
|
116
|
+
"-l:libmetadata_thrift.a -l:libthrift_light.a -l:libxxhash.a -l:libfmt.a -l:libdouble-conversion.a -l:libglog.a -l:libgflags.a -l:libevent.a " \\
|
117
|
+
"-l:liblz4.a -l:libz.a -l:libzstd.a -l:liblzma.a -l:libncurses.a -l:libunwind.a -l:liblzma.a -l:libiberty.a #{PatchHelpers.yaml_reference(ruby_ver)} " \\
|
118
|
+
"-l:libffi.a -l:libboost_system-mt.a -l:libboost_chrono-mt.a -l:libstdc++.a -l:libdl.a -static-libgcc -static-libstdc++ -l:libssl.a -l:libcrypto.a " \\
|
119
|
+
"-l:libz.a -l:libwinpthread.a -lcrypt32 -lshlwapi -lwsock32 -liphlpapi -limagehlp -lbcrypt -lole32 -loleaut32 -luuid"
|
120
|
+
SUBST
|
121
|
+
end
|
122
|
+
|
123
|
+
# Used in Makefile
|
112
124
|
def msys_libs(ruby_ver)
|
113
125
|
<<~SUBST
|
114
126
|
-Wl,-Bstatic #{linux_common_libs} \
|
@@ -29,7 +29,7 @@
|
|
29
29
|
module Tebako
|
30
30
|
module Packager
|
31
31
|
# Ruby patching literals (pass2)
|
32
|
-
module PatchLiterals
|
32
|
+
module PatchLiterals
|
33
33
|
TOOL_MKCONFIG_RB_PATCH = {
|
34
34
|
" if fast[name]" => <<~SUBST
|
35
35
|
# -- Start of tebako patch --
|
@@ -48,23 +48,21 @@ module Tebako
|
|
48
48
|
SUBST
|
49
49
|
}.freeze
|
50
50
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
SUBST
|
67
|
-
}.freeze
|
51
|
+
TOOLS_MKCONFIG_RB_SUBST = <<~SUBST
|
52
|
+
# -- Start of tebako patch --
|
53
|
+
v_head_comp = " CONFIG[\\"prefix\\"] \#{eq} "
|
54
|
+
if v_head_comp == v[0...(v_head_comp.length)]
|
55
|
+
v = "\#{v[0...(v_head_comp.length)]}CONFIG[\\"RUBY_EXEC_PREFIX\\"] = 'A:/__tebako_memfs__'
|
56
|
+
"
|
57
|
+
end
|
58
|
+
v_head_comp = " CONFIG[\\"RUBY_EXEC_PREFIX\\"] \#{eq} "
|
59
|
+
if v_head_comp == v[0...(v_head_comp.length)]
|
60
|
+
v = "\#{v[0...(v_head_comp.length)]}'A:/__tebako_memfs__'
|
61
|
+
"
|
62
|
+
end
|
63
|
+
# -- End of tebako patch --
|
64
|
+
if fast[name]
|
65
|
+
SUBST
|
68
66
|
|
69
67
|
# Alpine-specific patches https://github.com/docker-library/ruby/blob/master/3.1/alpine3.15/Dockerfile
|
70
68
|
# -- Patch no. 1 --
|
@@ -169,7 +167,7 @@ module Tebako
|
|
169
167
|
"else if (e == EIO /* tebako patch */ && !within_tebako_memfs(path)) {"
|
170
168
|
}.freeze
|
171
169
|
|
172
|
-
|
170
|
+
DLN_C_MSYS_PATCH_PRE32 = {
|
173
171
|
" winfile = rb_w32_mbstr_to_wstr(CP_UTF8, file, -1, NULL);" => <<~SUBST
|
174
172
|
/* -- Start of tebako patch -- */
|
175
173
|
char *f = NULL;
|
@@ -191,37 +189,28 @@ module Tebako
|
|
191
189
|
SUBST
|
192
190
|
}.freeze
|
193
191
|
|
194
|
-
|
195
|
-
"
|
196
|
-
|
192
|
+
DLN_C_MSYS_PATCH = {
|
193
|
+
" WCHAR *winfile = rb_w32_mbstr_to_wstr(CP_UTF8, file, -1, NULL);" => <<~SUBST
|
194
|
+
/* -- Start of tebako patch -- */
|
195
|
+
char *f = NULL;
|
196
|
+
WCHAR *winfile = NULL;
|
197
|
+
if (file && within_tebako_memfs(file)) {
|
198
|
+
f = tebako_dlmap2file(file);
|
199
|
+
if (f) {
|
200
|
+
winfile = rb_w32_mbstr_to_wstr(CP_UTF8, f, -1, NULL);
|
201
|
+
free(f);
|
202
|
+
}
|
203
|
+
else {
|
204
|
+
goto failed;
|
205
|
+
}
|
206
|
+
}
|
207
|
+
else {
|
208
|
+
winfile = rb_w32_mbstr_to_wstr(CP_UTF8, file, -1, NULL);
|
209
|
+
}
|
210
|
+
/* -- End of tebako patch -- */
|
211
|
+
SUBST
|
197
212
|
}.freeze
|
198
213
|
|
199
|
-
TEMPLATE_MAKEFILE_IN_BASE_PATTERN_PRE_3_1 =
|
200
|
-
"\t\t$(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) " \
|
201
|
-
"$(EXTOBJS) $(LIBRUBYARG) $(MAINLIBS) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@"
|
202
|
-
|
203
|
-
TEMPLATE_MAKEFILE_IN_BASE_PATCH_PRE_3_1 =
|
204
|
-
"# -- Start of tebako patch --\n" \
|
205
|
-
"\t\t$(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) " \
|
206
|
-
"$(EXTOBJS) $(LIBRUBYARG_STATIC) $(OUTFLAG)$@\n" \
|
207
|
-
"# -- End of tebako patch --"
|
208
|
-
|
209
|
-
TEMPLATE_MAKEFILE_IN_BASE_PATTERN =
|
210
|
-
"\t\t$(Q) $(PURIFY) $(CC) $(EXE_LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(EXTOBJS) " \
|
211
|
-
"$(LIBRUBYARG) $(MAINLIBS) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@"
|
212
|
-
|
213
|
-
TEMPLATE_MAKEFILE_IN_BASE_PATCH =
|
214
|
-
"# -- Start of tebako patch --\n" \
|
215
|
-
"\t\t$(Q) $(PURIFY) $(CC) $(EXE_LDFLAGS) $(XLDFLAGS) $(MAINOBJ) " \
|
216
|
-
"$(EXTOBJS) $(LIBRUBYARG_STATIC) $(OUTFLAG)$@\n" \
|
217
|
-
"# -- End of tebako patch --"
|
218
|
-
|
219
|
-
TEMPLATE_MAKEFILE_IN_BASE_PATCH_MSYS =
|
220
|
-
"# -- Start of tebako patch --\n" \
|
221
|
-
"\t\t$(Q) $(PURIFY) $(CC) $(EXE_LDFLAGS) $(XLDFLAGS) $(RUBY_EXP) $(MAINOBJ) " \
|
222
|
-
"$(EXTOBJS) $(LIBRUBYARG_STATIC) $(OUTFLAG)$@\n" \
|
223
|
-
"# -- End of tebako patch --"
|
224
|
-
|
225
214
|
C_FILE_SUBST = <<~SUBST
|
226
215
|
/* -- Start of tebako patch -- */
|
227
216
|
#include <tebako/tebako-config.h>
|
@@ -251,15 +240,6 @@ module Tebako
|
|
251
240
|
SUBST
|
252
241
|
}.freeze
|
253
242
|
|
254
|
-
GNUMAKEFILE_IN_WINMAIN_SUBST = <<~SUBST
|
255
|
-
RUBYDEF = $(DLL_BASE_NAME).def
|
256
|
-
|
257
|
-
# Start of tebako patch
|
258
|
-
WINMAINOBJ = win32/winmain.$(OBJEXT)
|
259
|
-
$(WINMAINOBJ): win32/winmain.c
|
260
|
-
# End of tebako patch
|
261
|
-
SUBST
|
262
|
-
|
263
243
|
IO_C_SUBST = <<~SUBST
|
264
244
|
/* -- Start of tebako patch -- */
|
265
245
|
if (is_tebako_file_descriptor(fd)) return;
|
@@ -267,13 +247,23 @@ module Tebako
|
|
267
247
|
flags = fcntl(fd, F_GETFD); /* should not fail except EBADF. */
|
268
248
|
SUBST
|
269
249
|
|
270
|
-
|
271
|
-
"#define open rb_w32_uopen" => "#define open(p, f, m) tebako_open(3, (p), (f), (m))"
|
250
|
+
IO_C_MSYS_BASE_PATCH = {
|
251
|
+
"#define open rb_w32_uopen" => "#define open(p, f, m) tebako_open(3, (p), (f), (m))"
|
252
|
+
}.freeze
|
253
|
+
|
254
|
+
IO_C_MSYS_PATCH_PRE_32 = {
|
272
255
|
"(rb_w32_io_cancelable_p((fptr)->fd) ? Qnil : rb_io_wait(fptr->self, RB_INT2NUM(RUBY_IO_READABLE), Qnil))" =>
|
273
256
|
"((is_tebako_file_descriptor((fptr)->fd) || rb_w32_io_cancelable_p((fptr)->fd)) ? \\\n" \
|
274
257
|
"Qnil : rb_io_wait(fptr->self, RB_INT2NUM(RUBY_IO_READABLE), Qnil))"
|
275
258
|
}.freeze
|
276
259
|
|
260
|
+
IO_C_MSYS_PATCH = {
|
261
|
+
"(rb_w32_io_cancelable_p((fptr)->fd) ? Qnil : rb_io_wait(fptr->self, " \
|
262
|
+
"RB_INT2NUM(RUBY_IO_READABLE), RUBY_IO_TIMEOUT_DEFAULT))" =>
|
263
|
+
"((is_tebako_file_descriptor((fptr)->fd) || rb_w32_io_cancelable_p((fptr)->fd)) ? \\\n" \
|
264
|
+
"Qnil : rb_io_wait(fptr->self, RB_INT2NUM(RUBY_IO_READABLE), RUBY_IO_TIMEOUT_DEFAULT))"
|
265
|
+
}.freeze
|
266
|
+
|
277
267
|
FILE_C_MSYS_SUBST = <<~SUBST
|
278
268
|
/* -- Start of tebako patch -- */
|
279
269
|
if (is_tebako_file_descriptor((fptr)->fd)) return ENOTSUP;
|
data/lib/tebako/version.rb
CHANGED
data/src/tebako-main.cpp
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
2
|
*
|
3
|
-
* Copyright (c) 2021-
|
3
|
+
* Copyright (c) 2021-2024 [Ribose Inc](https://www.ribose.com).
|
4
4
|
* All rights reserved.
|
5
5
|
* This file is a part of tebako
|
6
6
|
*
|
@@ -50,6 +50,8 @@
|
|
50
50
|
#include <tebako/tebako-main.h>
|
51
51
|
#include <tebako/tebako-fs.h>
|
52
52
|
|
53
|
+
static int running_miniruby = 0;
|
54
|
+
|
53
55
|
extern "C" int tebako_main(int* argc, char*** argv) {
|
54
56
|
int ret = -1, fsret = -1;
|
55
57
|
char** new_argv = NULL;
|
@@ -59,6 +61,7 @@ extern "C" int tebako_main(int* argc, char*** argv) {
|
|
59
61
|
// Ruby build script is designed in such a way that this patch is also applied towards miniruby
|
60
62
|
// Just pass through in such case
|
61
63
|
ret = 0;
|
64
|
+
running_miniruby = -1;
|
62
65
|
}
|
63
66
|
else {
|
64
67
|
try {
|
@@ -149,3 +152,7 @@ extern "C" int tebako_main(int* argc, char*** argv) {
|
|
149
152
|
extern "C" const char* tebako_mount_point(void) {
|
150
153
|
return tebako::fs_mount_point;
|
151
154
|
}
|
155
|
+
|
156
|
+
extern "C" int tebako_is_running_miniruby(void) {
|
157
|
+
return running_miniruby;
|
158
|
+
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#! /bin/bash
|
2
|
-
# Copyright (c) 2022, [Ribose Inc](https://www.ribose.com).
|
2
|
+
# Copyright (c) 2022,2024 [Ribose Inc](https://www.ribose.com).
|
3
3
|
# All rights reserved.
|
4
4
|
# This file is a part of tebako
|
5
5
|
#
|
@@ -43,70 +43,17 @@ do_patch_multiline() {
|
|
43
43
|
"$gSed" -i "s/$re/${sbst//$'\n'/"\\n"}/g" "$1"
|
44
44
|
}
|
45
45
|
|
46
|
-
# ....................................................
|
47
|
-
# Surprise, surprise ... Upstream project shall found boost libraries for fbthrift
|
48
|
-
# https://github.com/facebook/fbthrift/commit/c23af9dee42374d43d2f10e0e07edf1c1c97c328
|
49
|
-
|
50
|
-
|
51
46
|
if [[ "$OSTYPE" == "linux-gnu"* || "$OSTYPE" == "linux-musl"* || "$OSTYPE" == "msys" ]]; then
|
52
47
|
gSed="sed"
|
53
|
-
# shellcheck disable=SC2251
|
54
|
-
! IFS= read -r -d '' sbst << EOM
|
55
|
-
find_package(OpenSSL REQUIRED)
|
56
|
-
# -- Start of tebako patch --
|
57
|
-
find_package(Boost 1.65 REQUIRED COMPONENTS filesystem)
|
58
|
-
include_directories(\${Boost_INCLUDE_DIRS})
|
59
|
-
# -- End of tebako patch --
|
60
|
-
EOM
|
61
|
-
|
62
48
|
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
63
49
|
gSed="gsed"
|
64
|
-
|
65
|
-
# shellcheck disable=SC2251
|
66
|
-
! IFS= read -r -d '' sbst << EOM
|
67
|
-
find_package(OpenSSL REQUIRED)
|
68
|
-
# -- Start of tebako patch --
|
69
|
-
find_package(Boost 1.65 REQUIRED COMPONENTS filesystem)
|
70
|
-
include_directories(\${Boost_INCLUDE_DIRS})
|
71
|
-
# Suppress superfluous randlib warnings about \"*.a\" having no symbols on MacOSX.
|
72
|
-
set(CMAKE_C_ARCHIVE_CREATE \"<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>\")
|
73
|
-
set(CMAKE_CXX_ARCHIVE_CREATE \"<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>\")
|
74
|
-
set(CMAKE_C_ARCHIVE_FINISH \"<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>\")
|
75
|
-
set(CMAKE_CXX_ARCHIVE_FINISH \"<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>\")
|
76
|
-
# -- End of tebako patch --
|
77
|
-
EOM
|
78
|
-
|
79
50
|
else
|
80
51
|
echo "Unknown OSTYPE=$OSTYPE"
|
81
52
|
exit 1
|
82
53
|
fi
|
83
54
|
|
84
|
-
restore_and_save "$1/CMakeLists.txt"
|
85
|
-
re="find_package(OpenSSL REQUIRED)"
|
86
|
-
"$gSed" -i "s/$re/${sbst//$'\n'/"\\n"}/g" "$1/CMakeLists.txt"
|
87
|
-
|
88
|
-
# GCC 13 compatibility
|
89
|
-
# --- thrift/compiler/lib/cpp2/util.cc ---
|
90
|
-
re="#include <stdexcept>"
|
91
|
-
# shellcheck disable=SC2251
|
92
|
-
! IFS= read -r -d '' sbst << EOM
|
93
|
-
#include <stdexcept>
|
94
|
-
|
95
|
-
\/* -- Start of tebako patch -- *\/
|
96
|
-
#include <cstdint>
|
97
|
-
\/* -- End of tebako patch -- *\/
|
98
|
-
EOM
|
99
|
-
|
100
|
-
do_patch_multiline "$1/thrift/compiler/lib/cpp2/util.cc"
|
101
|
-
|
102
|
-
|
103
55
|
if [[ "$OSTYPE" == "msys" ]]; then
|
104
|
-
re="
|
105
|
-
sbst="
|
106
|
-
do_patch "$1/thrift/compiler/CMakeLists.txt" "$re" "$sbst"
|
107
|
-
|
108
|
-
re="ftruncate(file\.fd(), finalBufferSize);"
|
109
|
-
sbst="folly::portability::unistd::ftruncate(file.fd(), finalBufferSize); \/* tebako patched *\/"
|
56
|
+
re="ftruncate(file\.fd(), finalBufferSize),"
|
57
|
+
sbst="folly::portability::unistd::ftruncate(file.fd(), finalBufferSize), \/* tebako patched *\/"
|
110
58
|
do_patch "$1/thrift/lib/cpp2/frozen/FrozenUtil.h" "$re" "$sbst"
|
111
|
-
|
112
59
|
fi
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#! /bin/bash
|
2
|
-
# Copyright (c) 2022-
|
2
|
+
# Copyright (c) 2022-2024, [Ribose Inc](https://www.ribose.com).
|
3
3
|
# All rights reserved.
|
4
4
|
# This file is a part of tebako
|
5
5
|
#
|
@@ -41,6 +41,7 @@ restore_and_save() {
|
|
41
41
|
|
42
42
|
do_patch() {
|
43
43
|
restore_and_save "$1"
|
44
|
+
# echo "$GNU_SED" -i "s/$2/$3/g" "$1"
|
44
45
|
"$GNU_SED" -i "s/$2/$3/g" "$1"
|
45
46
|
}
|
46
47
|
|
@@ -316,15 +317,6 @@ EOM
|
|
316
317
|
sbst=" \/* tebako patched *\/ folly::portability::unistd::lseek(fd,"
|
317
318
|
do_patch "$1/folly/portability/SysUio.cpp" "$re" "$sbst"
|
318
319
|
|
319
|
-
# --- folly/portability/Unistd.cpp ---
|
320
|
-
re="(lseek(fd,"
|
321
|
-
sbst="( \/* tebako patched *\/ folly::portability::unistd::lseek(fd,"
|
322
|
-
do_patch "$1/folly/portability/Unistd.cpp" "$re" "$sbst"
|
323
|
-
|
324
|
-
re="lseek(fd, 0,"
|
325
|
-
sbst=" \/* tebako patched *\/ folly::portability::unistd::lseek(fd, 0,"
|
326
|
-
"$GNU_SED" -i "s/$re/$sbst/g" "$1/folly/portability/Unistd.cpp"
|
327
|
-
|
328
320
|
# --- folly/logging/ImmediateFileWriter.h ---
|
329
321
|
re="isatty(file"
|
330
322
|
sbst=" \/* tebako patched *\/ folly::portability::unistd::isatty(file"
|
@@ -402,6 +394,7 @@ EOM
|
|
402
394
|
#ifdef __MINGW32__
|
403
395
|
#include <mswsock.h>
|
404
396
|
using cmsghdr = WSACMSGHDR;
|
397
|
+
#define CMSG_SPACE WSA_CMSG_SPACE
|
405
398
|
#endif
|
406
399
|
\/* -- End of tebako patch -- *\/
|
407
400
|
|
@@ -448,7 +441,55 @@ EOM
|
|
448
441
|
sbst="#if defined(__XROS__) || defined(__MINGW32__) \/* tebako patched *\/"
|
449
442
|
"$GNU_SED" -i "s/$re/$sbst/g" "$1/folly/system/ThreadName.cpp"
|
450
443
|
|
444
|
+
# --- folly/net/NetOps.h ---
|
445
|
+
|
446
|
+
re="#include <WS2tcpip\.h> \/\/ @manual"
|
447
|
+
# shellcheck disable=SC2251
|
448
|
+
! IFS= read -r -d '' sbst << EOM
|
449
|
+
#include <WS2tcpip.h> \/\/ @manual
|
450
|
+
|
451
|
+
\/* -- Start of tebako patch -- *\/
|
452
|
+
#ifdef __MINGW32__
|
453
|
+
#include <memory>
|
454
|
+
#include <mswsock.h>
|
455
|
+
#endif
|
456
|
+
\/* -- End of tebako patch -- *\/
|
457
|
+
EOM
|
458
|
+
do_patch_multiline "$1/folly/net/NetOps.h" "$re" "$sbst"
|
459
|
+
|
460
|
+
# --- folly/Random.cpp ---
|
461
|
+
|
462
|
+
re="#include <folly\/synchronization\/RelaxedAtomic\.h>"
|
463
|
+
# shellcheck disable=SC2251
|
464
|
+
! IFS= read -r -d '' sbst << EOM
|
465
|
+
#include <folly\/synchronization\/RelaxedAtomic.h>
|
466
|
+
|
467
|
+
\/* -- Start of tebako patch -- *\/
|
468
|
+
#include <folly\/portability\/Fcntl.h>
|
469
|
+
\/* -- End of tebako patch -- *\/
|
470
|
+
EOM
|
471
|
+
do_patch_multiline "$1/folly/Random.cpp" "$re" "$sbst"
|
472
|
+
|
473
|
+
# --- folly/Utility.h ---
|
474
|
+
re="T uninit;"
|
475
|
+
sbst="T uninit = 0; \/* tebako patched *\/"
|
476
|
+
do_patch "$1/folly/Utility.h" "$re" "$sbst"
|
477
|
+
|
478
|
+
# --- folly/experimental/io/AsyncBase.cpp ---
|
479
|
+
re="CHECK_ERR(close(pollFd_));"
|
480
|
+
sbst="CHECK_ERR(folly::portability::unistd::close(pollFd_)); \/* tebako patched *\/"
|
481
|
+
do_patch "$1/folly/experimental/io/AsyncBase.cpp" "$re" "$sbst"
|
482
|
+
|
483
|
+
# --- folly/portability/Unistd.cpp ---
|
484
|
+
re="res = lseek64(fd, offset, whence);"
|
485
|
+
sbst="res = folly::portability::unistd::lseek64(fd, offset, whence); \/* tebako patched *\/ "
|
486
|
+
do_patch "$1/folly/portability/Unistd.cpp" "$re" "$sbst"
|
487
|
+
|
488
|
+
re="res = lseek(fd, offset, whence);"
|
489
|
+
sbst="res = folly::portability::unistd::lseek(fd, offset, whence); \/* tebako patched *\/ "
|
490
|
+
"$GNU_SED" -i "s/$re/$sbst/g" "$1/folly/portability/Unistd.cpp"
|
451
491
|
# ---
|
492
|
+
|
452
493
|
defined_msc_ver_to_win32 "$1/folly/external/farmhash/farmhash.cpp"
|
453
494
|
defined_msc_ver_to_win32 "$1/folly/detail/IPAddressSource.h"
|
454
495
|
defined_msc_ver_to_win32 "$1/folly/portability/Sockets.cpp"
|
@@ -471,5 +512,6 @@ EOM
|
|
471
512
|
# while gettimeofday is provided by MSys, the other two functions are lost
|
472
513
|
defined_n_win32_to_msc_ver "$1/folly/portability/SysTime.h"
|
473
514
|
defined_win32_to_msc_ver "$1/folly/portability/SysTime.cpp"
|
515
|
+
defined_win32_to_msc_ver "$1/folly/lang/Exception.cpp"
|
474
516
|
|
475
517
|
fi
|
data/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.2
|
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.6.
|
4
|
+
version: 0.6.2
|
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-04-
|
11
|
+
date: 2024-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -70,6 +70,7 @@ files:
|
|
70
70
|
- lib/tebako/packager.rb
|
71
71
|
- lib/tebako/packager/pass1.rb
|
72
72
|
- lib/tebako/packager/pass2.rb
|
73
|
+
- lib/tebako/packager/patch_buildsystem.rb
|
73
74
|
- lib/tebako/packager/patch_helpers.rb
|
74
75
|
- lib/tebako/packager/patch_libraries.rb
|
75
76
|
- lib/tebako/packager/patch_literals.rb
|