forked from libretro/libretro-super
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibretro-install.sh
executable file
·50 lines (41 loc) · 951 Bytes
/
libretro-install.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
45
46
47
48
49
#!/bin/bash
. ./libretro-config.sh
# BSDs don't have readlink -f
read_link()
{
TARGET_FILE="$1"
cd $(dirname "$TARGET_FILE")
TARGET_FILE=$(basename "$TARGET_FILE")
while [ -L "$TARGET_FILE" ]
do
TARGET_FILE=$(readlink "$TARGET_FILE")
cd $(dirname "$TARGET_FILE")
TARGET_FILE=$(basename "$TARGET_FILE")
done
PHYS_DIR=$(pwd -P)
RESULT="$PHYS_DIR/$TARGET_FILE"
echo $RESULT
}
SCRIPT=$(read_link "$0")
BASE_DIR=$(dirname "$SCRIPT")
RARCH_DIR="$BASE_DIR/dist"
RARCH_DIST_DIR="$RARCH_DIR/$DIST_DIR"
if [ -z "$1" ]; then
LIBRETRO_DIR="/usr/local/lib/libretro"
else
LIBRETRO_DIR="$1"
fi
for lib in "$RARCH_DIST_DIR"/*
do
if [ -f "$lib" ]; then
install -v -m644 "$lib" "$LIBRETRO_DIR"
else
echo "Library $lib not found, skipping ..."
fi
done
for infofile in "$RARCH_DIR"/info/*.info
do
if [ -f "$infofile" ]; then
install -v -m644 "$infofile" "$LIBRETRO_DIR"
fi
done