assaultcube: 1.2.0.2 -> 1.3.0.2
assaultcube: update meta field assaultcube: update nix expression assaultcube: reformat expression assaultcube: add hooks and update desktop item
This commit is contained in:
parent
2696f4c696
commit
ab968d7dd0
@ -1,42 +1,67 @@
|
|||||||
{ fetchFromGitHub, lib, stdenv, makeDesktopItem, openal, pkg-config, libogg,
|
{ lib
|
||||||
libvorbis, SDL, SDL_image, makeWrapper, zlib, file,
|
, stdenv
|
||||||
client ? true, server ? true }:
|
, fetchFromGitHub
|
||||||
|
, makeDesktopItem
|
||||||
with lib;
|
, copyDesktopItems
|
||||||
|
, openal
|
||||||
|
, pkg-config
|
||||||
|
, libogg
|
||||||
|
, libvorbis
|
||||||
|
, SDL2
|
||||||
|
, SDL2_image
|
||||||
|
, makeWrapper
|
||||||
|
, zlib
|
||||||
|
, file
|
||||||
|
, client ? true, server ? true
|
||||||
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
|
|
||||||
# master branch has legacy (1.2.0.2) protocol 1201 and gcc 6 fix.
|
|
||||||
pname = "assaultcube";
|
pname = "assaultcube";
|
||||||
version = "unstable-2018-05-20";
|
version = "1.3.0.2";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "assaultcube";
|
owner = "assaultcube";
|
||||||
repo = "AC";
|
repo = "AC";
|
||||||
rev = "f58ea22b46b5013a520520670434b3c235212371";
|
rev = "v${version}";
|
||||||
sha256 = "1vfn3d55vmmipdykrcfvgk6dddi9y95vlclsliirm7jdp20f15hd";
|
sha256 = "0qv339zw9q5q1y7bghca03gw7z4v89sl4lbr6h3b7siy08mcwiz9";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper pkg-config ];
|
nativeBuildInputs = [
|
||||||
|
makeWrapper
|
||||||
|
pkg-config
|
||||||
|
copyDesktopItems
|
||||||
|
];
|
||||||
|
|
||||||
buildInputs = [ file zlib ] ++ optionals client [ openal SDL SDL_image libogg libvorbis ];
|
buildInputs = [
|
||||||
|
file
|
||||||
|
zlib
|
||||||
|
] ++ lib.optionals client [
|
||||||
|
openal
|
||||||
|
SDL2
|
||||||
|
SDL2_image
|
||||||
|
libogg
|
||||||
|
libvorbis
|
||||||
|
];
|
||||||
|
|
||||||
targets = (optionalString server "server") + (optionalString client " client");
|
targets = (lib.optionalString server "server") + (lib.optionalString client " client");
|
||||||
makeFlags = [ "-C source/src" "CXX=${stdenv.cc.targetPrefix}c++" targets ];
|
makeFlags = [ "-C source/src" "CXX=${stdenv.cc.targetPrefix}c++" targets ];
|
||||||
|
|
||||||
desktop = makeDesktopItem {
|
desktopItems = [
|
||||||
name = "AssaultCube";
|
(makeDesktopItem {
|
||||||
desktopName = "AssaultCube";
|
name = pname;
|
||||||
comment = "A multiplayer, first-person shooter game, based on the CUBE engine. Fast, arcade gameplay.";
|
desktopName = "AssaultCube";
|
||||||
genericName = "First-person shooter";
|
comment = "A multiplayer, first-person shooter game, based on the CUBE engine. Fast, arcade gameplay.";
|
||||||
categories = [ "Game" "ActionGame" "Shooter" ];
|
genericName = "First-person shooter";
|
||||||
icon = "assaultcube.png";
|
categories = [ "Game" "ActionGame" "Shooter" ];
|
||||||
exec = pname;
|
icon = "assaultcube";
|
||||||
};
|
exec = pname;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
gamedatadir = "/share/games/${pname}";
|
gamedatadir = "/share/games/${pname}";
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
bindir=$out/bin
|
bindir=$out/bin
|
||||||
|
|
||||||
@ -47,7 +72,6 @@ stdenv.mkDerivation rec {
|
|||||||
if (test -e source/src/ac_client) then
|
if (test -e source/src/ac_client) then
|
||||||
cp source/src/ac_client $bindir
|
cp source/src/ac_client $bindir
|
||||||
mkdir -p $out/share/applications
|
mkdir -p $out/share/applications
|
||||||
cp ${desktop}/share/applications/* $out/share/applications
|
|
||||||
install -Dpm644 packages/misc/icon.png $out/share/icons/assaultcube.png
|
install -Dpm644 packages/misc/icon.png $out/share/icons/assaultcube.png
|
||||||
install -Dpm644 packages/misc/icon.png $out/share/pixmaps/assaultcube.png
|
install -Dpm644 packages/misc/icon.png $out/share/pixmaps/assaultcube.png
|
||||||
|
|
||||||
@ -60,13 +84,15 @@ stdenv.mkDerivation rec {
|
|||||||
makeWrapper $out/bin/ac_server $out/bin/${pname}-server \
|
makeWrapper $out/bin/ac_server $out/bin/${pname}-server \
|
||||||
--chdir "$out/$gamedatadir" --add-flags "-Cconfig/servercmdline.txt"
|
--chdir "$out/$gamedatadir" --add-flags "-Cconfig/servercmdline.txt"
|
||||||
fi
|
fi
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
description = "Fast and fun first-person-shooter based on the Cube fps";
|
description = "Fast and fun first-person-shooter based on the Cube fps";
|
||||||
homepage = "https://assault.cubers.net";
|
homepage = "https://assault.cubers.net";
|
||||||
maintainers = [ ];
|
|
||||||
platforms = platforms.linux; # should work on darwin with a little effort.
|
platforms = platforms.linux; # should work on darwin with a little effort.
|
||||||
license = lib.licenses.unfree;
|
license = licenses.unfree;
|
||||||
|
maintainers = with maintainers; [ darkonion0 ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user