nixpkgs/pkgs/games/xonotic/default.nix

76 lines
2.2 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl
, # required for both
unzip, libjpeg, zlib, libvorbis, curl, patchelf
, # glx
libX11, mesa, libXpm, libXext, libXxf86vm, alsaLib
, # sdl
SDL
}:
stdenv.mkDerivation rec {
2015-10-16 00:42:45 +01:00
name = "xonotic-0.8.1";
src = fetchurl {
url = "http://dl.xonotic.org/${name}.zip";
2015-10-16 00:42:45 +01:00
sha256 = "0vy4hkrbpz9g91gb84cbv4xl845qxaknak6hshk2yflrw90wr2xy";
};
buildInputs = [
# required for both
unzip libjpeg
# glx
libX11 mesa libXpm libXext libXxf86vm alsaLib
# sdl
SDL
2016-10-03 14:14:16 +01:00
zlib libvorbis curl
];
sourceRoot = "Xonotic/source/darkplaces";
buildPhase = ''
DP_FS_BASEDIR="$out/share/xonotic"
make DP_FS_BASEDIR=$DP_FS_BASEDIR cl-release
make DP_FS_BASEDIR=$DP_FS_BASEDIR sdl-release
make DP_FS_BASEDIR=$DP_FS_BASEDIR sv-release
'';
2016-10-03 14:14:16 +01:00
enableParallelBuilding = true;
installPhase = ''
mkdir -p "$out/bin"
cp darkplaces-dedicated "$out/bin/xonotic-dedicated"
cp darkplaces-sdl "$out/bin/xonotic-sdl"
cp darkplaces-glx "$out/bin/xonotic-glx"
cd ../..
mkdir -p "$out/share/xonotic"
mv data "$out/share/xonotic"
# default to sdl
ln -s "$out/bin/xonotic-sdl" "$out/bin/xonotic"
'';
# Xonotic needs to find libcurl.so at runtime for map downloads
dontPatchELF = true;
postFixup = ''
patchelf --add-needed ${curl.out}/lib/libcurl.so $out/bin/xonotic-dedicated
patchelf --add-needed ${curl.out}/lib/libcurl.so $out/bin/xonotic-sdl
patchelf --add-needed ${curl.out}/lib/libcurl.so $out/bin/xonotic-glx
'';
meta = {
description = "A free fast-paced first-person shooter";
longDescription = ''
Xonotic is a free, fast-paced first-person shooter that works on
Windows, OS X and Linux. The project is geared towards providing
addictive arena shooter gameplay which is all spawned and driven
by the community itself. Xonotic is a direct successor of the
Nexuiz project with years of development between them, and it
aims to become the best possible open-source FPS of its kind.
'';
homepage = http://www.xonotic.org;
license = stdenv.lib.licenses.gpl2Plus;
maintainers = with stdenv.lib.maintainers; [ astsmtl ];
platforms = stdenv.lib.platforms.linux;
hydraPlatforms = [];
};
}