2014-01-01 16:47:32 +00:00
|
|
|
{ stdenv, fetchurl
|
|
|
|
, # required for both
|
2018-07-21 00:44:44 +00:00
|
|
|
unzip, libjpeg, zlib, libvorbis, curl
|
2014-01-01 16:47:32 +00:00
|
|
|
, # glx
|
2018-02-24 13:12:44 +00:00
|
|
|
libX11, libGLU_combined, libXpm, libXext, libXxf86vm, alsaLib
|
2014-01-01 16:47:32 +00:00
|
|
|
, # sdl
|
2017-05-26 09:28:17 +00:00
|
|
|
SDL2
|
2014-01-01 16:47:32 +00:00
|
|
|
}:
|
2013-05-02 11:13:11 +00:00
|
|
|
|
2011-11-06 13:54:03 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2017-05-26 09:28:17 +00:00
|
|
|
name = "xonotic-0.8.2";
|
2013-05-02 11:13:11 +00:00
|
|
|
|
2011-11-06 13:54:03 +00:00
|
|
|
src = fetchurl {
|
2018-06-28 18:43:35 +00:00
|
|
|
url = "https://dl.xonotic.org/${name}.zip";
|
2017-05-26 09:28:17 +00:00
|
|
|
sha256 = "1mcs6l4clvn7ibfq3q69k2p0z6ww75rxvnngamdq5ic6yhq74bx2";
|
2011-11-06 13:54:03 +00:00
|
|
|
};
|
2013-05-02 11:13:11 +00:00
|
|
|
|
2014-01-01 16:47:32 +00:00
|
|
|
buildInputs = [
|
|
|
|
# required for both
|
|
|
|
unzip libjpeg
|
|
|
|
# glx
|
2018-02-24 13:12:44 +00:00
|
|
|
libX11 libGLU_combined libXpm libXext libXxf86vm alsaLib
|
2014-01-01 16:47:32 +00:00
|
|
|
# sdl
|
2017-05-26 09:28:17 +00:00
|
|
|
SDL2
|
2016-10-03 13:14:16 +00:00
|
|
|
zlib libvorbis curl
|
2014-01-01 16:47:32 +00:00
|
|
|
];
|
2013-05-02 11:13:11 +00:00
|
|
|
|
2011-11-06 13:54:03 +00:00
|
|
|
sourceRoot = "Xonotic/source/darkplaces";
|
2013-05-02 11:13:11 +00:00
|
|
|
|
2017-05-28 14:13:44 +00:00
|
|
|
# "debug", "release", "profile"
|
|
|
|
target = "release";
|
|
|
|
|
|
|
|
dontStrip = target != "release";
|
|
|
|
|
2011-11-06 13:54:03 +00:00
|
|
|
buildPhase = ''
|
|
|
|
DP_FS_BASEDIR="$out/share/xonotic"
|
2017-05-28 14:13:44 +00:00
|
|
|
make DP_FS_BASEDIR=$DP_FS_BASEDIR cl-${target}
|
|
|
|
make DP_FS_BASEDIR=$DP_FS_BASEDIR sdl-${target}
|
|
|
|
make DP_FS_BASEDIR=$DP_FS_BASEDIR sv-${target}
|
2011-11-06 13:54:03 +00:00
|
|
|
'';
|
2016-10-03 13:14:16 +00:00
|
|
|
enableParallelBuilding = true;
|
2013-05-02 11:13:11 +00:00
|
|
|
|
2011-11-06 13:54:03 +00:00
|
|
|
installPhase = ''
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p "$out/bin"
|
2011-11-06 13:54:03 +00:00
|
|
|
cp darkplaces-dedicated "$out/bin/xonotic-dedicated"
|
|
|
|
cp darkplaces-sdl "$out/bin/xonotic-sdl"
|
2014-01-01 16:47:32 +00:00
|
|
|
cp darkplaces-glx "$out/bin/xonotic-glx"
|
2011-11-06 13:54:03 +00:00
|
|
|
cd ../..
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p "$out/share/xonotic"
|
2011-11-06 13:54:03 +00:00
|
|
|
mv data "$out/share/xonotic"
|
2014-01-01 16:47:32 +00:00
|
|
|
|
|
|
|
# default to sdl
|
|
|
|
ln -s "$out/bin/xonotic-sdl" "$out/bin/xonotic"
|
2011-11-06 13:54:03 +00:00
|
|
|
'';
|
2013-05-02 11:13:11 +00:00
|
|
|
|
2017-05-25 14:13:32 +00:00
|
|
|
# Xonotic needs to find libcurl.so at runtime for map downloads
|
2011-11-06 13:54:03 +00:00
|
|
|
dontPatchELF = true;
|
2017-05-25 14:13:32 +00:00
|
|
|
postFixup = ''
|
|
|
|
patchelf --add-needed ${curl.out}/lib/libcurl.so $out/bin/xonotic-dedicated
|
2017-05-28 14:13:44 +00:00
|
|
|
patchelf \
|
|
|
|
--add-needed ${curl.out}/lib/libcurl.so \
|
|
|
|
--add-needed ${libvorbis}/lib/libvorbisfile.so \
|
|
|
|
--add-needed ${libvorbis}/lib/libvorbis.so \
|
|
|
|
$out/bin/xonotic-glx
|
|
|
|
patchelf \
|
|
|
|
--add-needed ${curl.out}/lib/libcurl.so \
|
|
|
|
--add-needed ${libvorbis}/lib/libvorbisfile.so \
|
|
|
|
--add-needed ${libvorbis}/lib/libvorbis.so \
|
|
|
|
$out/bin/xonotic-sdl
|
2017-05-25 14:13:32 +00:00
|
|
|
'';
|
2013-05-02 11:13:11 +00:00
|
|
|
|
2011-11-06 13:54:03 +00:00
|
|
|
meta = {
|
|
|
|
description = "A free fast-paced first-person shooter";
|
|
|
|
longDescription = ''
|
|
|
|
Xonotic is a free, fast-paced first-person shooter that works on
|
2017-08-06 22:05:18 +00:00
|
|
|
Windows, macOS and Linux. The project is geared towards providing
|
2011-11-06 13:54:03 +00:00
|
|
|
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;
|
2015-05-28 17:20:29 +00:00
|
|
|
license = stdenv.lib.licenses.gpl2Plus;
|
2017-05-26 09:28:17 +00:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ astsmtl zalakain ];
|
2013-11-04 23:04:36 +00:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
hydraPlatforms = [];
|
2011-11-06 13:54:03 +00:00
|
|
|
};
|
|
|
|
}
|