forked from voikko/libreoffice-voikko
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmac-build-oxt-bundle
executable file
·80 lines (64 loc) · 2 KB
/
mac-build-oxt-bundle
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
set -e -u
latest_release=https://github.com/divvun/libdivvun/releases/download/v0.3.9/Darwin-64bit-.zip
LIBDIVVUN_MAC_RELEASE="${LIBDIVVUN_MAC_RELEASE:-${latest_release}}"
if [[ $# -eq 0 ]]; then
cat <<EOF
This script creates a LibreOffice .oxt file that includes all of
libdivvun and its dependencies as well as whatever language data
(zcheck files) you give it.
The regular .oxt file made by libreoffice-divvun assumes the user has
zcheck language data in e.g. ~/.config/voikko/4 or
/usr/share/voikko/4, while the bundle made by this script includes the
language data in the .oxt file itself.
To run this, please supply the zcheck files to include as arguments,
e.g.
\$ $0 /usr/share/voikko/4/*.zcheck
to make a bundle of all the zcheck divvun language data files in
/usr/share/voikko/4.
If you want to make an .oxt that has no language data, just the code
dependencies, run:
\$ $0 --no-data
By default fetches libdivvun and dependencies from
${LIBDIVVUN_MAC_RELEASE}
- export LIBDIVVUN_MAC_RELEASE to something else if you want to build
a different build of libdivvun.
EOF
exit 1
fi
if [[ -d oxt/divvun || -d build/oxt/divvun ]]; then
echo
echo "Warning: Found old build products, you should probably run"
echo "$ make clean"
echo "before this script"
echo
sleep 1
fi
mkdir -p oxt/divvun
case "$1" in
--no-data)
echo
echo "Not adding any zcheck files to the bundle"
echo
;;
*)
echo
echo "Adding zcheck files $* to the bundle"
echo
cp "$@" oxt/divvun
;;
esac
zip="$(mktemp -t libreoffice-divvun-get-travis-libs.XXXXXXXXXXX)"
cleanup () { rm -f "${zip}"; }
trap cleanup EXIT
if command -V curl 2>/dev/null >/dev/null; then
curl -L --progress "${LIBDIVVUN_MAC_RELEASE}" > "${zip}"
else
wget "${LIBDIVVUN_MAC_RELEASE}" -O "${zip}"
fi
unzip -o -d oxt "${zip}"
export PATH="/Applications/LibreOffice.app/Contents/MacOS/:$PATH"
make oxt STANDALONE_EXTENSION=1
echo
echo "All done:"
ls build/divvun.oxt