Merge pull request #136192 from andir/xonotic
xonotic: support user statistics reporting
This commit is contained in:
commit
f3e49a4ae5
1 changed files with 22 additions and 6 deletions
|
@ -6,6 +6,8 @@
|
|||
libX11, libGLU, libGL, libXpm, libXext, libXxf86vm, alsa-lib
|
||||
, # sdl
|
||||
SDL2
|
||||
, # blind
|
||||
gmp
|
||||
|
||||
, withSDL ? true
|
||||
, withGLX ? false
|
||||
|
@ -63,7 +65,7 @@ let
|
|||
};
|
||||
|
||||
nativeBuildInputs = [ unzip ];
|
||||
buildInputs = [ libjpeg zlib libvorbis curl ]
|
||||
buildInputs = [ libjpeg zlib libvorbis curl gmp ]
|
||||
++ lib.optional withGLX [ libX11.dev libGLU.dev libGL.dev libXpm.dev libXext.dev libXxf86vm.dev alsa-lib.dev ]
|
||||
++ lib.optional withSDL [ SDL2.dev ];
|
||||
|
||||
|
@ -74,17 +76,27 @@ let
|
|||
|
||||
dontStrip = target != "release";
|
||||
|
||||
buildPhase = lib.optionalString withDedicated ''
|
||||
postConfigure = ''
|
||||
pushd ../d0_blind_id
|
||||
./configure $configureFlags
|
||||
popd
|
||||
'';
|
||||
|
||||
buildPhase = (lib.optionalString withDedicated ''
|
||||
make -j $NIX_BUILD_CORES -l $NIX_BUILD_CORES sv-${target}
|
||||
'' + lib.optionalString withGLX ''
|
||||
make -j $NIX_BUILD_CORES -l $NIX_BUILD_CORES cl-${target}
|
||||
'' + lib.optionalString withSDL ''
|
||||
make -j $NIX_BUILD_CORES -l $NIX_BUILD_CORES sdl-${target}
|
||||
'') + ''
|
||||
pushd ../d0_blind_id
|
||||
make -j $NIX_BUILD_CORES -l $NIX_BUILD_CORES
|
||||
popd
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
installPhase = ''
|
||||
installPhase = (''
|
||||
for size in 16x16 24x24 32x32 48x48 64x64 72x72 96x96 128x128 192x192 256x256 512x512 1024x1024 scalable; do
|
||||
install -Dm644 ../../misc/logos/xonotic_icon.svg \
|
||||
$out/share/icons/hicolor/$size/xonotic.svg
|
||||
|
@ -95,6 +107,10 @@ let
|
|||
install -Dm755 darkplaces-glx "$out/bin/xonotic-glx"
|
||||
'' + lib.optionalString withSDL ''
|
||||
install -Dm755 darkplaces-sdl "$out/bin/xonotic-sdl"
|
||||
'') + ''
|
||||
pushd ../d0_blind_id
|
||||
make install
|
||||
popd
|
||||
'';
|
||||
|
||||
# Xonotic needs to find libcurl.so at runtime for map downloads
|
||||
|
@ -121,10 +137,10 @@ in rec {
|
|||
xonotic-data = fetchzip {
|
||||
name = "xonotic-data";
|
||||
url = "https://dl.xonotic.org/xonotic-${version}.zip";
|
||||
sha256 = "1ygkh0v68y4sd1w5vpk8dgb65h5jm599hwszdfgjp3ax4d3ml81x";
|
||||
sha256 = "15caj11v9hhr7w55w3rs1rspblzr9lg1crqivbn9pyyq0rif8cpl";
|
||||
extraPostFetch = ''
|
||||
cd $out
|
||||
rm -rf $(ls | grep -v "^data$")
|
||||
rm -rf $(ls | grep -v "^data$" | grep -v "^key_0.d0pk$")
|
||||
'';
|
||||
meta.hydraPlatforms = [];
|
||||
passthru.version = version;
|
||||
|
@ -156,7 +172,7 @@ in rec {
|
|||
copyDesktopItems
|
||||
'' + ''
|
||||
for binary in $out/bin/xonotic-*; do
|
||||
wrapProgram $binary --add-flags "-basedir ${xonotic-data}"
|
||||
wrapProgram $binary --add-flags "-basedir ${xonotic-data}" --prefix LD_LIBRARY_PATH : "${xonotic-unwrapped}/lib"
|
||||
done
|
||||
'');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue