taterclient-ddnet: fix tests, enable strictDeps, cleanup (#365390)

This commit is contained in:
misuzu 2024-12-15 19:28:02 +02:00 committed by GitHub
commit f0a6a2ce0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,6 +27,7 @@
glslang,
spirv-tools,
gtest,
glew,
apple-sdk_11,
}:
let
@ -55,34 +56,34 @@ stdenv.mkDerivation (finalAttrs: {
rustc
cargo
rustPlatform.cargoSetupHook
glslang # for glslangValidator
python3
];
nativeCheckInputs = [ gtest ];
checkInputs = [ 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 [
apple-sdk_11
];
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 \
@ -90,17 +91,18 @@ stdenv.mkDerivation (finalAttrs: {
'';
cmakeFlags = [
"-DAUTOUPDATE=OFF"
"-DCLIENT=ON"
"-DSERVER=OFF"
"-DTOOLS=OFF"
"-DCLIENT_EXECUTABLE=${clientExecutable}"
(lib.cmakeBool "AUTOUPDATE" false)
(lib.cmakeBool "CLIENT" true)
(lib.cmakeBool "SERVER" false)
(lib.cmakeBool "TOOLS" false)
(lib.cmakeFeature "CLIENT_EXECUTABLE" clientExecutable)
];
# Tests loop forever on Darwin for some reason
doCheck = !stdenv.hostPlatform.isDarwin;
doCheck = true;
checkTarget = "run_tests";
__darwinAllowLocalNetworking = true; # for tests
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}"