Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

taterclient-ddnet: init at 8.6.0 #346206

Merged
merged 2 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13515,6 +13515,12 @@
githubId = 1215331;
name = "Matt Melling";
};
melon = {
email = "melontime05@gmail.com";
github = "BlaiZephyr";
githubId = 101197249;
name = "Tim";
};
melsigl = {
email = "melanie.bianca.sigl@gmail.com";
github = "melsigl";
Expand Down
136 changes: 136 additions & 0 deletions pkgs/by-name/ta/taterclient-ddnet/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
{
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,
gtest,
darwin,
}:
let
clientExecutable = "TaterClient-DDNet";
in
stdenv.mkDerivation (finalAttrs: {
pname = "taterclient-ddnet";
version = "8.6.0";

src = fetchFromGitHub {
owner = "sjrc6";
repo = "taterclient-ddnet";
rev = finalAttrs.version;
hash = "sha256-IfTQRMC2wcEH+KhlADHVIhfavlTN4mfTtlN5+/KojA0=";
};

cargoDeps = rustPlatform.fetchCargoTarball {
inherit (finalAttrs) pname src version;
hash = "sha256-L6NsLC5hg4/MlTfnOITBNoPIoKxlDx5BwXWnV7W4uT0=";
};

nativeBuildInputs = [
cmake
ninja
pkg-config
rustc
cargo
rustPlatform.cargoSetupHook
];

nativeCheckInputs = [ gtest ];

buildInputs =
[
curl
libnotify
pcre
python3
sqlite
freetype
libGLU
libogg
opusfile
SDL2
wavpack
ffmpeg
x264
vulkan-loader
vulkan-headers
glslang
spirv-tools
]
++ lib.optionals stdenv.hostPlatform.isLinux [ libX11 ]
++ lib.optionals stdenv.hostPlatform.isDarwin (
with darwin.apple_sdk.frameworks;
[
Carbon
Cocoa
OpenGL
Security
]
);

postPatch = ''
substituteInPlace src/engine/shared/storage.cpp \
--replace-fail /usr/ $out/
'';

cmakeFlags = [
"-DAUTOUPDATE=OFF"
"-DCLIENT=ON"
"-DSERVER=OFF"
"-DTOOLS=OFF"
"-DCLIENT_EXECUTABLE=${clientExecutable}"
];

# Tests loop forever on Darwin for some reason
doCheck = !stdenv.hostPlatform.isDarwin;
checkTarget = "run_tests";

theobori marked this conversation as resolved.
Show resolved Hide resolved
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;
theobori marked this conversation as resolved.
Show resolved Hide resolved
};
})
5 changes: 5 additions & 0 deletions pkgs/games/ddnet/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ stdenv.mkDerivation rec {
rm -rf $out/share/metainfo
'';

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/DDNet"
'';

meta = with lib; {
description = "Teeworlds modification with a unique cooperative gameplay";
longDescription = ''
Expand Down