-
-
Notifications
You must be signed in to change notification settings - Fork 118
/
Copy pathpcsx-redux.nix
187 lines (177 loc) · 4.75 KB
/
pcsx-redux.nix
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
{
stdenv,
lib,
fetchFromGitHub,
libuv,
zlib,
curl,
ffmpeg,
glfw3,
capstone,
freetype,
libX11,
pkg-config,
imagemagick,
luajitPackages,
multipart-parser-c,
fmt,
magic-enum,
miniaudio,
gtest,
tl-expected,
elfio,
tracy,
md4c,
stb,
uriparser,
ucl,
llhttp,
src,
debugBuild ? false,
platforms,
}:
let
zep = fetchFromGitHub {
owner = "grumpycoders";
repo = "zep";
rev = "86ea3c7019f45ccd4a13503bf7d98a396e8f0193";
hash = "sha256-6NmUlOHkRQvCgbATcNxnFrfA2ZWROPYN8Vpd10k6Z2g=";
};
nanosvg = fetchFromGitHub {
owner = "grumpycoders";
repo = "nanosvg";
rev = "f0a3e1034dd22e2e87e5db22401e44998383124e";
hash = "sha256-af11kAga6Ru2rPgrfcYswXNy9etvH3J9FX2T0I0++ew=";
};
nanovg = fetchFromGitHub {
owner = "grumpycoders";
repo = "nanovg";
rev = "7c021819bbd4843a1a3091fe47346d3fcb2a3e1a";
hash = "sha256-gZHbNuDkLXlLlXZZpLBHcbwzTfeBBkLY7xl4L5yr2lY=";
};
vixl = fetchFromGitHub {
owner = "grumpycoders";
repo = "vixl";
rev = "53ad192b26ddf6edd228a24ae1cffc363b442c01";
hash = "sha256-p9Z2lFzhqnHnFWfqT6BIJBVw2ZpkVIxykhG3jUHXA84=";
};
imgui-md = fetchFromGitHub {
owner = "mekhontsev";
repo = "imgui_md";
rev = "8ca75c5f7663f314821e3d0b2c51011792bee68f";
hash = "sha256-uxhY81DWLRRCceYn9khk3rwzT+2f9PNMIMT9OrkPfFc=";
};
xbyak = fetchFromGitHub {
owner = "herumi";
repo = "xbyak";
rev = "2fb843c3287918038c8f76276a590c25cc7ec5ee";
hash = "sha256-XZce+kEZ7dipI19WY43ycOjzM2dZyANMEN5+GhoNYUk=";
};
luafs = fetchFromGitHub {
owner = "lunarmodules";
repo = "luafilesystem";
rev = "912e06714fc276c15b4d5d1b42bd2b11edb8deff";
hash = "sha256-BShByo2NhVrOHDPze/JXfeFWq36PFrI2HVugR2MDB0A=";
};
luajit = fetchFromGitHub {
owner = "grumpycoders";
repo = "luajit";
rev = "66fadd16a51955cfbd770de62806cfbdd7c6c818";
hash = "sha256-nFlDr79GC8MsL6ausAsEPJwL8OJrFydB37tpD5mS1C8=";
};
imgui = fetchFromGitHub {
owner = "ocornut";
repo = "imgui";
rev = "368123ab06b2b573d585e52f84cd782c5c006697";
hash = "sha256-6VOs7a31bEfAG75SQAY2X90h/f/HvqZmN615WXYkUOA=";
};
sdl-db = fetchFromGitHub {
owner = "mdqinc";
repo = "SDL_GameControllerDB";
rev = "b1e342774cbb35467dfdd3634d4f0181a76cbc89";
hash = "sha256-LYvO+chDVo6D++fuFbxqSRltGW3y82SESmtFj39TdSA=";
};
in stdenv.mkDerivation {
pname = "pcsx-redux";
version = "0.99test";
inherit src;
postUnpack = ''
rm -rf source/third_party/miniaudio
rm -rf source/third_party/zep
rm -rf source/third_party/nanosvg
rm -rf source/third_party/nanovg
rm -rf source/third_party/imgui
rm -rf source/third_party/imgui_md
rm -rf source/third_party/xbyak
rm -rf source/third_party/luafilesystem
rm -rf source/third_party/SDL_GameControllerDB
rm -rf source/third_party/tracy
rm -rf source/third_party/luajit
cp -r ${miniaudio.out} source/third_party/miniaudio
cp -r ${zep.out} source/third_party/zep
cp -r ${nanosvg.out} source/third_party/nanosvg
cp -r ${nanovg.out} source/third_party/nanovg
cp -r ${imgui.out} source/third_party/imgui
cp -r ${imgui-md.out} source/third_party/imgui_md
cp -r ${xbyak.out} source/third_party/xbyak
cp -r ${luafs.out} source/third_party/luafilesystem
cp -r ${sdl-db.out} source/third_party/SDL_GameControllerDB
cp -r ${tracy.src} source/third_party/tracy
cp -r ${luajit.out} source/third_party/luajit
chmod -R +w source/third_party/miniaudio
chmod -R +w source/third_party/zep
chmod -R +w source/third_party/nanosvg
chmod -R +w source/third_party/nanovg
chmod -R +w source/third_party/imgui
chmod -R +w source/third_party/imgui_md
chmod -R +w source/third_party/luafilesystem
chmod -R +w source/third_party/SDL_GameControllerDB
chmod -R +w source/third_party/tracy
chmod -R +w source/third_party/luajit
''
+ lib.optionalString stdenv.hostPlatform.isAarch ''
cp -r ${vixl.out} source/third_party/vixl
chmod -R +w source/third_party/vixl
'';
nativeBuildInputs = [
pkg-config
imagemagick
];
buildInputs = [
stb
ucl
md4c
luajitPackages.libluv
multipart-parser-c
fmt
magic-enum
gtest
tl-expected
elfio
libuv
tracy
curl.dev
zlib
ffmpeg.dev
glfw3
capstone
freetype.dev
uriparser
libX11
llhttp
];
makeFlags = [
"DESTDIR=$(out)"
];
# TODO: learn how to use separate debug info
dontStrip = debugBuild;
enableDebugging = debugBuild;
enableParallelBuilding = true;
NIX_BUILD_CORES = 2;
meta = {
homepage = "https://pcsx-redux.consoledev.net";
description = "PlayStation 1 emulator and debugger";
mainProgram = "pcsx-redux";
inherit platforms;
};
}