diff --git a/pkgs/by-name/du/duckstation/package.nix b/pkgs/by-name/du/duckstation/package.nix index f65be766b7c6f..65ddc92ea2ded 100644 --- a/pkgs/by-name/du/duckstation/package.nix +++ b/pkgs/by-name/du/duckstation/package.nix @@ -1,11 +1,14 @@ { lib, stdenv, + llvmPackages, SDL2, callPackage, cmake, + cpuinfo, cubeb, curl, + discord-rpc, extra-cmake-modules, libXrandr, libbacktrace, @@ -16,6 +19,7 @@ qt6, vulkan-loader, wayland, + wayland-scanner, }: let @@ -28,7 +32,7 @@ let wrapQtAppsHook ; in -stdenv.mkDerivation (finalAttrs: { +llvmPackages.stdenv.mkDerivation (finalAttrs: { inherit (sources.duckstation) pname version src; patches = [ @@ -43,11 +47,13 @@ stdenv.mkDerivation (finalAttrs: { ninja pkg-config qttools + wayland-scanner wrapQtAppsHook ]; buildInputs = [ SDL2 + cpuinfo curl extra-cmake-modules libXrandr @@ -56,7 +62,11 @@ stdenv.mkDerivation (finalAttrs: { qtbase qtsvg qtwayland + sources.discord-rpc-patched + sources.lunasvg sources.shaderc-patched + sources.soundtouch-patched + sources.spirv-cross-patched wayland ] ++ cubeb.passthru.backendLibs; @@ -105,6 +115,8 @@ stdenv.mkDerivation (finalAttrs: { let libPath = lib.makeLibraryPath ( [ + sources.shaderc-patched + sources.spirv-cross-patched vulkan-loader ] ++ cubeb.passthru.backendLibs diff --git a/pkgs/by-name/du/duckstation/sources.nix b/pkgs/by-name/du/duckstation/sources.nix index 3978dcbf7de64..701499ea28f6b 100644 --- a/pkgs/by-name/du/duckstation/sources.nix +++ b/pkgs/by-name/du/duckstation/sources.nix @@ -4,6 +4,11 @@ fetchFromGitHub, fetchpatch, shaderc, + spirv-cross, + discord-rpc, + stdenv, + cmake, + ninja, }: { @@ -11,11 +16,11 @@ let self = { pname = "duckstation"; - version = "0.1-6759"; + version = "0.1-7465"; src = fetchFromGitHub { owner = "stenzek"; repo = "duckstation"; - rev = "refs/tags/v${self.version}"; + rev = "aa955b8ae28314ae061613f0ddf13183a98aca03"; # # Some files are filled by using Git commands; it requires deepClone. # More info at `checkout_ref` function in nix-prefetch-git. @@ -37,7 +42,7 @@ git log -1 --date=iso8601-strict --format=%cd > .nixpkgs-auxfiles/git_date find $out -name .git -print0 | xargs -0 rm -fr ''; - hash = "sha256-HETo7mChBASnr5prPUWcOhS4TIESFdrs1haEXQpnuzs="; + hash = "sha256-ixrlr7Rm6GZAn/kh2sSeCCiK/qdmQ5+5jbbhAKjTx/E="; }; }; in @@ -46,28 +51,116 @@ shaderc-patched = shaderc.overrideAttrs ( old: let - version = "2024.0"; + version = "2024.3-unstable-2024-08-24"; src = fetchFromGitHub { - owner = "google"; + owner = "stenzek"; repo = "shaderc"; - rev = "v${version}"; - hash = "sha256-Cwp7WbaKWw/wL9m70wfYu47xoUGQW+QGeoYhbyyzstQ="; + rev = "f60bb80e255144e71776e2ad570d89b78ea2ab4f"; + hash = "sha256-puZxkrEVhhUT4UcCtEDmtOMX4ugkB6ooMhKRBlb++lE="; }; in { pname = "shaderc-patched-for-duckstation"; inherit version src; - patches = (old.patches or [ ]) ++ [ - (fetchpatch { - url = "file://${duckstation.src}/scripts/shaderc-changes.patch"; - hash = "sha256-Ps/D+CdSbjVWg3ZGOEcgbpQbCNkI5Nuizm4E5qiM9Wo="; - excludes = [ - "CHANGES" - "CMakeLists.txt" - "libshaderc/CMakeLists.txt" - ]; - }) + patches = (old.patches or [ ]); + cmakeFlags = (old.cmakeFlags or [ ]) ++ [ + (lib.cmakeBool "SHADERC_SKIP_EXAMPLES" true) + (lib.cmakeBool "SHADERC_SKIP_TESTS" true) + ]; + outputs = [ + "out" + "lib" + "dev" + ]; + postFixup = ''''; + } + ); + spirv-cross-patched = spirv-cross.overrideAttrs ( + old: + let + version = "1.3.290.0"; + src = fetchFromGitHub { + owner = "KhronosGroup"; + repo = "SPIRV-Cross"; + rev = "vulkan-sdk-${version}"; + hash = "sha256-h5My9PbPq1l03xpXQQFolNy7G1RhExtTH6qPg7vVF/8="; + }; + in + { + pname = "spirv-cross-patched-for-duckstation"; + inherit version src; + patches = (old.patches or [ ]); + cmakeFlags = (old.cmakeFlags or [ ]) ++ [ + (lib.cmakeBool "SPIRV_CROSS_CLI" false) + (lib.cmakeBool "SPIRV_CROSS_ENABLE_CPP" false) + (lib.cmakeBool "SPIRV_CROSS_ENABLE_C_API" true) + (lib.cmakeBool "SPIRV_CROSS_ENABLE_GLSL" true) + (lib.cmakeBool "SPIRV_CROSS_ENABLE_HLSL" false) + (lib.cmakeBool "SPIRV_CROSS_ENABLE_MSL" false) + (lib.cmakeBool "SPIRV_CROSS_ENABLE_REFLECT" false) + (lib.cmakeBool "SPIRV_CROSS_ENABLE_TESTS" false) + (lib.cmakeBool "SPIRV_CROSS_ENABLE_UTIL" true) + (lib.cmakeBool "SPIRV_CROSS_SHARED" true) + (lib.cmakeBool "SPIRV_CROSS_STATIC" false) ]; } ); + discord-rpc-patched = discord-rpc.overrideAttrs (old: { + pname = "discord-rpc-patched-for-duckstation"; + version = "3.4.0-unstable-2024-08-02"; + src = fetchFromGitHub { + owner = "stenzek"; + repo = "discord-rpc"; + rev = "144f3a3f1209994d8d9e8a87964a989cb9911c1e"; + hash = "sha256-VyL8bEjY001eHWcEoUPIAFDAmaAbwcNb1hqlV2a3cWs="; + }; + patches = (old.patches or [ ]); + }); + + soundtouch-patched = stdenv.mkDerivation (finalAttrs: { + pname = "soundtouch-patched-for-duckstation"; + version = "2.2.3-unstable-2024-08-02"; + src = fetchFromGitHub { + owner = "stenzek"; + repo = "soundtouch"; + rev = "463ade388f3a51da078dc9ed062bf28e4ba29da7"; + hash = "sha256-hvBW/z+fmh/itNsJnlDBtiI1DZmUMO9TpHEztjo2pA0="; + }; + + nativeBuildInputs = [ + cmake + ninja + ]; + + meta = { + homepage = "https://github.com/stenzek/soundtouch"; + description = "SoundTouch Audio Processing Library (forked from https://codeberg.org/soundtouch/soundtouch)"; + license = lib.licenses.lgpl21; + platforms = lib.platforms.linux; + }; + + }); + + lunasvg = stdenv.mkDerivation (finalAttrs: { + pname = "lunasvg-patched-for-duckstation"; + version = "2.4.1-unstable-2024-08-24"; + src = fetchFromGitHub { + owner = "stenzek"; + repo = "lunasvg"; + rev = "9af1ac7b90658a279b372add52d6f77a4ebb482c"; + hash = "sha256-ZzOe84ZF5JRrJ9Lev2lwYOccqtEGcf76dyCDBDTvI2o="; + }; + + nativeBuildInputs = [ + cmake + ninja + ]; + + meta = { + homepage = "https://github.com/stenzek/lunasvg"; + description = "lunasvg is a standalone SVG rendering library in C++"; + license = lib.licenses.mit; + platforms = lib.platforms.linux; + }; + }); }