Unverified Commit 6ca3ad7c authored by tomberek's avatar tomberek Committed by GitHub
Browse files

Merge pull request #329327 from poperigby/vkquake-1.31.0

vkquake: 1.22.3 → 1.31.0
parents 23a3a7b2 10b32454
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -16345,6 +16345,11 @@
    githubId = 4201956;
    name = "pongo1231";
  };
  PopeRigby = {
    name = "PopeRigby";
    github = "poperigby";
    githubId = 20866468;
  };
  poptart = {
    email = "poptart@hosakacorp.net";
    github = "terrorbyte";
+38 −21
Original line number Diff line number Diff line
{ lib, stdenv, fetchFromGitHub, makeWrapper
, SDL2, gzip, libvorbis, libmad, vulkan-headers, vulkan-loader, moltenvk
{
  lib,
  stdenv,
  fetchFromGitHub,
  meson,
  ninja,
  glslang,
  pkg-config,
  flac,
  libopus,
  opusfile,
  makeWrapper,
  SDL2,
  gzip,
  libvorbis,
  libmad,
  vulkan-loader,
  moltenvk,
}:

stdenv.mkDerivation rec {
  pname = "vkquake";
  version = "1.22.3";
  version = "1.31.0";

  src = fetchFromGitHub {
    owner = "Novum";
    repo = "vkQuake";
    rev = version;
    sha256 = "sha256-+8DU1QT3Lgqf1AIReVnXQ2Lq6R6eBb8VjdkJfAn/Rtc=";
    sha256 = "sha256-3xWwqN0EcwDMEhVxfLa0bMMClM+zELEFWzO/EJvPNs0=";
  };

  sourceRoot = "${src.name}/Quake";

  nativeBuildInputs = [
    makeWrapper
    vulkan-headers
    glslang
    meson
    ninja
    pkg-config
  ];

  buildInputs = [
    gzip
    SDL2
    libvorbis
    flac
    gzip
    libmad
    libopus
    libvorbis
    opusfile
    vulkan-loader
  ] ++ lib.optional stdenv.isDarwin moltenvk;

  buildFlags = [ "DO_USERDIRS=1" ];

  preInstall = ''
    mkdir -p "$out/bin"
  '';

  makeFlags = [ "prefix=$(out) bindir=$(out)/bin" ];

  env = lib.optionalAttrs stdenv.isDarwin {
    NIX_CFLAGS_COMPILE = "-Wno-error=unused-but-set-variable";
  };

  postFixup = ''
    wrapProgram $out/bin/vkquake \
      --prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib
  installPhase = ''
    mkdir -p "$out/bin"
    cp vkquake "$out/bin"
  '';

  enableParallelBuilding = true;
  postFixup = ''
    patchelf $out/bin/vkquake \
      --add-rpath ${lib.makeLibraryPath [ vulkan-loader ]}
  '';

  meta = with lib; {
    description = "Vulkan Quake port based on QuakeSpasm";
    mainProgram = "vkquake";
    homepage = src.meta.homepage;
    longDescription = ''
      vkQuake is a Quake 1 port using Vulkan instead of OpenGL for rendering.
@@ -61,6 +77,7 @@ stdenv.mkDerivation rec {
    '';

    platforms = with platforms; linux ++ darwin;
    maintainers = with maintainers; [ ylh ];
    maintainers = with maintainers; [ PopeRigby ylh ];
    mainProgram = "vkquake";
  };
}