Skip to content

Commit

Permalink
q2pro: 3510 -> 3624
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossless committed Nov 20, 2024
1 parent 39e98fa commit 80fc278
Showing 1 changed file with 33 additions and 10 deletions.
43 changes: 33 additions & 10 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 = "3624"; # git rev-list --count ${src.rev}

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 All @@ -64,7 +67,7 @@ stdenv.mkDerivation (finalAttrs: rec {
wayland-protocols
libdecor
]
++ lib.optionals x11Support [ libXi ];
++ lib.optional x11Support libXi;

mesonBuildType = "release";

Expand All @@ -80,7 +83,7 @@ stdenv.mkDerivation (finalAttrs: rec {
];

postPatch = ''
echo 'r${version}' > VERSION
echo 'r${version}~${builtins.substring 0 8 src.rev}' > 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 80fc278

Please sign in to comment.