Unverified Commit 4bb451da authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

Merge pull request #185825 from necrophcodr/add-fteqw

fteqw: init at unstable-2022-08-09
parents 9ca0bd9d 3b603806
Loading
Loading
Loading
Loading
+90 −0
Original line number Diff line number Diff line
{ 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);
}
+60 −0
Original line number Diff line number Diff line
{ 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;
  };
}
+5 −0
Original line number Diff line number Diff line
@@ -36820,6 +36820,11 @@ with pkgs;
  freenukum = callPackage ../games/freenukum { };
  inherit (callPackages ../games/fteqw {})
    fteqw
    fteqw-dedicated
    fteqcc;
  gamepad-tool = callPackage ../games/gamepad-tool { };
  gnome-hexgl = callPackage ../games/gnome-hexgl { };