-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbootstrap
executable file
·82 lines (75 loc) · 1.3 KB
/
bootstrap
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
#!/usr/bin/env bash
# Attempts to set up a machine that has never seen anything devkitPro-related before.
# Take it with a salt-grain; read it and do it yourself step by step.
packages=$(cat requirements.txt)
ext=none
mgr=none
pacman=pacman
arch=$(uname -m)
system=$(uname -s)
echo "info : bootstrapping for $system on $arch ..."
case $system in
Darwin)
mgr=pkg
ext=pkg
pacman=dkp-pacman
;;
Linux)
if [ -f /etc/arch-release ]
then
pacman=pacman
mgr=pacman
ext=none
fi
if [ -f /etc/debian-version ] || [ -f /etc/debian_version ]
then
mgr=apt
ext=deb
pacman=dkp-pacman
fi
;;
*)
echo fatal: system $system unknown.
exit 1
;;
esac
case $arch in
arm64)
arch=arm64
;;
aarch64)
arch=arm64
;;
x86_64)
arch=amd64
;;
*)
echo fatal: arch $arch unknown.
exit 1
;;
esac
if [ $ext == pkg ] || [ $ext == deb ]
then
pacball=none
case $ext in
pkg)
pacball=devkitpro-pacman-installer.pkg
;;
deb)
pacball=devkitpro-pacman.$arch.deb
;;
esac
wget https://github.com/devkitPro/pacman/releases/download/v1.0.2/$pacball
case $system in
Darwin)
sudo installer -pkg $pacball -target /
sudo $pacman -S --noconfirm $packages
rm $pacball
;;
Linux)
sudo apt install wget gdebi-core -y
sudo gdebi -n devkitpro-pacman.$arch.deb
sudo $pacman -S --noconfirm $packages
;;
esac
fi