summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authornecrophcodr <nc@scalehost.eu>2022-08-09 20:57:16 +0200
committernecrophcodr <nc@scalehost.eu>2023-06-21 20:45:23 +0200
commit3b60380611978b9f8ebab000f826cb73f7578982 (patch)
treea2a912aff841dda8f0e9da6b9cd110c0d33b74af /pkgs/games
parent3da1e72b08e6fc89bf03969b4fb83b4d083ee076 (diff)
downloadnixpkgs-3b60380611978b9f8ebab000f826cb73f7578982.tar
nixpkgs-3b60380611978b9f8ebab000f826cb73f7578982.tar.gz
nixpkgs-3b60380611978b9f8ebab000f826cb73f7578982.tar.bz2
nixpkgs-3b60380611978b9f8ebab000f826cb73f7578982.tar.lz
nixpkgs-3b60380611978b9f8ebab000f826cb73f7578982.tar.xz
nixpkgs-3b60380611978b9f8ebab000f826cb73f7578982.tar.zst
nixpkgs-3b60380611978b9f8ebab000f826cb73f7578982.zip
fteqw: init at unstable-2022-08-09
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/fteqw/default.nix90
-rw-r--r--pkgs/games/fteqw/generic.nix60
2 files changed, 150 insertions, 0 deletions
diff --git a/pkgs/games/fteqw/default.nix b/pkgs/games/fteqw/default.nix
new file mode 100644
index 00000000000..984c558180f
--- /dev/null
+++ b/pkgs/games/fteqw/default.nix
@@ -0,0 +1,90 @@
+{ lib
+, stdenv
+, fetchsvn
+, gzip
+, libvorbis
+, libmad
+, SDL2
+, SDL2_mixer
+, libpng
+, alsa-lib
+, gnutls
+, zlib
+, libjpeg
+, vulkan-loader
+, vulkan-headers
+, speex
+, libopus
+, xorg
+, libGL
+}@attrs:
+{
+  fteqw = import ./generic.nix (rec {
+    pname = "fteqw";
+
+    buildFlags = [ "m-rel" ];
+
+    nativeBuildInputs = [
+      vulkan-headers
+    ];
+
+    buildInputs = [
+      gzip
+      libvorbis
+      libmad
+      SDL2
+      SDL2_mixer
+      libpng
+      alsa-lib
+      gnutls
+      libjpeg
+      vulkan-loader
+      speex
+      libopus
+      xorg.libXrandr
+      xorg.libXcursor
+    ];
+
+    postFixup = ''
+      patchelf $out/bin/${pname} \
+        --add-needed ${SDL2}/lib/libSDL2.so \
+        --add-needed ${libGL}/lib/libGLX.so \
+        --add-needed ${libGL}/lib/libGL.so \
+        --add-needed ${lib.getLib gnutls}/lib/libgnutls.so \
+        --add-needed ${vulkan-loader}/lib/libvulkan.so
+    '';
+
+    description = "A hybrid and versatile game engine";
+  } // attrs);
+
+  fteqw-dedicated = import ./generic.nix (rec {
+    pname = "fteqw-dedicated";
+    releaseFile = "fteqw-sv";
+
+    buildFlags = [ "sv-rel" ];
+
+    buildInputs = [
+      gnutls
+      zlib
+    ];
+
+    postFixup = ''
+      patchelf $out/bin/${pname} \
+        --add-needed ${gnutls}/lib/libgnutls.so \
+    '';
+
+    description = "Dedicated server for FTEQW";
+  } // attrs);
+
+  fteqcc = import ./generic.nix ({
+    pname = "fteqcc";
+
+    buildFlags = [ "qcc-rel" ];
+
+    buildInputs = [
+      zlib
+    ];
+
+    description = "User friendly QuakeC compiler";
+  } // attrs);
+}
diff --git a/pkgs/games/fteqw/generic.nix b/pkgs/games/fteqw/generic.nix
new file mode 100644
index 00000000000..a420657ea57
--- /dev/null
+++ b/pkgs/games/fteqw/generic.nix
@@ -0,0 +1,60 @@
+{ lib
+, fetchsvn
+, stdenv
+, libopus
+, xorg
+, pname
+, releaseFile ? pname
+, buildFlags
+, buildInputs
+, nativeBuildInputs ? []
+, postFixup ? ""
+, description
+, ... }:
+
+stdenv.mkDerivation {
+  inherit pname buildFlags buildInputs nativeBuildInputs postFixup;
+  version = "unstable-2022-08-09";
+
+  src = fetchsvn {
+    url = "https://svn.code.sf.net/p/fteqw/code/trunk";
+    rev = "6303";
+    sha256 = "sha256-tSTFX59iVUvndPRdREayKpkQ+YCYKCMQe2PXZfnTgPQ=";
+  };
+
+  makeFlags = [
+    "PKGCONFIG=$(PKG_CONFIG)"
+    "-C" "engine"
+  ];
+
+  enableParallelBuilding = true;
+  postPatch = ''
+    substituteInPlace ./engine/Makefile \
+      --replace "I/usr/include/opus" "I${libopus.dev}/include/opus"
+    substituteInPlace ./engine/gl/gl_vidlinuxglx.c \
+      --replace 'Sys_LoadLibrary("libXrandr"' 'Sys_LoadLibrary("${xorg.libXrandr}/lib/libXrandr.so"'
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm755 engine/release/${releaseFile} $out/bin/${pname}
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    inherit description;
+    homepage = "https://fte.triptohell.info";
+    longDescription = ''
+      FTE is a game engine baed on QuakeWorld able to
+      play games such as Quake 1, 2, 3, and Hexen 2.
+      It includes various features such as extended map
+      limits, vulkan and OpenGL renderers, a dedicated
+      server, and fteqcc, for easier QuakeC development
+    '';
+    maintainers = with maintainers; [ necrophcodr ];
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+  };
+}