2015-02-17 03:19:30 +00:00
|
|
|
#! /usr/bin/env bash
|
|
|
|
# vim: set ts=3 sw=3 noet ft=sh : bash
|
2011-11-02 15:27:23 +00:00
|
|
|
|
2015-02-23 07:58:58 +00:00
|
|
|
SCRIPT="${0#./}"
|
|
|
|
BASE_DIR="${SCRIPT%/*}"
|
|
|
|
WORKDIR="$PWD"
|
2013-05-19 09:17:25 +00:00
|
|
|
|
2015-02-23 07:58:58 +00:00
|
|
|
if [ "$BASE_DIR" = "$SCRIPT" ]; then
|
|
|
|
BASE_DIR="$WORKDIR"
|
|
|
|
else
|
|
|
|
if [[ "$0" != /* ]]; then
|
|
|
|
# Make the path absolute
|
|
|
|
BASE_DIR="$WORKDIR/$BASE_DIR"
|
|
|
|
fi
|
|
|
|
fi
|
2013-05-08 11:00:38 +00:00
|
|
|
|
|
|
|
RARCH_DIR="$BASE_DIR/dist"
|
2013-05-19 09:17:25 +00:00
|
|
|
RARCH_DIST_DIR="$RARCH_DIR/$DIST_DIR"
|
2013-05-03 09:32:01 +00:00
|
|
|
|
2011-11-02 15:27:23 +00:00
|
|
|
if [ -z "$1" ]; then
|
2015-02-17 03:19:30 +00:00
|
|
|
LIBRETRO_DIR="/usr/local/lib/libretro"
|
2011-11-02 15:27:23 +00:00
|
|
|
else
|
2015-02-17 03:19:30 +00:00
|
|
|
LIBRETRO_DIR="$1"
|
2011-11-02 15:27:23 +00:00
|
|
|
fi
|
|
|
|
|
2014-09-16 07:51:23 +00:00
|
|
|
mkdir -p "$LIBRETRO_DIR"
|
2013-05-03 09:32:01 +00:00
|
|
|
for lib in "$RARCH_DIST_DIR"/*
|
2011-11-02 15:27:23 +00:00
|
|
|
do
|
2015-02-17 03:19:30 +00:00
|
|
|
if [ -f "$lib" ]; then
|
2015-02-23 07:58:58 +00:00
|
|
|
install -v -m 644 "$lib" "$LIBRETRO_DIR"
|
2015-02-17 03:19:30 +00:00
|
|
|
else
|
|
|
|
echo "Library $lib not found, skipping ..."
|
|
|
|
fi
|
2011-11-02 15:27:23 +00:00
|
|
|
done
|
|
|
|
|
2013-10-06 12:59:05 +00:00
|
|
|
for infofile in "$RARCH_DIR"/info/*.info
|
|
|
|
do
|
2015-02-17 03:19:30 +00:00
|
|
|
if [ -f "$infofile" ]; then
|
2015-02-23 07:58:58 +00:00
|
|
|
install -v -m 644 "$infofile" "$LIBRETRO_DIR"
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2013-10-06 12:59:05 +00:00
|
|
|
done
|
|
|
|
|