-
Notifications
You must be signed in to change notification settings - Fork 4
/
hunspell.sh
29 lines (25 loc) · 1 KB
/
hunspell.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
####################
## Preamble ##
####################
# Exit when any command fails.
set -e
# Only execute on the arm64 architecture.
if [[ $(dpkg --print-architecture) != "arm64" ]]; then
echo "Not applying arm64 workaround: $(dpkg --print-architecture)"
exit;
fi
echo "Applying arm64 workaround."
# Make `wget` more robust by passing retry flags.
alias wget="wget --retry-connrefused --waitretry=30 --read-timeout=30 --timeout=30 --tries=20"
# Dependencies should be satisfied by `bridj.sh`.
##############################
## Replace `libhunspell.so` ##
##############################
mkdir /hunspell
cd /hunspell
wget https://dl-cdn.alpinelinux.org/alpine/latest-stable/main/aarch64/libhunspell-1.7.0-r1.apk
tar --warning=no-unknown-keyword -xzf libhunspell-1.7.0-r1.apk
mkdir -p /hunspell/org/bridj/lib/linux_x64/
mv /hunspell/usr/lib/libhunspell-1.7.so.0.0.1 /hunspell/org/bridj/lib/linux_x64/libhunspell.so
zip /dist/LanguageTool/libs/hunspell.jar org/bridj/lib/linux_x64/libhunspell.so