duckstation: drop

This commit is contained in:
Sigmanificient
2026-03-16 14:00:34 +01:00
parent 3427cd589c
commit 9293ccd2ff
7 changed files with 3 additions and 487 deletions
+2
View File
@@ -95,6 +95,8 @@
- `spoof` has been removed, as there are many issues upstream with it working on modern OS versions, and it appears to be unmaintained.
- `duckstation` package has been removed, as it was requested by upstream and build source were changed to be incompatible with NixOS.
- `nodePackages.coc-go` and `nodePackages.coc-tsserver`, along with their vim plugins, have been removed from nixpkgs due to being unmaintained.
- `nodePackages.wavedrom-cli` has been removed, as it was unmaintained within nixpkgs.
@@ -1,33 +0,0 @@
diff --git a/dep/CMakeLists.txt b/dep/CMakeLists.txt
index 633267c66..b5ab0904c 100644
--- a/dep/CMakeLists.txt
+++ b/dep/CMakeLists.txt
@@ -25,9 +25,8 @@ add_subdirectory(rcheevos EXCLUDE_FROM_ALL)
disable_compiler_warnings_for_target(rcheevos)
add_subdirectory(rapidyaml EXCLUDE_FROM_ALL)
disable_compiler_warnings_for_target(rapidyaml)
-add_subdirectory(cubeb EXCLUDE_FROM_ALL)
-disable_compiler_warnings_for_target(cubeb)
-disable_compiler_warnings_for_target(speex)
+find_package(cubeb REQUIRED GLOBAL)
+add_library(cubeb ALIAS cubeb::cubeb)
if(ENABLE_OPENGL)
add_subdirectory(glad EXCLUDE_FROM_ALL)
diff --git a/src/util/cubeb_audio_stream.cpp b/src/util/cubeb_audio_stream.cpp
index 52c7299c9..e20b52426 100644
--- a/src/util/cubeb_audio_stream.cpp
+++ b/src/util/cubeb_audio_stream.cpp
@@ -262,9 +262,9 @@ std::vector<std::pair<std::string, std::string>> AudioStream::GetCubebDriverName
std::vector<std::pair<std::string, std::string>> names;
names.emplace_back(std::string(), TRANSLATE_STR("AudioStream", "Default"));
- const char** cubeb_names = cubeb_get_backend_names();
- for (u32 i = 0; cubeb_names[i] != nullptr; i++)
- names.emplace_back(cubeb_names[i], cubeb_names[i]);
+ cubeb_backend_names backends = cubeb_get_backend_names();
+ for (u32 i = 0; i < backends.count; i++)
+ names.emplace_back(backends.names[i], backends.names[i]);
return names;
}
@@ -1,20 +0,0 @@
diff --git a/src/scmversion/gen_scmversion.sh b/src/scmversion/gen_scmversion.sh
index 0f8fa4239..2cc91a4a8 100755
--- a/src/scmversion/gen_scmversion.sh
+++ b/src/scmversion/gen_scmversion.sh
@@ -10,11 +10,11 @@ else
fi
-HASH=$(git rev-parse HEAD)
-BRANCH=$(git rev-parse --abbrev-ref HEAD | tr -d '\r\n')
-TAG=$(git describe --dirty | tr -d '\r\n')
+HASH="@gitHash@"
+BRANCH="@gitBranch@"
+TAG="@gitTag@"
VERSION=$(echo "${TAG}" | sed -E 's/-g[0-9a-f]+//')
-DATE=$(git log -1 --date=iso8601-strict --format=%cd)
+DATE="@gitDate@"
cd $CURDIR
-340
View File
@@ -1,340 +0,0 @@
{
lib,
llvmPackages,
stdenvNoCC,
fetchFromGitHub,
cmake,
pkg-config,
ninja,
extra-cmake-modules,
wayland-scanner,
qt6,
sdl3,
zstd,
libwebp,
zlib,
libpng,
libjpeg,
freetype,
plutosvg,
cpuinfo,
soundtouch,
rapidjson,
libzip,
curl,
libx11,
wayland,
shaderc,
spirv-cross,
udev,
libbacktrace,
ffmpeg-headless,
cubeb,
fetchurl,
zip,
unzip,
}:
let
passthru = {
updateScript = ./update.sh;
};
meta = {
description = "Fast PlayStation 1 emulator for x86-64/AArch32/AArch64/RV64";
longDescription = ''
DISCLAIMER: This is an **unofficial** package, do not report any
issues to duckstation developers. Instead, please report them to
<https://github.com/NixOS/nixpkgs> or use the officially
supported platform build at <https://duckstation.org> or other
upstream-approved distribution mechanism not listed here.
'';
homepage = "https://duckstation.org";
license = lib.licenses.cc-by-nc-nd-40;
maintainers = [ ];
};
pkgSources = lib.importJSON ./sources.json;
linuxDrv = llvmPackages.stdenv.mkDerivation (finalAttrs: {
pname = "duckstation";
version = "0.1-10413";
src = fetchFromGitHub {
owner = "stenzek";
repo = "duckstation";
tag = "v${finalAttrs.version}";
deepClone = true;
hash = "sha256-ytJ0vaXXbbgSmZ42gQPlQY7p30hz7hx/+09TSvCKyEg=";
postFetch = ''
cd $out
mkdir -p .nixpkgs-auxfiles/
git rev-parse HEAD > .nixpkgs-auxfiles/git_hash
git rev-parse --abbrev-ref HEAD | tr -d '\r\n' > .nixpkgs-auxfiles/git_branch
git describe | tr -d '\r\n' > .nixpkgs-auxfiles/git_tag
git log -1 --date=iso8601-strict --format=%cd > .nixpkgs-auxfiles/git_date
rm -rf .git
'';
};
patches = [
./cubeb-remove-vendor.patch
./git-version-info.patch
];
postPatch =
# Fixes compilation error with nixpkgs libapng
''
substituteInPlace src/util/animated_image.cpp \
--replace-fail "png_write_frame_head(png_ptr, info_ptr," \
"png_write_frame_head(png_ptr, info_ptr, 0,"
''
# Fills in git-info obtained in the `postFetch` step for version
# information in the UI
+ ''
gitHash=$(cat .nixpkgs-auxfiles/git_hash) \
gitBranch=$(cat .nixpkgs-auxfiles/git_branch) \
gitTag=$(cat .nixpkgs-auxfiles/git_tag) \
gitDate=$(cat .nixpkgs-auxfiles/git_date) \
substituteAllInPlace src/scmversion/gen_scmversion.sh
'';
vendorDiscordRPC = llvmPackages.stdenv.mkDerivation {
pname = "discord-rpc-duckstation";
inherit (finalAttrs) version;
src = fetchFromGitHub {
owner = "stenzek";
repo = "discord-rpc";
inherit (pkgSources.discord_rpc) rev hash;
};
nativeBuildInputs = [ cmake ];
buildInputs = [ rapidjson ];
meta = {
license = lib.licenses.mit;
platforms = lib.platforms.linux;
};
};
vendorShaderc = shaderc.overrideAttrs (oldAttrs: {
pname = "shaderc-duckstation";
inherit (finalAttrs) version;
src = fetchFromGitHub {
owner = "stenzek";
repo = "shaderc";
inherit (pkgSources.shaderc) rev hash;
};
patches = (oldAttrs.patches or [ ]);
cmakeFlags = (oldAttrs.cmakeFlags or [ ]) ++ [
(lib.cmakeBool "SHADERC_SKIP_EXAMPLES" true)
(lib.cmakeBool "SHADERC_SKIP_TESTS" true)
];
outputs = [
"out"
"lib"
"dev"
];
postFixup = null;
});
soundtouch = llvmPackages.stdenv.mkDerivation {
inherit (soundtouch)
pname
version
src
meta
;
nativeBuildInputs = [ cmake ];
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace-fail "\''${prefix}/''${CMAKE_INSTALL_LIBDIR}" \
"''${CMAKE_INSTALL_FULL_LIBDIR}"
'';
cmakeFlags = [
(lib.cmakeBool "SOUNDTOUCH_DLL" true)
];
};
chtdb = stdenvNoCC.mkDerivation {
pname = "chtdb-duckstation";
version = "0-unstable-${pkgSources.chtdb.date}";
src = fetchFromGitHub {
owner = "duckstation";
repo = "chtdb";
inherit (pkgSources.chtdb) rev hash;
};
nativeBuildInputs = [
zip
];
buildPhase = ''
runHook preBuild
pushd cheats
zip -r cheats.zip *.cht
popd
pushd patches
zip -r patches.zip *.cht
popd
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dm644 cheats/cheats.zip -t $out/lib/duckstation
install -Dm644 patches/patches.zip -t $out/lib/duckstation
install -Dm644 LICENSE -t $out/share/doc/duckstation
install -Dm644 README.md -t $out/share/doc/duckstation
runHook postInstall
'';
meta = {
description = "Collection of cheats and patches for PSX games";
longDescription = ''
Collection of cheats and patches for PSX games, primarily intended for
use with the DuckStation emulator, but can also be used by other
emulators that support GameShark codes.
Patches show in the UI in a separate section to cheats, and are
intended for modifications to the game that do not provide any
"advantage" to the player, including:
- Improving performance.
- Fixing game-breaking bugs.
- Unlocking the frame rate (e.g. "60 FPS patches").
- Widescreen rendering where the built-in widescreen
rendering rendering is insufficient.
'';
license = lib.licenses.mit;
inherit (meta) maintainers;
platforms = lib.platforms.all;
};
};
preConfigure = ''
cp ${finalAttrs.chtdb}/lib/duckstation/cheats.zip data/resources
cp ${finalAttrs.chtdb}/lib/duckstation/patches.zip data/resources
'';
nativeBuildInputs = [
cmake
pkg-config
ninja
extra-cmake-modules
wayland-scanner
qt6.wrapQtAppsHook
qt6.qttools
];
buildInputs = [
sdl3
zstd
libwebp
zlib
libpng
libjpeg
freetype
plutosvg
cpuinfo
libzip
curl
libx11
wayland
spirv-cross
qt6.qtbase
udev
libbacktrace
ffmpeg-headless
cubeb
]
++ [
finalAttrs.vendorDiscordRPC
finalAttrs.vendorShaderc
finalAttrs.soundtouch
];
installPhase = ''
runHook preInstall
mkdir -p $out/{lib,bin,share/{applications,icons/hicolor/512x512/apps}}
cp -r bin $out/lib/duckstation
ln -s $out/lib/duckstation/duckstation-qt $out/bin/duckstation-qt
pushd ..
install -Dm644 scripts/packaging/org.duckstation.DuckStation.desktop \
-t $out/share/applications
install -Dm644 scripts/packaging/org.duckstation.DuckStation.png \
-t $out/share/icons/hicolor/512x512/apps
install -Dm644 LICENSE -t $out/share/doc/duckstation
install -Dm644 README.* -t $out/share/doc/duckstation
install -Dm644 CONTRIBUTORS.md -t $out/share/doc/duckstation
popd
runHook postInstall
'';
qtWrapperArgs = [
"--prefix LD_LIBRARY_PATH : ${
(lib.makeLibraryPath [
ffmpeg-headless
finalAttrs.vendorShaderc
])
}"
];
inherit passthru;
meta = meta // {
mainProgram = "duckstation-qt";
platforms = lib.platforms.linux;
};
});
darwinDrv = stdenvNoCC.mkDerivation (finalAttrs: {
pname = "duckstation";
version = pkgSources.duckstation.version;
src = fetchurl {
url = "https://github.com/stenzek/duckstation/releases/download/v${finalAttrs.version}/duckstation-mac-release.zip";
hash = pkgSources.duckstation.hash_darwin;
};
nativeBuildInputs = [ unzip ];
dontPatch = true;
dontConfigure = true;
dontBuild = true;
sourceRoot = ".";
installPhase = ''
runHook preInstall
mkdir -p $out/Applications
cp -r DuckStation.app $out/Applications/DuckStation.app
runHook postInstall
'';
inherit passthru;
meta = meta // {
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
platforms = lib.platforms.darwin;
};
});
in
if stdenvNoCC.hostPlatform.isLinux then
linuxDrv
else if stdenvNoCC.hostPlatform.isDarwin then
darwinDrv
else
throw "duckstation is not supported on ${stdenvNoCC.hostPlatform.system}."
-19
View File
@@ -1,19 +0,0 @@
{
"duckstation": {
"version": "0.1-10413",
"hash_darwin": "sha256-TGXLpbTFkrFQ42LpRx0TKBsbdIRuYtseR+v3W/t9M10="
},
"discord_rpc": {
"rev": "cc59d26d1d628fbd6527aac0ac1d6301f4978b92",
"hash": "sha256-8xXcx5w36eiJqtWm6qQfhEHgchVJbhP/jR94eMNNjHU="
},
"shaderc": {
"rev": "85cd26cc38e3e8b5e3c649f4551900ee330d6552",
"hash": "sha256-7PVrpS69pI5mi4aM1eNTAzZCMq6vuVl3mhTrc4U942w="
},
"chtdb": {
"date": "2025-12-31",
"rev": "696e985e027d8d43a84c65bd349802dfe0944674",
"hash": "sha256-4t0x0YYp7rURBqVWyMZpnOATpIYoILQagyMASaSWKWM="
}
}
-75
View File
@@ -1,75 +0,0 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p coreutils nix nix-update curl jq
# shellcheck shell=bash
set -euo pipefail
location="$(dirname "${BASH_SOURCE[0]}")"
echo "checking for new tagged release (github:stenzek/duckstation)..."
old_version=$(nix --extra-experimental-features nix-command eval --raw -f . duckstation.src.tag)
new_version=$(curl ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} "https://api.github.com/repos/stenzek/duckstation/tags?per_page=1" | jq -r '.[0].name')
if [[ $old_version == "$new_version" ]]; then
echo "'duckstation' is up-to-date ($old_version == $new_version)"
exit 0
fi
echo "Updating duckstation from $old_version -> $new_version"
nix-update --src-only --version "$new_version" duckstation
duckstation_darwin_hash=$(nix-hash --to-sri --type sha256 "$(nix-prefetch-url --type sha256 "https://github.com/stenzek/duckstation/releases/download/${new_version}/duckstation-mac-release.zip")")
echo "Vendor library update..."
duckstation_storepath=$(nix --extra-experimental-features "nix-command flakes" flake prefetch github:stenzek/duckstation/"$new_version" --json | jq -r '.storePath')
pinned_versions=$duckstation_storepath/scripts/deps/versions
echo "Using pinned discord_rpc..."
discord_rpc_rev=$(grep "DISCORD_RPC_COMMIT=" "$pinned_versions" | sed 's|.*=||g')
discord_rpc_hash=$(nix --extra-experimental-features "nix-command flakes" \
flake prefetch github:stenzek/discord-rpc/"$discord_rpc_rev" --json |
jq -r '.hash')
echo "Using pinned shaderc..."
shaderc_rev=$(grep "SHADERC_COMMIT=" "$pinned_versions" | sed 's|.*=||g')
shaderc_hash=$(nix --extra-experimental-features "nix-command flakes" flake prefetch github:stenzek/shaderc/"$shaderc_rev" --json | jq -r '.hash')
echo "Fetching latest chtdb commit..."
chtdb_json=$(curl ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} "https://api.github.com/repos/duckstation/chtdb/commits?per_page=1")
chtdb_rev=$(echo "$chtdb_json" | jq -r '.[0].sha')
chtdb_date=$(echo "$chtdb_json" | jq -r '.[0].commit.author.date')
chtdb_hash=$(nix --extra-experimental-features "nix-command flakes" \
flake prefetch github:duckstation/chtdb/"$chtdb_rev" --json |
jq -r '.hash')
echo "Regenerating '""$location""/sources.json'"
JSON=$(
jq --null-input \
--arg new_version "${new_version:1}" \
--arg duckstation_darwin_hash "$duckstation_darwin_hash" \
--arg discord_rpc_rev "$discord_rpc_rev" \
--arg discord_rpc_hash "$discord_rpc_hash" \
--arg shaderc_rev "$shaderc_rev" \
--arg shaderc_hash "$shaderc_hash" \
--arg chtdb_rev "$chtdb_rev" \
--arg chtdb_date "${chtdb_date::10}" \
--arg chtdb_hash "$chtdb_hash" \
'{ "duckstation": {
"version": $new_version,
"hash_darwin": $duckstation_darwin_hash
},
"discord_rpc": {
"rev": $discord_rpc_rev,
"hash": $discord_rpc_hash
},
"shaderc": {
"rev": $shaderc_rev,
"hash": $shaderc_hash
},
"chtdb": {
"date": $chtdb_date,
"rev": $chtdb_rev,
"hash": $chtdb_hash
}
}'
)
echo "$JSON" | jq >"$location"/sources.json
+1
View File
@@ -612,6 +612,7 @@ mapAliases {
dtv-scan-tables_linuxtv = throw "'dtv-scan-tables_linuxtv' has been renamed to/replaced by 'dtv-scan-tables'"; # Converted to throw 2025-10-27
dtv-scan-tables_tvheadend = throw "'dtv-scan-tables_tvheadend' has been renamed to/replaced by 'dtv-scan-tables'"; # Converted to throw 2025-10-27
du-dust = throw "'du-dust' has been renamed to/replaced by 'dust'"; # Converted to throw 2025-10-27
duckstation = throw "'duckstation' has been removed following upstream request. Please use the appimage instead"; # Added 2026-03-14
duckstation-bin = duckstation; # Added 2025-09-20
dumb = throw "'dumb' has been archived by upstream. Upstream recommends libopenmpt as a replacement."; # Added 2025-09-14
dump1090 = throw "'dump1090' has been renamed to/replaced by 'dump1090-fa'"; # Converted to throw 2025-10-27