Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

duckstation: 0.1-6759 -> 0.1-7465, build with clang #365429

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion pkgs/by-name/du/duckstation/package.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
lib,
stdenv,
llvmPackages,
SDL2,
callPackage,
cmake,
cpuinfo,
cubeb,
curl,
discord-rpc,
extra-cmake-modules,
libXrandr,
libbacktrace,
Expand All @@ -16,6 +19,7 @@
qt6,
vulkan-loader,
wayland,
wayland-scanner,
}:

let
Expand All @@ -28,7 +32,7 @@ let
wrapQtAppsHook
;
in
stdenv.mkDerivation (finalAttrs: {
llvmPackages.stdenv.mkDerivation (finalAttrs: {
inherit (sources.duckstation) pname version src;

patches = [
Expand All @@ -43,11 +47,13 @@ stdenv.mkDerivation (finalAttrs: {
ninja
pkg-config
qttools
wayland-scanner
wrapQtAppsHook
];

buildInputs = [
SDL2
cpuinfo
curl
extra-cmake-modules
libXrandr
Expand All @@ -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;

Expand Down Expand Up @@ -105,6 +115,8 @@ stdenv.mkDerivation (finalAttrs: {
let
libPath = lib.makeLibraryPath (
[
sources.shaderc-patched
sources.spirv-cross-patched
vulkan-loader
]
++ cubeb.passthru.backendLibs
Expand Down
127 changes: 110 additions & 17 deletions pkgs/by-name/du/duckstation/sources.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@
fetchFromGitHub,
fetchpatch,
shaderc,
spirv-cross,
discord-rpc,
stdenv,
cmake,
ninja,
}:

{
duckstation =
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.
Expand All @@ -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
Expand All @@ -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;
};
});
}
Loading