-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsuyu.nix
134 lines (121 loc) · 2.98 KB
/
suyu.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
{ nx_tzdb, pname, src, version
, lib
, stdenv
, makeWrapper
, cmake
, pkg-config
, glslang
, wrapQtAppsHook
, qttools
, vulkan-loader
, vulkan-headers
, vulkan-utility-libraries
, boost
, catch2_3
, cpp-jwt
, cubeb
, discord-rpc
, enet
, autoconf
, yasm
, libva
, nv-codec-headers-12
, ffmpeg-headless
, fmt
, libopus
, libusb1
, lz4
, nlohmann_json
, qtbase
, qtmultimedia
, qtwayland
, qtwebengine
, SDL2
, zlib
, zstd
, ...
}:
stdenv.mkDerivation {
inherit src pname version;
nativeBuildInputs = [
cmake
pkg-config
glslang
wrapQtAppsHook
makeWrapper
qttools
];
buildInputs = [
# vulkan-headers must come first, so the older propagated versions
# don't get picked up by accident
vulkan-headers
vulkan-utility-libraries
boost
catch2_3
cpp-jwt
cubeb
discord-rpc
# intentionally omitted: dynarmic - prefer vendored version for compatibility
enet
# vendored ffmpeg deps
autoconf
yasm
libva
nv-codec-headers-12
ffmpeg-headless
fmt
# intentionally omitted: gamemode - loaded dynamically at runtime
# intentionally omitted: httplib - upstream requires an older version than what we have
libopus
libusb1
# intentionally omitted: LLVM - heavy, only used for stack traces in the debugger
lz4
nlohmann_json
qtmultimedia
qtwayland
qtwebengine
# intentionally omitted: renderdoc - heavy, developer only
SDL2
# not packaged in nixpkgs: simpleini
# intentionally omitted: stb - header only libraries, vendor uses git snapshot
# not packaged in nixpkgs: vulkan-memory-allocator
# intentionally omitted: xbyak - prefer vendored version for compatibility
zlib
zstd
];
dontFixCmake = true;
cmakeFlags = [
# actually has a noticeable performance impact
"-DSUYU_ENABLE_LTO=ON"
# build with qt6
"-DENABLE_QT6=ON"
"-DENABLE_QT_TRANSLATION=ON"
# use system libraries
"-DSUYU_USE_EXTERNAL_SDL2=OFF"
"-DSUYU_USE_EXTERNAL_VULKAN_HEADERS=OFF"
"-DSUYU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES=OFF"
#"-DSUYU_USE_BUNDLED_FFMPEG=ON"
# don't check for missing submodules
"-DSUYU_CHECK_SUBMODULES=OFF"
# enable some optional features
"-DSUYU_USE_QT_WEB_ENGINE=ON"
"-DSUYU_USE_QT_MULTIMEDIA=ON"
"-DUSE_DISCORD_PRESENCE=ON"
# We dont want to bother upstream with potentially outdated compat reports
"-DSUYU_ENABLE_COMPATIBILITY_REPORTING=OFF"
"-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF" # We provide this deterministically
];
qtWrapperArgs = [
"--prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib"
];
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isx86_64 "-msse4.1";
# In the original, we changed the title bar. I decided to keep
# it at its default
preConfigure = ''
mkdir -p build/externals/nx_tzdb
ln -s ${nx_tzdb} build/externals/nx_tzdb/nx_tzdb
'';
postInstall = ''
install -Dm444 $src/dist/72-suyu-input.rules $out/lib/udev/rules.d/72-suyu-input.rules
'';
}