libretro-super/libretro-install.sh

43 lines
749 B
Bash
Raw Normal View History

#! /usr/bin/env bash
# vim: set ts=3 sw=3 noet ft=sh : bash
2011-11-02 15:27:23 +00:00
SCRIPT="${0#./}"
BASE_DIR="${SCRIPT%/*}"
WORKDIR="$PWD"
2013-05-19 09:17:25 +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
LIBRETRO_DIR="/usr/local/lib/libretro"
2011-11-02 15:27:23 +00:00
else
LIBRETRO_DIR="$1"
2011-11-02 15:27:23 +00:00
fi
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
if [ -f "$lib" ]; then
install -v -m 644 "$lib" "$LIBRETRO_DIR"
else
echo "Library $lib not found, skipping ..."
fi
2011-11-02 15:27:23 +00:00
done
for infofile in "$RARCH_DIR"/info/*.info
do
if [ -f "$infofile" ]; then
install -v -m 644 "$infofile" "$LIBRETRO_DIR"
fi
done