Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

131 lines
2.9 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
cargo,
cmake,
ninja,
pkg-config,
rustPlatform,
rustc,
curl,
freetype,
libGLU,
libnotify,
libogg,
libX11,
opusfile,
pcre,
python3,
SDL2,
sqlite,
wavpack,
ffmpeg,
x264,
vulkan-headers,
vulkan-loader,
glslang,
spirv-tools,
glew,
}:
let
clientExecutable = "TaterClient-DDNet";
in
stdenv.mkDerivation (finalAttrs: {
pname = "taterclient-ddnet";
version = "10.6.0";
src = fetchFromGitHub {
owner = "sjrc6";
repo = "taterclient-ddnet";
tag = "V${finalAttrs.version}";
hash = "sha256-Z5W+IBiNhEXyBVk6w2YzotBlHam1fELmr3ojJ0q4Ge8=";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs) pname src version;
hash = "sha256-VKGc4LQjt2FHbELLBKtV8rKpxjGBrzlA3m9BSdZ/6Z0=";
};
nativeBuildInputs = [
cmake
ninja
pkg-config
rustc
cargo
rustPlatform.cargoSetupHook
glslang # for glslangValidator
python3
];
buildInputs = [
curl
libnotify
pcre
sqlite
freetype
libGLU
libogg
opusfile
SDL2
wavpack
ffmpeg
x264
vulkan-loader
vulkan-headers
glslang
spirv-tools
glew
]
++ lib.optionals stdenv.hostPlatform.isLinux [ libX11 ];
strictDeps = true;
postPatch = ''
substituteInPlace src/engine/shared/storage.cpp \
--replace-fail /usr/ $out/
'';
cmakeFlags = [
(lib.cmakeBool "AUTOUPDATE" false)
(lib.cmakeBool "CLIENT" true)
(lib.cmakeBool "SERVER" false)
(lib.cmakeBool "TOOLS" false)
(lib.cmakeBool "DISCORD" false)
(lib.cmakeFeature "CLIENT_EXECUTABLE" clientExecutable)
];
# Since we are not building the server executable, the `run_tests` Makefile target
# will not be generated.
#
# See https://github.com/sjrc6/TaterClient-ddnet/blob/V10.5.2/CMakeLists.txt#L3171
doCheck = false;
preFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
# Upstream links against <prefix>/lib while it installs this library in <prefix>/lib/ddnet
install_name_tool -change "$out/lib/libsteam_api.dylib" "$out/lib/ddnet/libsteam_api.dylib" "$out/bin/${clientExecutable}"
'';
postInstall = ''
# Desktop application conflicts with the ddnet package
mv "$out/share/applications/ddnet.desktop" "$out/share/applications/taterclient-ddnet.desktop"
substituteInPlace $out/share/applications/taterclient-ddnet.desktop \
--replace-fail "Exec=DDNet" "Exec=${clientExecutable}" \
--replace-fail "Name=DDNet" "Name=TaterClient (DDNet)" \
--replace-fail "Comment=Launch DDNet" "Comment=Launch ${clientExecutable}"
'';
meta = {
description = "Modification of DDNet teeworlds client";
homepage = "https://github.com/sjrc6/taterclient-ddnet";
changelog = "https://github.com/sjrc6/taterclient-ddnet/releases";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [
melon
theobori
];
mainProgram = clientExecutable;
};
})