duckstation: include patches for increased functionality (#463068)
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
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
|
||||
|
||||
@@ -29,10 +29,7 @@
|
||||
udev,
|
||||
libbacktrace,
|
||||
ffmpeg_8-headless,
|
||||
alsa-lib,
|
||||
libjack2,
|
||||
libpulseaudio,
|
||||
pipewire,
|
||||
cubeb,
|
||||
fetchurl,
|
||||
zip,
|
||||
unzip,
|
||||
@@ -64,21 +61,47 @@ let
|
||||
|
||||
linuxDrv = llvmPackages.stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "duckstation";
|
||||
version = pkgSources.duckstation.version;
|
||||
version = "0.1-10091";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "stenzek";
|
||||
repo = "duckstation";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = pkgSources.duckstation.hash_linux;
|
||||
deepClone = true;
|
||||
hash = "sha256-z6hpjMkz7zlt/NUzGl+Px058O99bfDCXV1l5lBqC6vw=";
|
||||
|
||||
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
|
||||
'';
|
||||
};
|
||||
|
||||
# TODO: Remove once this is fixed upstream.
|
||||
postPatch = ''
|
||||
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,"
|
||||
'';
|
||||
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";
|
||||
@@ -233,10 +256,7 @@ let
|
||||
udev
|
||||
libbacktrace
|
||||
ffmpeg_8-headless
|
||||
alsa-lib
|
||||
libjack2
|
||||
pipewire
|
||||
libpulseaudio
|
||||
cubeb
|
||||
]
|
||||
++ [
|
||||
finalAttrs.vendorDiscordRPC
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"duckstation": {
|
||||
"version": "0.1-10091",
|
||||
"hash_linux": "sha256-mgrln6Z0kshFy/8QberfeXHWoSxxojvn53B/WYkobpQ=",
|
||||
"hash_darwin": "sha256-6bp3ksI3a3FYuGhP6y77AxTR1XOXyjmBuQNnWwU9Zoo="
|
||||
},
|
||||
"discord_rpc": {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p coreutils nix curl jq
|
||||
#!nix-shell -i bash -p coreutils nix nix-update curl jq
|
||||
# shellcheck shell=bash
|
||||
|
||||
set -euo pipefail
|
||||
@@ -15,7 +15,7 @@ if [[ $old_version == "$new_version" ]]; then
|
||||
fi
|
||||
|
||||
echo "Updating duckstation from $old_version -> $new_version"
|
||||
duckstation_linux_hash=$(nix --extra-experimental-features "nix-command flakes" flake prefetch github:stenzek/duckstation/"$new_version" --json | jq -r '.hash')
|
||||
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..."
|
||||
@@ -44,7 +44,6 @@ echo "Regenerating '""$location""/sources.json'"
|
||||
JSON=$(
|
||||
jq --null-input \
|
||||
--arg new_version "${new_version:1}" \
|
||||
--arg duckstation_linux_hash "$duckstation_linux_hash" \
|
||||
--arg duckstation_darwin_hash "$duckstation_darwin_hash" \
|
||||
--arg discord_rpc_rev "$discord_rpc_rev" \
|
||||
--arg discord_rpc_hash "$discord_rpc_hash" \
|
||||
@@ -55,7 +54,6 @@ JSON=$(
|
||||
--arg chtdb_hash "$chtdb_hash" \
|
||||
'{ "duckstation": {
|
||||
"version": $new_version,
|
||||
"hash_linux": $duckstation_linux_hash,
|
||||
"hash_darwin": $duckstation_darwin_hash
|
||||
},
|
||||
"discord_rpc": {
|
||||
|
||||
Reference in New Issue
Block a user