24 x11Support ? stdenv.isLinux,
25 waylandSupport ? stdenv.isLinux,
28 stdenv.mkDerivation (finalAttrs: rec {
32 src = fetchFromGitHub {
35 rev = "refs/tags/r${version}";
36 hash = "sha256-LNOrGJarXnf4QqFXDkUfUgLGrjSqbjncpIN2yttbMuk=";
46 ++ lib.optionals waylandSupport [
62 ++ lib.optionals waylandSupport [
67 ++ lib.optionals x11Support [ libXi ];
69 mesonBuildType = "release";
72 (lib.mesonBool "anticheat-server" true)
73 (lib.mesonBool "client-gtv" true)
74 (lib.mesonBool "packetdup-hack" true)
75 (lib.mesonBool "variable-fps" true)
76 (lib.mesonEnable "wayland" waylandSupport)
77 (lib.mesonEnable "x11" x11Support)
78 (lib.mesonEnable "icmp-errors" stdenv.isLinux)
79 (lib.mesonEnable "windows-crash-dumps" false)
83 echo 'r${version}' > VERSION
88 ldLibraryPathEnvName =
89 if stdenv.hostPlatform.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
92 mv -v $out/bin/q2pro $out/bin/q2pro-unwrapped
93 makeWrapper $out/bin/q2pro-unwrapped $out/bin/q2pro \
94 --prefix ${ldLibraryPathEnvName} : "${lib.makeLibraryPath finalAttrs.buildInputs}"
97 nativeInstallCheckInputs = [ versionCheckHook ];
98 versionCheckProgramArg = "--version";
99 doInstallCheck = true;
102 description = "Enhanced Quake 2 client and server focused on multiplayer";
103 homepage = "https://github.com/skullernet/q2pro";
104 license = lib.licenses.gpl2;
105 maintainers = with lib.maintainers; [ carlossless ];
106 platforms = lib.platforms.unix;
107 mainProgram = "q2pro";