torzu: use system libs and unbreak aarch64-linux (#377059)

authored by Peder Bergebakken Sundt and committed by GitHub e2199038 d574c98b

+44 -36
+9
pkgs/by-name/si/simpleini/package.nix
··· 2 2 lib, 3 3 stdenv, 4 4 fetchFromGitHub, 5 + fetchpatch, 5 6 cmake, 6 7 gtest, 7 8 nix-update-script, ··· 30 31 strictDeps = true; 31 32 32 33 cmakeFlags = [ (lib.cmakeBool "SIMPLEINI_USE_SYSTEM_GTEST" true) ]; 34 + 35 + patches = [ 36 + # Fixes for cmake export from master, can be removed after the next release 37 + (fetchpatch { 38 + url = "https://github.com/brofield/simpleini/commit/aeacf861a8ad8add5f4974792a88ffea393e41db.patch"; 39 + hash = "sha256-lpoQHff8JwfljMUxL6Y2MqsGDZtDPjnOIKSIJ1rqrAI="; 40 + }) 41 + ]; 33 42 34 43 passthru.updateScript = nix-update-script { }; 35 44
+14
pkgs/by-name/to/torzu/fix-aarch64-linux-build.patch
··· 1 + diff --git a/src/video_core/host1x/vic.cpp b/src/video_core/host1x/vic.cpp 2 + index 3ad56bb80..57e6adbf8 100644 3 + --- a/src/video_core/host1x/vic.cpp 4 + +++ b/src/video_core/host1x/vic.cpp 5 + @@ -13,7 +13,8 @@ 6 + #endif 7 + #elif defined(ARCHITECTURE_arm64) 8 + #pragma GCC diagnostic push 9 + -#pragma GCC diagnostic ignored "-Wimplicit-int-conversion" 10 + +#pragma GCC diagnostic ignored "-Wconversion" 11 + +#pragma GCC diagnostic ignored "-Wshadow" 12 + #include <sse2neon.h> 13 + #pragma GCC diagnostic pop 14 + #endif
+21 -36
pkgs/by-name/to/torzu/package.nix
··· 2 2 lib, 3 3 stdenv, 4 4 SDL2, 5 - autoconf, 6 5 boost, 7 6 catch2_3, 8 7 cmake, ··· 18 17 glslang, 19 18 libopus, 20 19 libusb1, 21 - libva, 22 20 lz4, 23 21 python3, 24 22 unzip, 25 23 nix-update-script, 26 24 nlohmann_json, 27 - nv-codec-headers-12, 28 25 pkg-config, 29 26 qt6, 27 + spirv-tools, 28 + spirv-headers, 29 + vulkan-utility-libraries, 30 30 vulkan-headers, 31 31 vulkan-loader, 32 - yasm, 33 32 simpleini, 34 33 zlib, 35 34 vulkan-memory-allocator, ··· 99 98 ./fix-udp-protocol.patch 100 99 # Use specific boost::asio includes and update to modern io_context 101 100 ./fix-udp-client.patch 101 + # Updates suppressed diagnostics 102 + ./fix-aarch64-linux-build.patch 102 103 ]; 103 104 104 105 nativeBuildInputs = [ ··· 123 124 # intentionally omitted: dynarmic - prefer vendored version for compatibility 124 125 enet 125 126 126 - # ffmpeg deps (also includes vendored) 127 - # we do not use internal ffmpeg because cuda errors 128 - autoconf 129 - yasm 130 - libva # for accelerated video decode on non-nvidia 131 - nv-codec-headers-12 # for accelerated video decode on nvidia 132 127 ffmpeg-headless 133 - # end ffmpeg deps 134 - 135 128 fmt 136 129 # intentionally omitted: gamemode - loaded dynamically at runtime 137 130 # intentionally omitted: httplib - upstream requires an older version than what we have ··· 147 140 # intentionally omitted: renderdoc - heavy, developer only 148 141 SDL2 149 142 # intentionally omitted: stb - header only libraries, vendor uses git snapshot 143 + simpleini 144 + spirv-tools 145 + spirv-headers 150 146 vulkan-memory-allocator 147 + vulkan-utility-libraries 151 148 # intentionally omitted: xbyak - prefer vendored version for compatibility 152 149 zlib 153 150 zstd ··· 157 154 # making the build fail, as that path does not exist 158 155 dontFixCmake = true; 159 156 157 + __structuredAttrs = true; 160 158 cmakeFlags = [ 161 159 # actually has a noticeable performance impact 162 160 (lib.cmakeBool "YUZU_ENABLE_LTO" true) ··· 167 165 168 166 # use system libraries 169 167 # NB: "external" here means "from the externals/ directory in the source", 170 - # so "off" means "use system" 168 + # so "false" means "use system" 171 169 (lib.cmakeBool "YUZU_USE_EXTERNAL_SDL2" false) 172 - (lib.cmakeBool "YUZU_USE_EXTERNAL_VULKAN_HEADERS" true) 173 - "-DVulkan_INCLUDE_DIRS=${vulkan-headers}/include" 174 - 175 - # # don't use system ffmpeg, suyu uses internal APIs 176 - # (lib.cmakeBool "YUZU_USE_BUNDLED_FFMPEG" true) 170 + (lib.cmakeBool "YUZU_USE_EXTERNAL_VULKAN_HEADERS" false) 171 + (lib.cmakeBool "YUZU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES" false) 172 + (lib.cmakeBool "YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS" false) 177 173 178 174 # don't check for missing submodules 179 175 (lib.cmakeBool "YUZU_CHECK_SUBMODULES" false) ··· 186 182 # We dont want to bother upstream with potentially outdated compat reports 187 183 (lib.cmakeBool "YUZU_ENABLE_COMPATIBILITY_REPORTING" false) 188 184 (lib.cmakeBool "ENABLE_COMPATIBILITY_LIST_DOWNLOAD" false) # We provide this deterministically 185 + 186 + (lib.cmakeFeature "TITLE_BAR_FORMAT_IDLE" "${finalAttrs.pname} | ${finalAttrs.version} (nixpkgs) {}") 187 + (lib.cmakeFeature "TITLE_BAR_FORMAT_RUNNING" "${finalAttrs.pname} | ${finalAttrs.version} (nixpkgs) | {}") 189 188 ]; 190 189 191 190 env = { ··· 199 198 "--prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib" 200 199 ]; 201 200 202 - # Setting this through cmakeFlags does not work. 203 - # https://github.com/NixOS/nixpkgs/issues/114044 204 - preConfigure = lib.concatStringsSep "\n" [ 205 - '' 206 - cmakeFlagsArray+=( 207 - "-DTITLE_BAR_FORMAT_IDLE=${finalAttrs.pname} | ${finalAttrs.version} (nixpkgs) {}" 208 - "-DTITLE_BAR_FORMAT_RUNNING=${finalAttrs.pname} | ${finalAttrs.version} (nixpkgs) | {}" 209 - ) 210 - '' 201 + preConfigure = '' 211 202 # provide pre-downloaded tz data 212 - '' 213 - mkdir -p build/externals/nx_tzdb 214 - ln -s ${nx_tzdb} build/externals/nx_tzdb/nx_tzdb 215 - '' 216 - ]; 203 + mkdir -p build/externals/nx_tzdb 204 + ln -s ${nx_tzdb} build/externals/nx_tzdb/nx_tzdb 205 + ''; 217 206 218 207 postConfigure = '' 219 208 ln -sf ${compat-list} ./dist/compatibility_list/compatibility_list.json ··· 228 217 homepage = "https://notabug.org/litucks/torzu"; 229 218 mainProgram = "yuzu"; 230 219 platforms = lib.platforms.linux; 231 - badPlatforms = [ 232 - # Several conversion errors, probably caused by the update to GCC 14 233 - "aarch64-linux" 234 - ]; 235 220 maintainers = with lib.maintainers; [ liberodark ]; 236 221 license = with lib.licenses; [ 237 222 gpl3Plus