Commit 7b710d3e authored by Arne Keller's avatar Arne Keller Committed by FliegendeWurst
Browse files

taterclient-ddnet: fix tests, enable strictDeps, cleanup

parent 52af6223
Loading
Loading
Loading
Loading
+33 −31
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
  glslang,
  spirv-tools,
  gtest,
  glew,
  apple-sdk_11,
}:
let
@@ -55,16 +56,17 @@ stdenv.mkDerivation (finalAttrs: {
    rustc
    cargo
    rustPlatform.cargoSetupHook
    glslang # for glslangValidator
    python3
  ];

  nativeCheckInputs = [ gtest ];
  checkInputs = [ gtest ];

  buildInputs =
    [
  buildInputs = [
    curl
    libnotify
    pcre
      python3
    sqlite
    freetype
    libGLU
@@ -78,11 +80,10 @@ stdenv.mkDerivation (finalAttrs: {
    vulkan-headers
    glslang
    spirv-tools
    ]
    ++ lib.optionals stdenv.hostPlatform.isLinux [ libX11 ]
    ++ lib.optionals stdenv.hostPlatform.isDarwin [
      apple-sdk_11
    ];
    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}"