Skip to content

Commit

Permalink
q2pro: 3510 -> 0-unstable-2024-11-19
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossless committed Nov 20, 2024
1 parent 39e98fa commit 4ee1e8a
Showing 1 changed file with 32 additions and 9 deletions.
41 changes: 32 additions & 9 deletions pkgs/by-name/q2/q2pro/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,36 @@
libdecor,
ffmpeg,
wayland-scanner,
makeWrapper,
makeBinaryWrapper,
versionCheckHook,
copyDesktopItems,
makeDesktopItem,
desktopToDarwinBundle,
x11Support ? stdenv.hostPlatform.isLinux,
waylandSupport ? stdenv.hostPlatform.isLinux,
}:

stdenv.mkDerivation (finalAttrs: rec {
pname = "q2pro";
version = "3510";
version = "0-unstable-2024-11-19";

src = fetchFromGitHub {
owner = "skullernet";
repo = "q2pro";
rev = "refs/tags/r${version}";
hash = "sha256-LNOrGJarXnf4QqFXDkUfUgLGrjSqbjncpIN2yttbMuk=";
rev = "0b790d74f2620cd0b7f0b528eb9684b28725b119";
hash = "sha256-sy50+3Zi3dmD7704KhXv12ZUtfwjHV6dodD1R3e7g1o=";
};

nativeBuildInputs =
[
meson
pkg-config
ninja
makeWrapper
makeBinaryWrapper
copyDesktopItems
]
++ lib.optionals waylandSupport [
wayland-scanner
];
++ lib.optional waylandSupport wayland-scanner
++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle;

buildInputs =
[
Expand Down Expand Up @@ -80,7 +83,7 @@ stdenv.mkDerivation (finalAttrs: rec {
];

postPatch = ''
echo 'r${version}' > VERSION
echo 'r0~${builtins.substring 0 8 src.rev}~${version}' > VERSION
'';

postInstall =
Expand All @@ -92,12 +95,32 @@ stdenv.mkDerivation (finalAttrs: rec {
mv -v $out/bin/q2pro $out/bin/q2pro-unwrapped
makeWrapper $out/bin/q2pro-unwrapped $out/bin/q2pro \
--prefix ${ldLibraryPathEnvName} : "${lib.makeLibraryPath finalAttrs.buildInputs}"
install -D ${src}/src/unix/res/q2pro.xpm $out/share/icons/hicolor/32x32/apps/q2pro.xpm
'';

nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "--version";
doInstallCheck = true;

desktopItems = [
(makeDesktopItem {
name = "q2pro";
desktopName = "q2pro";
exec = if stdenv.hostPlatform.isDarwin then "q2pro" else "q2pro +connect %u";
icon = "q2pro";
terminal = false;
mimeTypes = [
"x-scheme-handler/quake2"
];
type = "Application";
categories = [
"Game"
"ActionGame"
];
})
];

meta = {
description = "Enhanced Quake 2 client and server focused on multiplayer";
homepage = "https://github.com/skullernet/q2pro";
Expand Down

0 comments on commit 4ee1e8a

Please sign in to comment.