From d41922a01688da4470fd461243e59ee798bd6a33 Mon Sep 17 00:00:00 2001 From: Heinz Deinhart Date: Sun, 5 May 2024 21:32:44 +0200 Subject: [PATCH] ddnet 18.1 -> 18.2 (plus one patch to workaround a libcurl problem) https://ddnet.org/downloads/#18.2 https://github.com/ddnet/ddnet/compare/18.1...18.2 --- .../ddnet-18.2-nixos-libcurl-brotli-disable.patch | 13 +++++++++++++ pkgs/games/ddnet/default.nix | 10 +++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 pkgs/games/ddnet/ddnet-18.2-nixos-libcurl-brotli-disable.patch diff --git a/pkgs/games/ddnet/ddnet-18.2-nixos-libcurl-brotli-disable.patch b/pkgs/games/ddnet/ddnet-18.2-nixos-libcurl-brotli-disable.patch new file mode 100644 index 000000000000..577cfa3811e1 --- /dev/null +++ b/pkgs/games/ddnet/ddnet-18.2-nixos-libcurl-brotli-disable.patch @@ -0,0 +1,13 @@ +diff -ur ddnet-18.2/src/engine/shared/http.cpp ddnet-18.2-nixos-libcurl-workaround/src/engine/shared/http.cpp +--- ddnet-18.2/src/engine/shared/http.cpp 2024-04-30 20:27:51.000000000 +0200 ++++ ddnet-18.2-nixos-libcurl-workaround/src/engine/shared/http.cpp 2024-05-05 21:17:33.792870233 +0200 +@@ -146,7 +146,8 @@ + curl_easy_setopt(pH, CURLOPT_URL, m_aUrl); + curl_easy_setopt(pH, CURLOPT_NOSIGNAL, 1L); + curl_easy_setopt(pH, CURLOPT_USERAGENT, GAME_NAME " " GAME_RELEASE_VERSION " (" CONF_PLATFORM_STRING "; " CONF_ARCH_STRING ")"); +- curl_easy_setopt(pH, CURLOPT_ACCEPT_ENCODING, ""); // Use any compression algorithm supported by libcurl. ++ // curl_easy_setopt(pH, CURLOPT_ACCEPT_ENCODING, ""); // Use any compression algorithm supported by libcurl. ++ curl_easy_setopt(pH, CURLOPT_ACCEPT_ENCODING, "gzip, deflate"); // NixOS libcurl workaround: don't use brotli + + curl_easy_setopt(pH, CURLOPT_HEADERDATA, this); + curl_easy_setopt(pH, CURLOPT_HEADERFUNCTION, HeaderCallback); diff --git a/pkgs/games/ddnet/default.nix b/pkgs/games/ddnet/default.nix index e21325198de2..eaf6a5e08b78 100644 --- a/pkgs/games/ddnet/default.nix +++ b/pkgs/games/ddnet/default.nix @@ -35,21 +35,25 @@ stdenv.mkDerivation rec { pname = "ddnet"; - version = "18.1"; + version = "18.2"; src = fetchFromGitHub { owner = "ddnet"; repo = pname; rev = version; - hash = "sha256-kAMKeYYMCFMgG3+G/05DwA3mj4JkJdrXadjFUMPDAbM="; + hash = "sha256-KerV174GPF2htfaQo5gRFLgpnGf9UoS0zQ/yd/SDFkQ="; }; cargoDeps = rustPlatform.fetchCargoTarball { name = "${pname}-${version}"; inherit src; - hash = "sha256-8mUo2I5FsA3ym/hrlGaUW8yltLuh/0H6wetCbzvRga0="; + hash = "sha256-cAz98SspJ5QFjw7rXtdmfShllAx89pg+PUs20bkmBCg="; }; + patches = [ + ./ddnet-18.2-nixos-libcurl-brotli-disable.patch + ]; + nativeBuildInputs = [ cmake ninja