1
1
#! /bin/sh
2
2
3
- # Usage: ./deploy-mac [build-dir] [codesign]
4
- # where build-dir is the folder where the executable has already been built (by default, "build/")
3
+ # Usage: ./deploy-mac [build-dir] [cache-dir] [codesign]
4
+ # where build-dir is the folder where the executable has already been built (by default, "build/"),
5
+ # cache-dir is the folder where the bibref-addbooks-cache indices are present,
5
6
# and codesign is the input for performing an optional code signing.
6
7
7
8
BUILD_DIR=" $1 "
@@ -10,6 +11,11 @@ if [ "$BUILD_DIR" = "" ]; then
10
11
BUILD_DIR=" build/"
11
12
fi
12
13
14
+ CACHE_DIR=" $2 "
15
+ if [ " $CACHE_DIR " = " " ]; then
16
+ CACHE_DIR=" ../build/bibref-addbooks-cache"
17
+ fi
18
+
13
19
MACDEPLOYQT=$( command -v macdeployqt)
14
20
if [ ! -x " $MACDEPLOYQT " ]; then
15
21
echo " macdeployqt is not in path."
@@ -21,11 +27,19 @@ test -d "$BUILD_DIR/bibref-qt.app/" || {
21
27
exit 2
22
28
}
23
29
24
- test -d bin || {
25
- mkdir bin
26
- cp -R $BUILD_DIR /bibref-qt.app bin
30
+ test -d bin && {
31
+ echo " The bin folder should be removed first."
32
+ exit 3
33
+ }
34
+
35
+ test -d " $CACHE_DIR " || {
36
+ echo " Build the cli version first and generate the cache via addbooks."
37
+ exit 4
27
38
}
28
39
40
+ mkdir bin
41
+ cp -R $BUILD_DIR /bibref-qt.app bin
42
+
29
43
mkdir -p " bin/bibref-qt.app/Contents/Resources/statements/"
30
44
mkdir -p " bin/bibref-qt.app/Contents/Resources/statements/SBLGNT"
31
45
mkdir -p " bin/bibref-qt.app/Contents/Resources/statements/StatResGNT"
@@ -38,8 +52,11 @@ rm -fr bin/bibref-qt.app/Contents/Resources/statements/all
38
52
unzip ../sword-lxx-sblgnt-statresgnt-kjv-fallback.zip -d bin/bibref-qt.app/Contents/Resources
39
53
mv bin/bibref-qt.app/Contents/Resources/.sword bin/bibref-qt.app/Contents/Resources/sword
40
54
41
- if [ -z " $2 " ]; then
55
+ # Put the cache in the bundle
56
+ cp -R $CACHE_DIR bin/bibref-qt.app/Contents/Resources
57
+
58
+ if [ -z " $3 " ]; then
42
59
$MACDEPLOYQT bin/bibref-qt.app -dmg
43
60
else
44
- $MACDEPLOYQT bin/bibref-qt.app -dmg -codesign=" $2 "
61
+ $MACDEPLOYQT bin/bibref-qt.app -dmg -codesign=" $3 "
45
62
fi
0 commit comments