forked from voikko/libreoffice-voikko
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kbu-build
executable file
·60 lines (51 loc) · 1.72 KB
/
kbu-build
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
# To run with full debug output, and without opening a window:
# $ PYUNO_LOGLEVEL=ARGS ./kbu-build --headless
# To create a standalone extension, first find the macos libs from the
# newest successful OSX+Clang build of master on
# https://travis-ci.org/divvun/libdivvun/builds and scroll down the
# log to the transfer.sh url, then run e.g.
#
# $ ./get-travis-libs https://transfer.sh/dUPaP/Darwin-64bit-.zip
#
# Now put any zcheck files you want bundled into the divvun folder:
#
# $ mkdir -p divvun
# $ cp /usr/share/voikko/4/se.zcheck divvun/
#
# Then build everything with:
#
# $ STANDALONE_EXTENSION=1 PYUNO_LOGLEVEL=ARGS ./kbu-build --headless
# If we're *not* building a standalone extension, we have to make
# either install libdivvun under /usr or ensure it's available in the
# various paths:
if [[ -z $STANDALONE_EXTENSION ]]; then
set -x
export LD_LIBRARY_PATH="$HOME/PREFIX/gtd-gc/lib"
export PYTHONPATH="$HOME/PREFIX/gtd-gc/lib/python3.6/site-packages"
set +x
fi
set -e -u
# For Mac-building:
PATH="/Applications/LibreOffice.app/Contents/MacOS/:$PATH"
make clean
make
if [[ -z ${STANDALONE_EXTENSION:-} ]]; then
make oxt
else
make oxt STANDALONE_EXTENSION=1
fi
( unopkg remove no.divvun.gramcheck || echo meh )
unopkg add -f build/divvun.oxt
### Used by divvun when we want debug output:
export DIVVUN_DEBUG=1
soffice "$@" sme.odt 2>&1 | awk '
{ color="" }
$3 ~ /\[CALL,tid/{color="38;2;205;92;92" }
$3 ~ /\[CALL,tid/ && $5 ~ /except/ {color="37;1;205;92;91" }
$2 == "INFO" {color="38;2;175;175;135"}
$2 == "DEBUG" {color="38;2;100;149;237"}
$2 == "WARNING" {color="38;5;161" }
color { printf "\033["color"m%s\033[0m\n", $0; next }
{ print }
'