tebako 0.7.4 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
data/common.env CHANGED
@@ -1,5 +1,5 @@
1
1
  BUILD_TYPE=Release
2
2
  DEPS=deps
3
3
  INCBIN_TAG=348e36b
4
- DWARFS_WR_TAG=v0.5.4
4
+ DWARFS_WR_TAG=v0.5.5
5
5
  RUBY_VER=3.1.6
@@ -40,12 +40,10 @@ module Tebako
40
40
  RUBY_VERSIONS = {
41
41
  "2.7.8" => "c2dab63cbc8f2a05526108ad419efa63a67ed4074dbbcf9fc2b1ca664cb45ba0",
42
42
  "3.0.7" => "2a3411977f2850431136b0fab8ad53af09fb74df2ee2f4fb7f11b378fe034388",
43
- "3.1.4" => "a3d55879a0dfab1d7141fdf10d22a07dbf8e5cdc4415da1bde06127d5cc3c7b6",
44
- "3.1.5" => "3685c51eeee1352c31ea039706d71976f53d00ab6d77312de6aa1abaf5cda2c5",
45
43
  "3.1.6" => "0d0dafb859e76763432571a3109d1537d976266be3083445651dc68deed25c22",
46
- "3.2.3" => "af7f1757d9ddb630345988139211f1fd570ff5ba830def1cc7c468ae9b65c9ba",
47
- "3.2.4" => "c72b3c5c30482dca18b0f868c9075f3f47d8168eaf626d4e682ce5b59c858692"
48
- # "3.3.3" => "83c05b2177ee9c335b631b29b8c077b4770166d02fa527f3a9f6a40d13f3cce2"
44
+ "3.2.4" => "c72b3c5c30482dca18b0f868c9075f3f47d8168eaf626d4e682ce5b59c858692",
45
+ "3.3.3" => "83c05b2177ee9c335b631b29b8c077b4770166d02fa527f3a9f6a40d13f3cce2",
46
+ "3.3.4" => "fe6a30f97d54e029768f2ddf4923699c416cdbc3a6e96db3e2d5716c7db96a34"
49
47
  }.freeze
50
48
 
51
49
  DEFAULT_RUBY_VERSION = "3.1.6"
@@ -178,13 +178,16 @@ module Tebako
178
178
  "$(WINMAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@ # tebako patched",
179
179
 
180
180
  "--output-exp=$(RUBY_EXP) \\" =>
181
- "--output-exp=$(RUBY_EXP) --output-lib=$(LIBRUBY) --output-def=tebako.def \\",
181
+ "--output-exp=$(RUBY_EXP) --output-lib=$(LIBRUBY) --output-def=tebako.def \\",
182
182
 
183
- " @rm -f $(PROGRAM)" =>
184
- "# tebako patched @rm -f $(PROGRAM)",
183
+ "--export-all $(LIBRUBY_A) $(LIBS) -o $(PROGRAM)" =>
184
+ "--export-all $(LIBRUBY_A) $(LIBS) -o program-stub.exe # tebako patched",
185
+
186
+ "@rm -f $(PROGRAM)" =>
187
+ "@rm -f program-stub.exe # tebako patched",
185
188
 
186
189
  " $(Q) $(LDSHARED) $(DLDFLAGS) $(OBJS) dmyext.o $(SOLIBS) -o $(PROGRAM)" =>
187
- "# tebako patched $(Q) $(LDSHARED) $(DLDFLAGS) $(OBJS) dmyext.o $(SOLIBS) -o $(PROGRAM)",
190
+ "# tebako patched $(Q) $(LDSHARED) $(DLDFLAGS) $(OBJS) dmyext.o $(SOLIBS) -o $(PROGRAM)",
188
191
 
189
192
  "RUBYDEF = $(DLL_BASE_NAME).def" => GNUMAKEFILE_IN_WINMAIN_SUBST
190
193
  }
@@ -38,23 +38,26 @@ module Tebako
38
38
  class << self
39
39
  def get_patch_map(ostype, deps_lib_dir, ruby_ver)
40
40
  patch_map = get_patch_map_base(ostype, deps_lib_dir, ruby_ver)
41
-
42
41
  patch_map.store("thread_pthread.c", LINUX_MUSL_THREAD_PTHREAD_PATCH) if ostype =~ /linux-musl/
43
-
44
42
  if PatchHelpers.msys?(ostype)
45
43
  patch_map.merge!(get_msys_patches(ruby_ver))
46
44
  elsif PatchHelpers.ruby3x?(ruby_ver)
47
- # [TODO] Do we really need it for platforms other then Windows ??
48
45
  patch_map.store("common.mk", COMMON_MK_PATCH)
49
46
  end
50
-
51
- patch_map
47
+ extend_patch_map_r33(patch_map, ostype, deps_lib_dir, ruby_ver)
52
48
  end
53
49
 
54
50
  private
55
51
 
56
52
  include Tebako::Packager::PatchBuildsystem
57
53
  include Tebako::Packager::PatchLiterals
54
+ def extend_patch_map_r33(patch_map, ostype, deps_lib_dir, ruby_ver)
55
+ if PatchHelpers.ruby33?(ruby_ver) || PatchHelpers.msys?(ostype)
56
+ patch_map.store("config.status",
57
+ get_config_status_patch(ostype, deps_lib_dir, ruby_ver))
58
+ end
59
+ patch_map
60
+ end
58
61
 
59
62
  def get_dir_c_patch(ostype)
60
63
  pattern = PatchHelpers.msys?(ostype) ? "/* define system APIs */" : "#ifdef HAVE_GETATTRLIST"
@@ -91,21 +94,17 @@ module Tebako
91
94
  end
92
95
 
93
96
  def get_util_c_patch(ruby_ver)
94
- if PatchHelpers.ruby316?(ruby_ver)
97
+ if PatchHelpers.ruby31?(ruby_ver)
95
98
  PatchHelpers.patch_c_file_post("#endif /* !HAVE_GNU_QSORT_R */")
96
99
  else
97
100
  PatchHelpers.patch_c_file_pre("#ifndef S_ISDIR")
98
101
  end
99
102
  end
100
103
 
101
- def get_msys_mkconfig_rb_patches(ruby_ver)
104
+ def get_tool_mkconfig_rb_patch(ostype)
105
+ subst = PatchHelpers.msys?(ostype) ? TOOL_MKCONFIG_RB_SUBST_MSYS : TOOL_MKCONFIG_RB_SUBST
102
106
  {
103
- " if fast[name]" => TOOLS_MKCONFIG_RB_SUBST,
104
- "when /RUBYGEMS/; next" =>
105
- "when /RUBYGEMS/; next\n\n" \
106
- "# Start of tebako patch\n" \
107
- "when /MAINLIBS/; val = #{PatchLibraries.msys_base_libs(ruby_ver)}\n" \
108
- "# End of tebako patch"
107
+ " if fast[name]" => subst
109
108
  }
110
109
  end
111
110
 
@@ -119,10 +118,9 @@ module Tebako
119
118
  end
120
119
 
121
120
  def get_patch_map_base(ostype, deps_lib_dir, ruby_ver)
122
- mcrb_subst = PatchHelpers.msys?(ostype) ? get_msys_mkconfig_rb_patches(ruby_ver) : TOOL_MKCONFIG_RB_PATCH
123
121
  {
124
122
  "template/Makefile.in" => template_makefile_in_patch(ostype, deps_lib_dir, ruby_ver),
125
- "tool/mkconfig.rb" => mcrb_subst,
123
+ "tool/mkconfig.rb" => get_tool_mkconfig_rb_patch(ostype),
126
124
  "dir.c" => get_dir_c_patch(ostype), "dln.c" => get_dln_c_patch(ostype, ruby_ver),
127
125
  "io.c" => get_io_c_patch(ostype, ruby_ver), "main.c" => MAIN_C_PATCH,
128
126
  "file.c" => PatchHelpers.patch_c_file_pre("/* define system APIs */"),
@@ -135,7 +133,7 @@ module Tebako
135
133
  {
136
134
  "MAINLIBS = #{yjit_libs}@MAINLIBS@" =>
137
135
  "# -- Start of tebako patch -- \n" \
138
- "MAINLIBS = #{yjit_libs}#{PatchLibraries.mlibs(ostype, deps_lib_dir, ruby_ver)}" \
136
+ "MAINLIBS = #{yjit_libs}#{PatchLibraries.mlibs(ostype, deps_lib_dir, ruby_ver, true)}\n" \
139
137
  "# -- End of tebako patch -- \n"
140
138
  }
141
139
  end
@@ -57,10 +57,14 @@ module Tebako
57
57
  "$(EXTOBJS) $(LIBRUBYARG_STATIC) $(OUTFLAG)$@\n" \
58
58
  "# -- End of tebako patch --"
59
59
 
60
- TEMPLATE_MAKEFILE_IN_BASE_PATTERN =
60
+ TEMPLATE_MAKEFILE_IN_BASE_PATTERN_PRE_3_3 =
61
61
  "\t\t$(Q) $(PURIFY) $(CC) $(EXE_LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(EXTOBJS) " \
62
62
  "$(LIBRUBYARG) $(MAINLIBS) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@"
63
63
 
64
+ TEMPLATE_MAKEFILE_IN_BASE_PATTERN =
65
+ "\t\t$(Q) $(PURIFY) $(CC) $(EXE_LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(EXTOBJS) " \
66
+ "$(LIBRUBYARG) $(MAINLIBS) $(EXTLIBS) $(OUTFLAG)$@"
67
+
64
68
  TEMPLATE_MAKEFILE_IN_BASE_PATCH =
65
69
  "# -- Start of tebako patch --\n" \
66
70
  "\t\t$(Q) $(PURIFY) $(CC) $(EXE_LDFLAGS) $(MAINOBJ) " \
@@ -73,13 +77,23 @@ module Tebako
73
77
  "$(EXTOBJS) $(LIBRUBYARG_STATIC) $(OUTFLAG)$@\n" \
74
78
  "# -- End of tebako patch --"
75
79
 
76
- def template_makefile_in_patch_two(ostype, ruby_ver)
80
+ def template_makefile_in_subst(ostype, ruby_ver)
77
81
  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 }
82
+ TEMPLATE_MAKEFILE_IN_BASE_PATCH_MSYS
83
+ elsif !PatchHelpers.ruby31?(ruby_ver)
84
+ TEMPLATE_MAKEFILE_IN_BASE_PATCH_PRE_3_1
85
+ else
86
+ TEMPLATE_MAKEFILE_IN_BASE_PATCH
87
+ end
88
+ end
89
+
90
+ def template_makefile_in_patch_two(ostype, ruby_ver)
91
+ if !PatchHelpers.ruby31?(ruby_ver)
92
+ { TEMPLATE_MAKEFILE_IN_BASE_PATTERN_PRE_3_1 => template_makefile_in_subst(ostype, ruby_ver) }
93
+ elsif !PatchHelpers.ruby33?(ruby_ver)
94
+ { TEMPLATE_MAKEFILE_IN_BASE_PATTERN_PRE_3_3 => template_makefile_in_subst(ostype, ruby_ver) }
81
95
  else
82
- { TEMPLATE_MAKEFILE_IN_BASE_PATTERN_PRE_3_1 => TEMPLATE_MAKEFILE_IN_BASE_PATCH_PRE_3_1 }
96
+ { TEMPLATE_MAKEFILE_IN_BASE_PATTERN => template_makefile_in_subst(ostype, ruby_ver) }
83
97
  end
84
98
  end
85
99
 
@@ -94,10 +108,30 @@ module Tebako
94
108
  # End of tebako patch
95
109
  SUBST
96
110
 
111
+ def get_config_status_pattern(ostype)
112
+ case ostype
113
+ when /linux-/
114
+ "S[\"MAINLIBS\"]=\"-lz -lrt -lrt -ldl -lcrypt -lm -lpthread \""
115
+ when /darwin/
116
+ "S[\"MAINLIBS\"]=\"-ldl -lobjc -lpthread \""
117
+ when /msys/
118
+ "S[\"MAINLIBS\"]=\"-lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi -lbcrypt \""
119
+ else
120
+ raise Tebako::Error, "Unknown ostype #{ostype}"
121
+ end
122
+ end
123
+
124
+ def get_config_status_patch(ostype, deps_lib_dir, ruby_ver)
125
+ {
126
+ get_config_status_pattern(ostype) =>
127
+ "S[\"MAINLIBS\"]=\"#{PatchLibraries.mlibs(ostype, deps_lib_dir, ruby_ver, false)}\""
128
+ }
129
+ end
130
+
97
131
  # Other MSYS (GNUMakefile) specific patches
98
132
  # - The same issue with libraries as for Makefile above
99
133
  # - 'Kill' ruby.exp regeneration on pass2
100
- # since we want to use outpu from pass1 for implib generation
134
+ # since we want to use output from pass1 for implib generation
101
135
  # [VERY UGLY HACK]
102
136
  # - Introduce LIBRUBY dependency on static extensions
103
137
  # This is an addition to COMMON_MK_PATCH specified above
@@ -116,10 +116,6 @@ module Tebako
116
116
  ruby3x?(ruby_ver) && ruby_ver[2].to_i >= 1
117
117
  end
118
118
 
119
- def ruby316?(ruby_ver)
120
- ruby3x?(ruby_ver) && ruby_ver[2] == "1" && ruby_ver[4].to_i >= 6
121
- end
122
-
123
119
  def ruby32?(ruby_ver)
124
120
  ruby3x?(ruby_ver) && ruby_ver[2].to_i >= 2
125
121
  end
@@ -47,24 +47,94 @@ module Tebako
47
47
 
48
48
  DARWIN_BREW_LIBS_31 = [["openssl@3", "ssl"], ["openssl@3", "crypto"]].freeze
49
49
 
50
- DARWIN_DEP_LIBS = ["glog", "gflags", "brotlienc", "brotlidec", "brotlicommon"].freeze
50
+ DARWIN_DEP_LIBS_1 = ["folly", "fsst", "metadata_thrift", "thrift_light", "xxhash", "zstd"].freeze
51
+ DARWIN_DEP_LIBS_2 = ["glog", "gflags", "brotlienc", "brotlidec", "brotlicommon"].freeze
51
52
  # rubocop:enable Style/WordArray
52
53
 
54
+ COMMON_LINUX_LIBRARIES = [
55
+ "-l:libdwarfs-wr.a", "-l:libtebako-fs.a", "-l:libdwarfs.a", "LIBCOMPRESSION",
56
+ "-l:libfolly.a", "-l:libfsst.a", "-l:libmetadata_thrift.a", "-l:libthrift_light.a",
57
+ "-l:libxxhash.a", "-l:libfmt.a", "-l:libdouble-conversion.a", "-l:libglog.a",
58
+ "-l:libgflags.a", "-l:libevent.a"
59
+ ].freeze
60
+
61
+ COMMON_ARCHIEVE_LIBRARIES = [
62
+ "-l:libarchive.a", "-l:liblz4.a", "-l:libz.a", "-l:libzstd.a",
63
+ "-l:libbrotlienc.a", "-l:libbrotlidec.a", "-l:libbrotlicommon.a", "-l:liblzma.a"
64
+ ].freeze
65
+
66
+ LINUX_GNU_LIBRARIES = [
67
+ "-l:libiberty.a", "-l:libacl.a", "-l:libssl.a", "-l:libcrypto.a",
68
+ "-l:libgdbm.a", "-l:libreadline.a", "-l:libtinfo.a", "-l:libffi.a",
69
+ "-l:libncurses.a", "-l:libjemalloc.a", "-l:libcrypt.a", "-l:libanl.a",
70
+ "LIBYAML", "-l:libboost_system.a", "-l:libboost_chrono.a", "-l:libutil.a",
71
+ "-l:libstdc++.a", "-lgcc_eh", "-l:libunwind.a", "-l:liblzma.a",
72
+ "-l:librt.a", "-ldl", "-lpthread", "-lm"
73
+ ].freeze
74
+
75
+ LINUX_MUSL_LIBRARIES = [
76
+ "-l:libiberty.a", "-l:libacl.a", "-l:libssl.a", "-l:libcrypto.a",
77
+ "-l:libreadline.a", "-l:libgdbm.a", "-l:libffi.a", "-l:libncurses.a",
78
+ "-l:libjemalloc.a", "-l:libcrypt.a", "LIBYAML", "-l:libboost_system.a",
79
+ "-l:libboost_chrono.a", "-l:librt.a", "-l:libstdc++.a", "-lgcc_eh",
80
+ " -l:libunwind.a", "-l:liblzma.a", "-ldl", "-lpthread"
81
+ ].freeze
82
+
83
+ MSYS_LIBRARIES = [
84
+ "-l:liblz4.a", "-l:libz.a", "-l:libzstd.a", "-l:liblzma.a",
85
+ "-l:libncurses.a", "-l:libunwind.a", "-l:liblzma.a", "-l:libiberty.a",
86
+ "LIBYAML", "-l:libffi.a", "-l:libboost_system-mt.a", "-l:libboost_chrono-mt.a",
87
+ "-l:libstdc++.a", "-l:libdl.a", "-static-libgcc", "-static-libstdc++",
88
+ "-l:libssl.a", "-l:libcrypto.a", "-l:libz.a", "-l:libwinpthread.a",
89
+ "-lcrypt32", "-lshlwapi", "-lwsock32", "-liphlpapi",
90
+ "-limagehlp", "-lbcrypt", "-lole32", "-loleaut32",
91
+ "-luuid", "-lws2_32"
92
+ ].freeze
93
+
94
+ def linux_gnu_libraries(ruby_ver, with_compression)
95
+ libraries = COMMON_LINUX_LIBRARIES + COMMON_ARCHIEVE_LIBRARIES + LINUX_GNU_LIBRARIES
96
+ linux_libraries(libraries, ruby_ver, with_compression)
97
+ end
98
+
99
+ def linux_musl_libraries(ruby_ver, with_compression)
100
+ libraries = COMMON_LINUX_LIBRARIES + COMMON_ARCHIEVE_LIBRARIES + LINUX_MUSL_LIBRARIES
101
+ linux_libraries(libraries, ruby_ver, with_compression)
102
+ end
103
+
104
+ def linux_libraries(libraries, ruby_ver, with_compression)
105
+ libraries.map! do |lib|
106
+ if lib == "LIBYAML"
107
+ PatchHelpers.yaml_reference(ruby_ver)
108
+ elsif lib == "LIBCOMPRESSION"
109
+ with_compression ? "-Wl,--push-state,--whole-archive -l:libdwarfs_compression.a -Wl,--pop-state" : ""
110
+ else
111
+ lib
112
+ end
113
+ end
114
+ libraries.join(" ")
115
+ end
116
+
117
+ def msys_libraries(ruby_ver, with_compression)
118
+ libraries = with_compression ? ["-Wl,-Bstatic"] : []
119
+ libraries = libraries + COMMON_LINUX_LIBRARIES + MSYS_LIBRARIES
120
+ linux_libraries(libraries, ruby_ver, with_compression)
121
+ end
122
+
53
123
  def process_brew_libs!(libs, brew_libs)
54
124
  brew_libs.each { |lib| libs << "#{PatchHelpers.get_prefix_macos(lib[0]).chop}/lib/lib#{lib[1]}.a " }
55
125
  end
56
126
 
57
- def darwin_libs(deps_lib_dir, ruby_ver)
127
+ def darwin_libraries(deps_lib_dir, ruby_ver, with_compression)
58
128
  libs = String.new
59
129
 
130
+ DARWIN_DEP_LIBS_1.each { |lib| libs << "#{deps_lib_dir}/lib#{lib}.a " }
60
131
  process_brew_libs!(libs, PatchHelpers.ruby31?(ruby_ver) ? DARWIN_BREW_LIBS_31 : DARWIN_BREW_LIBS_PRE_31)
61
132
  process_brew_libs!(libs, DARWIN_BREW_LIBS)
62
133
 
63
- DARWIN_DEP_LIBS.each { |lib| libs << "#{deps_lib_dir}/lib#{lib}.a " }
64
- <<~SUBST
65
- -ltebako-fs -ldwarfs-wr -ldwarfs -force_load #{deps_lib_dir}/libdwarfs_compression.a -lfolly -lfsst -lmetadata_thrift -lthrift_light -lxxhash \
66
- -lzstd #{libs} -ljemalloc -lc++ -lc++abi
67
- SUBST
134
+ DARWIN_DEP_LIBS_2.each { |lib| libs << "#{deps_lib_dir}/lib#{lib}.a " }
135
+
136
+ compression_lib = with_compression ? "-force_load #{deps_lib_dir}/libdwarfs_compression.a" : ""
137
+ "-ltebako-fs -ldwarfs-wr -ldwarfs #{compression_lib} #{libs} -ljemalloc -lc++ -lc++abi"
68
138
  end
69
139
 
70
140
  # .....................................................
@@ -79,66 +149,16 @@ module Tebako
79
149
  # This is fixed by ext/extmk.rb patch [TODO ?]
80
150
  # .....................................................
81
151
 
82
- def linux_common_libs
83
- <<~SUBST
84
- -l:libtebako-fs.a -l:libdwarfs-wr.a -l:libdwarfs.a -Wl,--push-state,--whole-archive -l:libdwarfs_compression.a -Wl,--pop-state -l:libfolly.a -l:libfsst.a \\
85
- -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 \\
86
- SUBST
87
- end
88
-
89
- def common_enc_libs
90
- "-l:liblz4.a -l:libz.a -l:libzstd.a -l:libbrotlienc.a -l:libbrotlidec.a -l:libbrotlicommon.a -l:liblzma.a"
91
- end
92
-
93
- def linux_gnu_libs(ruby_ver)
94
- <<~SUBST
95
- #{linux_common_libs} \
96
- -l:libarchive.a -l:libiberty.a -l:libacl.a -l:libssl.a -l:libcrypto.a #{common_enc_libs} \\
97
- -l:libgdbm.a -l:libreadline.a -l:libtinfo.a -l:libffi.a -l:libncurses.a -l:libjemalloc.a -l:libcrypt.a -l:libanl.a #{PatchHelpers.yaml_reference(ruby_ver)} \\
98
- -l:libboost_system.a -l:libboost_chrono.a -l:libutil.a -l:libstdc++.a -lgcc_eh -l:libunwind.a -l:liblzma.a -l:librt.a -ldl -lpthread -lm
99
- SUBST
100
- end
101
-
102
- def linux_musl_libs(ruby_ver)
103
- <<~SUBST
104
- #{linux_common_libs} \
105
- -l:libiberty.a -l:libacl.a -l:libssl.a -l:libcrypto.a #{common_enc_libs} -l:libreadline.a \\
106
- -l:libgdbm.a -l:libffi.a -l:libncurses.a -l:libjemalloc.a -l:libcrypt.a #{PatchHelpers.yaml_reference(ruby_ver)} -l:libboost_system.a -l:libboost_chrono.a \\
107
- -l:librt.a -l:libstdc++.a -lgcc_eh -l:libunwind.a -l:liblzma.a -ldl -lpthread
108
- SUBST
109
- end
110
-
111
- # Used for mkconfig.rb
112
- def msys_base_libs(ruby_ver)
113
- <<~SUBST
114
- "-l:libtebako-fs.a -l:libdwarfs-wr.a -l:libdwarfs.a -l:libdwarfs_compression.a -l:libfolly.a -l:libfsst.a " \\
115
- "-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 " \\
116
- "-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)} " \\
117
- "-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 " \\
118
- "-l:libz.a -l:libwinpthread.a -lcrypt32 -lshlwapi -lwsock32 -liphlpapi -limagehlp -lbcrypt -lole32 -loleaut32 -luuid"
119
- SUBST
120
- end
121
-
122
- # Used in Makefile
123
- def msys_libs(ruby_ver)
124
- <<~SUBST
125
- -Wl,-Bstatic #{linux_common_libs} \
126
- -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)} \\
127
- -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 -l:libz.a \\
128
- -l:libwinpthread.a -lcrypt32 -lshlwapi -lwsock32 -liphlpapi -limagehlp -lshlwapi -lbcrypt -lws2_32 -lole32 -loleaut32 -luuid
129
- SUBST
130
- end
131
-
132
- def mlibs(ostype, deps_lib_dir, ruby_ver) # rubocop:disable Metrics/MethodLength
152
+ def mlibs(ostype, deps_lib_dir, ruby_ver, with_compression) # rubocop:disable Metrics/MethodLength
133
153
  case ostype
134
154
  when /linux-gnu/
135
- linux_gnu_libs(ruby_ver)
155
+ linux_gnu_libraries(ruby_ver, with_compression)
136
156
  when /linux-musl/
137
- linux_musl_libs(ruby_ver)
157
+ linux_musl_libraries(ruby_ver, with_compression)
138
158
  when /darwin/
139
- darwin_libs(deps_lib_dir, ruby_ver)
159
+ darwin_libraries(deps_lib_dir, ruby_ver, with_compression)
140
160
  when /msys/
141
- msys_libs(ruby_ver)
161
+ msys_libraries(ruby_ver, with_compression)
142
162
  else
143
163
  raise Tebako::Error, "Unknown ostype #{ostype}"
144
164
  end
@@ -30,25 +30,23 @@ module Tebako
30
30
  module Packager
31
31
  # Ruby patching literals (pass2)
32
32
  module PatchLiterals
33
- TOOL_MKCONFIG_RB_PATCH = {
34
- " if fast[name]" => <<~SUBST
35
- # -- Start of tebako patch --
36
- v_head_comp = " CONFIG[\\"prefix\\"] \#{eq} "
37
- if v_head_comp == v[0...(v_head_comp.length)]
38
- v = "\#{v[0...(v_head_comp.length)]}'/__tebako_memfs__'
39
- "
40
- end
41
- v_head_comp = " CONFIG[\\"RUBY_EXEC_PREFIX\\"] \#{eq} "
42
- if v_head_comp == v[0...(v_head_comp.length)]
33
+ TOOL_MKCONFIG_RB_SUBST = <<~SUBST
34
+ # -- Start of tebako patch --
35
+ v_head_comp = " CONFIG[\\"prefix\\"] \#{eq} "
36
+ if v_head_comp == v[0...(v_head_comp.length)]
43
37
  v = "\#{v[0...(v_head_comp.length)]}'/__tebako_memfs__'
44
- "
45
- end
46
- # -- End of tebako patch --
47
- if fast[name]
48
- SUBST
49
- }.freeze
38
+ "
39
+ end
40
+ v_head_comp = " CONFIG[\\"RUBY_EXEC_PREFIX\\"] \#{eq} "
41
+ if v_head_comp == v[0...(v_head_comp.length)]
42
+ v = "\#{v[0...(v_head_comp.length)]}'/__tebako_memfs__'
43
+ "
44
+ end
45
+ # -- End of tebako patch --
46
+ if fast[name]
47
+ SUBST
50
48
 
51
- TOOLS_MKCONFIG_RB_SUBST = <<~SUBST
49
+ TOOL_MKCONFIG_RB_SUBST_MSYS = <<~SUBST
52
50
  # -- Start of tebako patch --
53
51
  v_head_comp = " CONFIG[\\"prefix\\"] \#{eq} "
54
52
  if v_head_comp == v[0...(v_head_comp.length)]
@@ -26,5 +26,5 @@
26
26
  # POSSIBILITY OF SUCH DAMAGE.
27
27
 
28
28
  module Tebako
29
- VERSION = "0.7.4"
29
+ VERSION = "0.8.0"
30
30
  end
data/src/tebako-main.cpp CHANGED
@@ -156,3 +156,10 @@ extern "C" const char* tebako_mount_point(void) {
156
156
  extern "C" int tebako_is_running_miniruby(void) {
157
157
  return running_miniruby;
158
158
  }
159
+
160
+ #ifdef RB_W32_PRE_33
161
+ extern "C" ssize_t rb_w32_pread(int /* fd */, void* /* buf */, size_t /* size */, size_t /* offset */)
162
+ {
163
+ return -1;
164
+ }
165
+ #endif
data/version.txt CHANGED
@@ -1 +1 @@
1
- 0.7.4
1
+ 0.8.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.7.4
4
+ version: 0.8.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-07-24 00:00:00.000000000 Z
11
+ date: 2024-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor