Skip to content

Commit

Permalink
duckstation: 0.1-6292 -> 0.1-6658
Browse files Browse the repository at this point in the history
Now with a patched shaderc.

Co-authored-by: qubitnano <146656568+qubitnano@users.noreply.github.com>
  • Loading branch information
AndersonTorres and qubitnano committed May 15, 2024
1 parent e90f650 commit 7cc72bc
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 22 deletions.
48 changes: 26 additions & 22 deletions pkgs/by-name/du/duckstation/package.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
lib,
SDL2,
callPackage,
cmake,
cubeb,
curl,
extra-cmake-modules,
fetchFromGitHub,
libXrandr,
libbacktrace,
libwebp,
makeWrapper,
ninja,
pkg-config,
Expand All @@ -17,8 +19,8 @@
vulkan-loader,
wayland,
}:

let
shaderc-patched = callPackage ./shaderc-patched.nix { };
inherit (qt6)
qtbase
qtsvg
Expand All @@ -29,13 +31,13 @@ let
in
stdenv.mkDerivation (finalAttrs: {
pname = "duckstation";
version = "0.1-6292";
version = "0.1-6658";

src = fetchFromGitHub {
owner = "stenzek";
repo = "duckstation";
rev = "0bc42c38aab49030118f507c9783de047769148b";
hash = "sha256-8OavixSwEWihFY2fEdsepR1lqWlTH+//xZRKwb7lFCQ=";
rev = "4e0c417add264226b3db065c1466791f0591a1b5";
hash = "sha256-fN0bcjqjMmK3qVLlrYmR2VgjK0BjdK4nUj8vNYdFC3I=";
};

patches = [
Expand All @@ -46,8 +48,8 @@ stdenv.mkDerivation (finalAttrs: {
src = ./002-hardcode-vars.diff;
gitHash = finalAttrs.src.rev;
gitBranch = "master";
gitTag = "${finalAttrs.version}-g0bc42c38";
gitDate = "2024-02-06T22:47:47+09:00";
gitTag = "${finalAttrs.version}-g4e0c417a";
gitDate = "2024-04-16T12:49:54+10:00";
})
];

Expand All @@ -66,9 +68,11 @@ stdenv.mkDerivation (finalAttrs: {
extra-cmake-modules
libXrandr
libbacktrace
libwebp
qtbase
qtsvg
qtwayland
shaderc-patched
wayland
]
++ cubeb.passthru.backendLibs;
Expand All @@ -77,18 +81,19 @@ stdenv.mkDerivation (finalAttrs: {
(lib.cmakeBool "BUILD_TESTS" true)
];

qtWrapperArgs =
let
libPath = lib.makeLibraryPath ([
vulkan-loader
] ++ cubeb.passthru.backendLibs);
in [
"--prefix LD_LIBRARY_PATH : ${libPath}"
];

strictDeps = true;

doInstallCheck = true;

installCheckPhase = ''
runHook preInstallCheck
$out/share/duckstation/common-tests
runHook postInstallCheck
'';

installPhase = ''
runHook preInstall
Expand All @@ -103,14 +108,13 @@ stdenv.mkDerivation (finalAttrs: {
runHook postInstall
'';

qtWrapperArgs =
let
libPath = lib.makeLibraryPath ([
vulkan-loader
] ++ cubeb.passthru.backendLibs);
in [
"--prefix LD_LIBRARY_PATH : ${libPath}"
];
installCheckPhase = ''
runHook preInstallCheck
$out/share/duckstation/common-tests
runHook postInstallCheck
'';

# https://github.com/stenzek/duckstation/blob/master/scripts/appimage/apprun-hooks/default-to-x11.sh
# Can't avoid the double wrapping, the binary wrapper from qtWrapperArgs doesn't support --run
Expand Down
21 changes: 21 additions & 0 deletions pkgs/by-name/du/duckstation/shaderc-patched.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
lib,
fetchpatch,
duckstation,
shaderc,
}:

shaderc.overrideAttrs (old: {
pname = "shaderc-patched-for-duckstation";
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"
];
})
];
})

0 comments on commit 7cc72bc

Please sign in to comment.