-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprovision.yml
124 lines (108 loc) · 5.04 KB
/
provision.yml
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
- name: Provision RS2 & PSX Modding Toolchain
hosts: all
become: no
tasks:
- name: Update apt cache
apt: update_cache=yes
become: yes
- name: Install required packages
apt:
name:
- python3
- python3-pip
- git
- libgl1-mesa-glx
- p7zip-full
- cmake
state: present
become: yes
- name: Clone repositories
git:
repo: "{{ item.repo }}"
dest: "{{ item.dest }}"
recursive: yes
loop:
- { repo: 'https://github.com/Lameguy64/mkpsxiso', dest: '/home/vagrant/mkpsxiso' }
- { repo: 'https://github.com/Illidanz/pymkpsxiso.git', dest: '/home/vagrant/pymkpsxiso' }
- { repo: 'https://github.com/Illidanz/pyxdelta.git', dest: '/home/vagrant/pyxdelta' }
- { repo: 'https://github.com/retro-git/psx-modding-toolchain', dest: '/home/vagrant/psx-modding-toolchain' }
- { repo: 'https://github.com/retro-git/rs2.git', dest: '/home/vagrant/psx-modding-toolchain/games/rs2' }
- name: Compile and install mkpsxiso
shell: |
cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Release
cmake --build ./build
cmake --install ./build
args:
chdir: "/home/vagrant/mkpsxiso"
become: yes
- name: Install pymkpsxiso and pyxdelta with pip
command: pip install .
args:
chdir: "{{ item }}"
loop:
- /home/vagrant/pymkpsxiso
- /home/vagrant/pyxdelta
- name: Install additional required Python packages
pip:
name:
- requests
- opencv-python
- pillow
- name: Make rs2 build directory
file:
path: "/home/vagrant/psx-modding-toolchain/games/rs2/build"
state: directory
- name: Copy psyq folder and spyro2.bin from /vagrant/ with remote_src
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
remote_src: yes
loop:
- { src: "/vagrant/psyq-4_7-converted", dest: "/home/vagrant/psx-modding-toolchain/games/rs2/mods/rs2/loader/" }
- { src: "/vagrant/spyro2.bin", dest: "/home/vagrant/psx-modding-toolchain/games/rs2/build/spyro2.bin" }
- { src: "/vagrant/spyro2.cue", dest: "/home/vagrant/psx-modding-toolchain/games/rs2/build/spyro2.cue" }
# - name: Download psyq and spyro2
# command: "wget {{ item.url }}"
# args:
# chdir: "{{ item.dest }}"
# loop:
# - { url: "http://psx.arthus.net/sdk/Psy-Q/psyq-4.7-converted-full.7z", dest: "/home/vagrant/psx-modding-toolchain/games/rs2/mods/rs2/loader/", creates: "/home/vagrant/psx-modding-toolchain/games/rs2/mods/rs2/loader/psyq-4.7-converted-full.7z" }
# - { url: "https://archive.org/download/Spyro2RiptosRage.7z/Spyro%202%20-%20Ripto%27s%20Rage.7z", dest: "/home/vagrant/psx-modding-toolchain/games/rs2/build/", creates: "/home/vagrant/psx-modding-toolchain/games/rs2/build/Spyro 2 - Ripto's Rage.7z" }
# when: not (item.creates is defined and item.creates is file)
# become: yes
# - name: Extract psyq and spyro2
# command: "7z x {{ item.src }} -o{{ item.dest }}"
# when: not (item.creates is defined and item.creates is file)
# loop:
# - { src: "/home/vagrant/psx-modding-toolchain/games/rs2/mods/rs2/loader/psyq-4.7-converted-full.7z", dest: "/home/vagrant/psx-modding-toolchain/games/rs2/mods/rs2/loader/psyq-4_7-converted", creates: "/home/vagrant/psx-modding-toolchain/games/rs2/mods/rs2/loader/psyq-4_7-converted" }
# - { src: "/home/vagrant/psx-modding-toolchain/games/rs2/build/Spyro 2 - Ripto's Rage.7z", dest: "/home/vagrant/psx-modding-toolchain/games/rs2/build", creates: "/home/vagrant/psx-modding-toolchain/games/rs2/build/spyro2.bin" }
# Rename first .bin file in /home/vagrant/psx-modding-toolchain/games/rs2/build to spyro2.bin
# - name: Rename first .bin file in /home/vagrant/psx-modding-toolchain/games/rs2/build to spyro2.bin
# shell: mv /home/vagrant/psx-modding-toolchain/games/rs2/build/*.bin /home/vagrant/psx-modding-toolchain/games/rs2/build/spyro2.bin
- name: Fetch mipsel toolchain compile script and make it executable
get_url:
url: "https://raw.githubusercontent.com/grumpycoders/pcsx-redux/main/tools/linux-mips/spawn-compiler.sh"
dest: "/home/vagrant/spawn-compiler.sh"
mode: "u+x"
- name: Gather mipsel file info
stat:
path: /usr/local/bin/mipsel-none-elf-gcc
register: mipsel
- name: Run mipsel toolchain compile script as sudo
command: "/home/vagrant/spawn-compiler.sh"
become: yes
when: mipsel.stat.exists == False
- name: Make /usr/libexec/gcc dir
file:
path: "/usr/libexec/gcc"
state: directory
become: yes
- name: Create symlinks
file:
src: "{{ item.src }}"
dest: "{{ item.dst }}"
state: link
loop:
- { src: "/home/vagrant/gcc-13.2.0/build/gcc/cc1", dst: "/usr/bin/cc1" }
- { src: "/home/vagrant/gcc-13.2.0/build/gcc/liblto_plugin.so", dst: "/usr/libexec/gcc/liblto_plugin.so" }
become: yes