forked from kodi-pvr/pvr.vuplus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-install-mac.sh
executable file
·44 lines (35 loc) · 1.2 KB
/
build-install-mac.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
if [ "$#" -ne 1 ] || ! [ -d "$1" ]; then
echo "Usage: $0 <XBMC-SRC-DIR>" >&2
exit 1
fi
if [[ "$OSTYPE" != "darwin"* ]]; then
echo "Error: Script only for use on MacOSX" >&2
exit 1
fi
BINARY_ADDONS_TARGET_DIR="$1/tools/depends/target/binary-addons"
MACOSX_BINARY_ADDONS_TARGET_DIR=""
KODI_ADDONS_DIR="$HOME/Library/Application Support/Kodi/addons"
ADDON_NAME=`basename -s .git \`git config --get remote.origin.url\``
if [ ! -d "$BINARY_ADDONS_TARGET_DIR" ]; then
echo "Error: Could not find binary addons directory at: $BINARY_ADDONS_TARGET_DIR" >&2
exit 1
fi
XBMC_BUILD_ADDON_INSTALL_DIR=$(cd $1/addons/$ADDON_NAME 2> /dev/null && pwd -P)
for DIR in "$BINARY_ADDONS_TARGET_DIR/"macosx*; do
if [ -d "${DIR}" ]; then
MACOSX_BINARY_ADDONS_TARGET_DIR="${DIR}"
fi
done
if [ -z "$MACOSX_BINARY_ADDONS_TARGET_DIR" ]; then
echo "Error: Could not find binary addons build directory at: $BINARY_ADDONS_DIR/macosx*" >&2
exit 1
fi
if [ ! -d "$KODI_ADDONS_DIR" ]; then
echo "Error: Kodi addons dir does not exist at: $KODI_ADDONS_DIR" >&2
exit 1
fi
cd "$MACOSX_BINARY_ADDONS_TARGET_DIR"
make
rm -rf "$KODI_ADDONS_DIR/$ADDON_NAME"
cp -rf "$XBMC_BUILD_ADDON_INSTALL_DIR" "$KODI_ADDONS_DIR"