add mainprogram wrapper

This commit is contained in:
Robin Appelman 2026-07-08 01:37:56 +02:00
commit 34b1e8d540

View file

@ -57,6 +57,11 @@
patches = (prev.patches or []) ++ [./curl-symbol-downgrade.patch]; patches = (prev.patches or []) ++ [./curl-symbol-downgrade.patch];
} }
); );
mainProgram =
if system == "x86_64-linux"
then "srcds_run_64"
else "srcds_run";
in in
stdenvNoCC.mkDerivation { stdenvNoCC.mkDerivation {
pname = "srcds-tf2"; pname = "srcds-tf2";
@ -82,10 +87,17 @@ in
echo 440 > $out/steam_appid.txt echo 440 > $out/steam_appid.txt
mkdir -p $out/bin
echo "#! /bin/sh" > $out/bin/${mainProgram}
echo "exec $out/${mainProgram} "'$@' >> $out/bin/${mainProgram}
chmod +x $out/bin/${mainProgram}
runHook postInstall runHook postInstall
''; '';
meta = with lib; { meta = with lib; {
inherit mainProgram;
description = "TF2 dedicated server"; description = "TF2 dedicated server";
homepage = "https://steamdb.info/app/440/"; homepage = "https://steamdb.info/app/440/";
changelog = "https://store.steampowered.com/news/app/440?updates=true"; changelog = "https://store.steampowered.com/news/app/440?updates=true";