simple64: init at 2024.09.1; simple64-netplay-server: init at 2024.06.1 (#301287)

This commit is contained in:
Aleksana 2024-10-30 18:14:47 +08:00 committed by GitHub
commit fb8776b5e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 181 additions and 0 deletions

View File

@ -0,0 +1,27 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "simple64-netplay-server";
version = "2024.06.1";
src = fetchFromGitHub {
owner = "simple64";
repo = "simple64-netplay-server";
rev = "refs/tags/v${version}";
hash = "sha256-WTEtTzRkXuIusfK6Nbj1aLwXcXyaXQi+j3SsDrvtLKo=";
};
vendorHash = "sha256-zfLSti368rBHj17HKDZKtOQQrhVGVa2CaieaDGHcZOk=";
meta = {
description = "Dedicated server for simple64 netplay";
homepage = "https://github.com/simple64/simple64-netplay-server";
license = lib.licenses.gpl3Only;
mainProgram = "simple64-netplay-server";
maintainers = with lib.maintainers; [ tomasajt ];
};
}

View File

@ -0,0 +1,15 @@
diff --git a/simple64-gui/netplay/joinroom.cpp b/simple64-gui/netplay/joinroom.cpp
index 3b5c34e..68b46f2 100644
--- a/simple64-gui/netplay/joinroom.cpp
+++ b/simple64-gui/netplay/joinroom.cpp
@@ -308,7 +308,9 @@ void JoinRoom::processTextMessage(QString message)
}
else
{
- msgBox.setText(json.value("message").toString());
+ QString msg = json.value("message").toString();
+ if(msg == "Bad authentication code") msg += "<br>Note: using the official netplay servers is not allowed on unofficial builds.<br>You can host your own server with `simple64-netplay-server`";
+ msgBox.setText(msg);
msgBox.exec();
}
}

View File

@ -0,0 +1,37 @@
diff --git a/build.sh b/build.sh
index 254a90d..e2d26cf 100644
--- a/build.sh
+++ b/build.sh
@@ -77,7 +77,7 @@ cmake -G Ninja -DCMAKE_BUILD_TYPE="${RELEASE_TYPE}" ..
cmake --build .
cp simple64-video-parallel.* "${install_dir}"
-if [[ ! -d "${base_dir}/discord" ]]; then
+if false; then
echo "Downloading Discord SDK"
mkdir -p "${base_dir}/discord"
cd "${base_dir}/discord"
@@ -86,7 +86,7 @@ if [[ ! -d "${base_dir}/discord" ]]; then
rm discord_game_sdk.zip
fi
-if [[ ! -d "${base_dir}/vosk" ]]; then
+if false; then
mkdir -p "${base_dir}/vosk"
cd "${base_dir}/vosk"
if [[ ${UNAME} == *"MINGW64"* ]]; then
@@ -156,14 +156,6 @@ if [[ ${UNAME} == *"MINGW64"* ]]; then
cp -v "${base_dir}/7z/x64/7za.exe" "${install_dir}"
cp -v "${base_dir}/discord/lib/x86_64/discord_game_sdk.dll" "${install_dir}"
cp -v "${base_dir}/vosk/libvosk.dll" "${install_dir}/vosk.dll"
-else
- cp "${base_dir}/vosk/libvosk.so" "${install_dir}"
- if [[ "${PLATFORM}" == "aarch64" ]]; then
- my_os=linux_aarch64
- else
- my_os=linux_x86_64
- cp "${base_dir}/discord/lib/x86_64/discord_game_sdk.so" "${install_dir}/libdiscord_game_sdk.so"
- fi
fi
if [[ "$1" == "zip" ]]; then

View File

@ -0,0 +1,102 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchurl,
writeShellScriptBin,
cmake,
ninja,
pkg-config,
makeWrapper,
zlib,
libpng,
SDL2,
SDL2_net,
hidapi,
qt6,
vulkan-loader,
}:
let
cheats-json = fetchurl {
url = "https://raw.githubusercontent.com/simple64/cheat-parser/87963b7aca06e0d4632b66bc5ffe7d6b34060f4f/cheats.json";
hash = "sha256-rS/4Mdi+18C2ywtM5nW2XaJkC1YnKZPc4YdQ3mCfESU=";
};
in
stdenv.mkDerivation (finalAttrs: {
pname = "simple64";
version = "2024.09.1";
src = fetchFromGitHub {
owner = "simple64";
repo = "simple64";
rev = "refs/tags/v${finalAttrs.version}";
hash = "sha256-t3V7mvHlCP8cOvizR3N9DiCofnSvSHI6U0iXXkaMb34=";
};
patches = [
./dont-use-vosk-and-discord.patch
./add-official-server-error-message.patch
];
postPatch = ''
cp ${cheats-json} cheats.json
'';
stictDeps = true;
nativeBuildInputs = [
qt6.wrapQtAppsHook
cmake
ninja
pkg-config
makeWrapper
# fake git command for version info generator
(writeShellScriptBin "git" "echo ${finalAttrs.src.rev}")
];
buildInputs = [
zlib
libpng
SDL2
SDL2_net
hidapi
qt6.qtbase
qt6.qtwebsockets
qt6.qtwayland
];
dontUseCmakeConfigure = true;
dontWrapQtApps = true;
buildPhase = ''
runHook preInstall
sh build.sh
runHook postInstall
'';
installPhase = ''
runHook preInstall
mkdir -p $out/share/simple64 $out/bin
cp -r simple64/* $out/share/simple64
makeWrapper $out/share/simple64/simple64-gui $out/bin/simple64-gui \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ vulkan-loader ]} \
"''${qtWrapperArgs[@]}"
runHook postInstall
'';
meta = {
description = "Easy to use N64 emulator";
homepage = "https://simple64.github.io";
license = lib.licenses.gpl3Only;
mainProgram = "simple64-gui";
maintainers = with lib.maintainers; [ tomasajt ];
platforms = lib.platforms.linux;
};
})