@@ -16,7 +16,10 @@ def configure(self):
1616 super ().configure ()
1717 oss_dir = f'{ self .build_ } /data_manager/oss'
1818 ensure ('mkdir' , ['-p' , oss_dir ])
19- ensure ('ln' , ['-sf' , f'{ ROOT } /cache/mozc_data.inc' , f'{ oss_dir } /mozc_data.inc' ])
19+ if PLATFORM == 'js' :
20+ ensure ('ln' , ['-sf' , f'{ ROOT } /patches/mozc_data.inc' , f'{ oss_dir } /mozc_data.inc' ])
21+ else :
22+ ensure ('ln' , ['-sf' , f'{ ROOT } /cache/mozc_data.inc' , f'{ oss_dir } /mozc_data.inc' ])
2023
2124 def install (self ):
2225 super ().install ()
@@ -26,6 +29,11 @@ def install(self):
2629 all_libabsl_o = f'$(find { self .build_ } /mozc/src/third_party/abseil-cpp -name "*.o" | sort)'
2730 ensure (ar , ['rc' , libabsl_a , all_libabsl_o ])
2831
32+ if PLATFORM == 'js' :
33+ share_dir = f'{ self .dest_dir } { INSTALL_PREFIX } /share/mozc'
34+ ensure ('mkdir' , ['-p' , share_dir ])
35+ ensure ('cp' , [f'{ ROOT } /cache/mozc.data' , share_dir ])
36+
2937 def pre_package (self ):
3038 if PLATFORM != 'macos' :
3139 ensure ('rm' , ['-rf' , f'{ self .dest_dir } { INSTALL_PREFIX } /bin' ])
@@ -51,6 +59,11 @@ def pre_package(self):
5159 patch ('libmozc/mozc' )
5260 # Fix RuntimeError: null function or function signature mismatch.
5361 patch ('libmozc/mozc/src/third_party/abseil-cpp' )
62+ # Use raw data instead of embed data into libmozc.so so that Chrome accepts it
63+ # without --enable-features=WebAssemblyUnlimitedSyncCompilation.
64+ cache ('https://github.com/fcitx-contrib/fcitx5-mozc/releases/download/latest/mozc.data' )
65+ else :
66+ cache ('https://github.com/fcitx-contrib/fcitx5-mozc/releases/download/latest/mozc_data.inc' )
5467
5568if platform .system () == 'Darwin' and PLATFORM != 'macos' :
5669 steal ('libmozc' , ('bin' ,)) # extracted to install dir so need to remove on prepack.
@@ -59,6 +72,4 @@ def pre_package(self):
5972if PLATFORM in ('ios' , 'js' ):
6073 options .append (f'-DPROTOC_EXECUTABLE={ protoc_exe } ' )
6174
62- cache ('https://github.com/fcitx-contrib/fcitx5-mozc/releases/download/latest/mozc_data.inc' )
63-
6475MozcBuilder ('libmozc' , options ).exec ()
0 commit comments