chromium/third_party/liblouis/README.chromium

Name: Braille Translation Library
Short Name: liblouis
URL: https://github.com/liblouis/liblouis
Version: 3.22.0
CPEPrefix: cpe:/a:liblouis:liblouis:3.22.0
License: LGPLv3
License Android Compatible: No
License File: LICENSE
Security Critical: yes
Shipped: yes

Description:
Liblouis is an open-source braille translator and back-translator. It
features support for computer and literary braille, and supports
contracted and uncontracted translation for many languages.

LibLouis is used as a web assembly module.

Local Modifications:
  * Add liblouis_wrapper.js, a js wrapper to wasm binary.
  * Add tables.json, a list of tables with metadata.
  * Add cvox-common.cti with
common definitions for all tables mentioned in tables.json.
  * The web assembly module is compiled by using emscripten.

Use the following command to get the Emscripten sdk:
git clone https://github.com/emscripten-core/emsdk.git

Use the following commands to set up your environment:
cd <PATH_TO_EMSDK>
source ./emsdk_env.sh
emsdk install latest
emsdk activate latest
# To refresh paths for the activated sdk.
source ./emsdk_env.sh

Use the following commands to compile:
cd third_party/liblouis/src
cp ../cvox-common.cti tables/
./autogen.sh

emconfigure ./configure --disable-shared
emmake make

em++ ./liblouis/.libs/liblouis.a -s RESERVED_FUNCTION_POINTERS=1 -s MODULARIZE=1 \
-s TOTAL_MEMORY=167772160 -s EXPORT_NAME="'liblouisBuild'" \
-s EXPORTED_FUNCTIONS="[_lou_free, _lou_checkTable, _lou_backTranslateString, _lou_translate]" \
-s EXPORTED_RUNTIME_METHODS="['ccall','ALLOC_NORMAL', \
'allocate','FS', 'cwrap', 'stringToUTF16', \
'UTF16ToString','intArrayFromString', 'intArrayToString', 'setValue',\
'getValue']" --preload-file tables@/ -o liblouis_wasm.js

cp liblouis_wasm.* ../wasm