torzu: use system libs and unbreak aarch64-linux (#377059)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
cmake,
|
||||
gtest,
|
||||
nix-update-script,
|
||||
@@ -31,6 +32,14 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
cmakeFlags = [ (lib.cmakeBool "SIMPLEINI_USE_SYSTEM_GTEST" true) ];
|
||||
|
||||
patches = [
|
||||
# Fixes for cmake export from master, can be removed after the next release
|
||||
(fetchpatch {
|
||||
url = "https://github.com/brofield/simpleini/commit/aeacf861a8ad8add5f4974792a88ffea393e41db.patch";
|
||||
hash = "sha256-lpoQHff8JwfljMUxL6Y2MqsGDZtDPjnOIKSIJ1rqrAI=";
|
||||
})
|
||||
];
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = {
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
diff --git a/src/video_core/host1x/vic.cpp b/src/video_core/host1x/vic.cpp
|
||||
index 3ad56bb80..57e6adbf8 100644
|
||||
--- a/src/video_core/host1x/vic.cpp
|
||||
+++ b/src/video_core/host1x/vic.cpp
|
||||
@@ -13,7 +13,8 @@
|
||||
#endif
|
||||
#elif defined(ARCHITECTURE_arm64)
|
||||
#pragma GCC diagnostic push
|
||||
-#pragma GCC diagnostic ignored "-Wimplicit-int-conversion"
|
||||
+#pragma GCC diagnostic ignored "-Wconversion"
|
||||
+#pragma GCC diagnostic ignored "-Wshadow"
|
||||
#include <sse2neon.h>
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
@@ -2,7 +2,6 @@
|
||||
lib,
|
||||
stdenv,
|
||||
SDL2,
|
||||
autoconf,
|
||||
boost,
|
||||
catch2_3,
|
||||
cmake,
|
||||
@@ -18,18 +17,18 @@
|
||||
glslang,
|
||||
libopus,
|
||||
libusb1,
|
||||
libva,
|
||||
lz4,
|
||||
python3,
|
||||
unzip,
|
||||
nix-update-script,
|
||||
nlohmann_json,
|
||||
nv-codec-headers-12,
|
||||
pkg-config,
|
||||
qt6,
|
||||
spirv-tools,
|
||||
spirv-headers,
|
||||
vulkan-utility-libraries,
|
||||
vulkan-headers,
|
||||
vulkan-loader,
|
||||
yasm,
|
||||
simpleini,
|
||||
zlib,
|
||||
vulkan-memory-allocator,
|
||||
@@ -99,6 +98,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
./fix-udp-protocol.patch
|
||||
# Use specific boost::asio includes and update to modern io_context
|
||||
./fix-udp-client.patch
|
||||
# Updates suppressed diagnostics
|
||||
./fix-aarch64-linux-build.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
@@ -123,15 +124,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
# intentionally omitted: dynarmic - prefer vendored version for compatibility
|
||||
enet
|
||||
|
||||
# ffmpeg deps (also includes vendored)
|
||||
# we do not use internal ffmpeg because cuda errors
|
||||
autoconf
|
||||
yasm
|
||||
libva # for accelerated video decode on non-nvidia
|
||||
nv-codec-headers-12 # for accelerated video decode on nvidia
|
||||
ffmpeg-headless
|
||||
# end ffmpeg deps
|
||||
|
||||
fmt
|
||||
# intentionally omitted: gamemode - loaded dynamically at runtime
|
||||
# intentionally omitted: httplib - upstream requires an older version than what we have
|
||||
@@ -147,7 +140,11 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
# intentionally omitted: renderdoc - heavy, developer only
|
||||
SDL2
|
||||
# intentionally omitted: stb - header only libraries, vendor uses git snapshot
|
||||
simpleini
|
||||
spirv-tools
|
||||
spirv-headers
|
||||
vulkan-memory-allocator
|
||||
vulkan-utility-libraries
|
||||
# intentionally omitted: xbyak - prefer vendored version for compatibility
|
||||
zlib
|
||||
zstd
|
||||
@@ -157,6 +154,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
# making the build fail, as that path does not exist
|
||||
dontFixCmake = true;
|
||||
|
||||
__structuredAttrs = true;
|
||||
cmakeFlags = [
|
||||
# actually has a noticeable performance impact
|
||||
(lib.cmakeBool "YUZU_ENABLE_LTO" true)
|
||||
@@ -167,13 +165,11 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
# use system libraries
|
||||
# NB: "external" here means "from the externals/ directory in the source",
|
||||
# so "off" means "use system"
|
||||
# so "false" means "use system"
|
||||
(lib.cmakeBool "YUZU_USE_EXTERNAL_SDL2" false)
|
||||
(lib.cmakeBool "YUZU_USE_EXTERNAL_VULKAN_HEADERS" true)
|
||||
"-DVulkan_INCLUDE_DIRS=${vulkan-headers}/include"
|
||||
|
||||
# # don't use system ffmpeg, suyu uses internal APIs
|
||||
# (lib.cmakeBool "YUZU_USE_BUNDLED_FFMPEG" true)
|
||||
(lib.cmakeBool "YUZU_USE_EXTERNAL_VULKAN_HEADERS" false)
|
||||
(lib.cmakeBool "YUZU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES" false)
|
||||
(lib.cmakeBool "YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS" false)
|
||||
|
||||
# don't check for missing submodules
|
||||
(lib.cmakeBool "YUZU_CHECK_SUBMODULES" false)
|
||||
@@ -186,6 +182,9 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
# We dont want to bother upstream with potentially outdated compat reports
|
||||
(lib.cmakeBool "YUZU_ENABLE_COMPATIBILITY_REPORTING" false)
|
||||
(lib.cmakeBool "ENABLE_COMPATIBILITY_LIST_DOWNLOAD" false) # We provide this deterministically
|
||||
|
||||
(lib.cmakeFeature "TITLE_BAR_FORMAT_IDLE" "${finalAttrs.pname} | ${finalAttrs.version} (nixpkgs) {}")
|
||||
(lib.cmakeFeature "TITLE_BAR_FORMAT_RUNNING" "${finalAttrs.pname} | ${finalAttrs.version} (nixpkgs) | {}")
|
||||
];
|
||||
|
||||
env = {
|
||||
@@ -199,21 +198,11 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
"--prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib"
|
||||
];
|
||||
|
||||
# Setting this through cmakeFlags does not work.
|
||||
# https://github.com/NixOS/nixpkgs/issues/114044
|
||||
preConfigure = lib.concatStringsSep "\n" [
|
||||
''
|
||||
cmakeFlagsArray+=(
|
||||
"-DTITLE_BAR_FORMAT_IDLE=${finalAttrs.pname} | ${finalAttrs.version} (nixpkgs) {}"
|
||||
"-DTITLE_BAR_FORMAT_RUNNING=${finalAttrs.pname} | ${finalAttrs.version} (nixpkgs) | {}"
|
||||
)
|
||||
''
|
||||
preConfigure = ''
|
||||
# provide pre-downloaded tz data
|
||||
''
|
||||
mkdir -p build/externals/nx_tzdb
|
||||
ln -s ${nx_tzdb} build/externals/nx_tzdb/nx_tzdb
|
||||
''
|
||||
];
|
||||
mkdir -p build/externals/nx_tzdb
|
||||
ln -s ${nx_tzdb} build/externals/nx_tzdb/nx_tzdb
|
||||
'';
|
||||
|
||||
postConfigure = ''
|
||||
ln -sf ${compat-list} ./dist/compatibility_list/compatibility_list.json
|
||||
@@ -228,10 +217,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
homepage = "https://notabug.org/litucks/torzu";
|
||||
mainProgram = "yuzu";
|
||||
platforms = lib.platforms.linux;
|
||||
badPlatforms = [
|
||||
# Several conversion errors, probably caused by the update to GCC 14
|
||||
"aarch64-linux"
|
||||
];
|
||||
maintainers = with lib.maintainers; [ liberodark ];
|
||||
license = with lib.licenses; [
|
||||
gpl3Plus
|
||||
|
||||
Reference in New Issue
Block a user