1{
2 lib,
3 fetchFromGitHub,
4 stdenv,
5 libopus,
6 xorg,
7 pname,
8 releaseFile ? pname,
9 buildFlags,
10 buildInputs,
11 nativeBuildInputs ? [ ],
12 postFixup ? "",
13 description,
14 ...
15}:
16
17stdenv.mkDerivation {
18 inherit
19 pname
20 buildFlags
21 buildInputs
22 nativeBuildInputs
23 postFixup
24 ;
25 version = "0-unstable-2025-06-25";
26
27 src = fetchFromGitHub {
28 owner = "fte-team";
29 repo = "fteqw";
30 rev = "41f35720eda2d1e54d039975db28f46d68a963cb";
31 hash = "sha256-g8dKNRHAZvNfCT3ciDSyKJVqjENml39k26NqkP7sQvA=";
32 };
33
34 makeFlags = [
35 "PKGCONFIG=$(PKG_CONFIG)"
36 "-C"
37 "engine"
38 ];
39
40 enableParallelBuilding = true;
41 postPatch = ''
42 substituteInPlace ./engine/Makefile \
43 --replace "I/usr/include/opus" "I${libopus.dev}/include/opus"
44 substituteInPlace ./engine/gl/gl_vidlinuxglx.c \
45 --replace 'Sys_LoadLibrary("libXrandr"' 'Sys_LoadLibrary("${xorg.libXrandr}/lib/libXrandr.so"'
46 '';
47
48 installPhase = ''
49 runHook preInstall
50
51 install -Dm755 engine/release/${releaseFile} $out/bin/${pname}
52
53 runHook postInstall
54 '';
55
56 meta = with lib; {
57 inherit description;
58 homepage = "https://fteqw.org";
59 longDescription = ''
60 FTE is a game engine baed on QuakeWorld able to
61 play games such as Quake 1, 2, 3, and Hexen 2.
62 It includes various features such as extended map
63 limits, vulkan and OpenGL renderers, a dedicated
64 server, and fteqcc, for easier QuakeC development
65 '';
66 maintainers = with maintainers; [ necrophcodr ];
67 license = licenses.gpl2Plus;
68 platforms = platforms.linux;
69 };
70}