forked from RetroPie/RetroPie-Setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathretropie_packages.sh
executable file
·89 lines (69 loc) · 2.48 KB
/
retropie_packages.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/usr/bin/env bash
#
# (c) Copyright 2012-2015 Florian Müller ([email protected])
#
# RetroPie-Setup homepage: https://github.com/petrockblog/RetroPie-Setup
#
# Permission to use, copy, modify and distribute this work in both binary and
# source form, for non-commercial purposes, is hereby granted without fee,
# providing that this license information and copyright notice appear with
# all copies and any derived work.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event shall the authors be held liable for any damages
# arising from the use of this software.
#
# RetroPie-Setup is freeware for PERSONAL USE only. Commercial users should
# seek permission of the copyright holders first. Commercial use includes
# charging money for RetroPie-Setup or software derived from RetroPie-Setup.
#
# The copyright holders request that bug fixes and improvements to the code
# should be forwarded to them so everyone can benefit from the modifications
# in future versions.
#
# Many, many thanks go to all people that provide the individual packages!!!
#
# global variables ==========================================================
# main retropie install location
rootdir="/opt/retropie"
user="$SUDO_USER"
[[ -z "$user" ]] && user=$(id -un)
home="$(eval echo ~$user)"
biosdir="$home/RetroPie/BIOS"
romdir="$home/RetroPie/roms"
emudir="$rootdir/emulators"
configdir="$rootdir/configs"
scriptdir=$(dirname "$0")
scriptdir=$(cd "$scriptdir" && pwd)
__logdir="$scriptdir/logs"
__tmpdir="$scriptdir/tmp"
__builddir="$__tmpdir/build"
__swapdir="$__tmpdir"
# check, if sudo is used
if [[ $(id -u) -ne 0 ]]; then
echo "Script must be run as root. Try 'sudo $0'"
exit 1
fi
__backtitle="PetRockBlock.com - RetroPie Setup. Installation folder: $rootdir for user $user"
source "$scriptdir/scriptmodules/system.sh"
source "$scriptdir/scriptmodules/helpers.sh"
source "$scriptdir/scriptmodules/packages.sh"
setup_env
if ! getDepends git dialog python-lxml wget gcc-$__default_gcc_version g++-$__default_gcc_version build-essential xmlstarlet; then
printMsgs "console" "Unable to install packages required by $0" "${md_ret_errors[@]}" >&2
exit 1
fi
# set default gcc version
gcc_version $__default_gcc_version
mkUserDir "$romdir"
mkUserDir "$biosdir"
rp_registerAllModules
ensureFBModes
[[ "$1" == "init" ]] && return
if [[ $# -gt 0 ]]; then
ensureRootdirExists
rp_callModule "$@"
else
rp_printUsageinfo
fi
printMsgs "console" "${__INFMSGS[@]}"