14 , writeShellApplication
17 stdenvNoCC.mkDerivation {
18 pname = "steamtinkerlaunch";
19 version = "12.12-unstable-2024-05-03";
21 src = fetchFromGitHub {
23 repo = "steamtinkerlaunch";
24 rev = "59b421b2f3686120a076909a4a158824cd4ef05e";
25 hash = "sha256-CGtSGAm+52t2zFsPJEsm76w+FEHhbOd9NYuerGa31tc=";
28 outputs = [ "out" "steamcompattool" ];
30 installFlags = [ "PREFIX=\${out}" ];
32 nativeBuildInputs = let
33 # We need a `steam` command in order to install the compat tool
34 fakeSteam = writeShellApplication {
44 # We (ab)use writeShellApplication to produce a header for a shell script
45 # here in order to add the runtimePath to the original script. We cannot
46 # wrap here as that always corrupts $0 in bash scripts which STL uses to
47 # install its compat tool.
48 header = writeShellApplication {
67 fakeYad = writeShellApplication {
69 text = "echo ${yad.version} FAKE";
73 cp $out/bin/steamtinkerlaunch $TMPDIR/steamtinkerlaunch
74 install ${lib.getExe header} -T $out/bin/steamtinkerlaunch
75 tail -n +2 $TMPDIR/steamtinkerlaunch >> $out/bin/steamtinkerlaunch
77 # Create a fake steam dir, it checks this and reads a few values
78 steamdir=$TMPDIR/.local/share/Steam/
79 mkdir -p $steamdir/config/
80 echo \"path\" \"$steamdir\" > $steamdir/config/config.vdf
82 ln -s $steamdir $TMPDIR/.steam/steam
84 cp -a $out/bin/steamtinkerlaunch $TMPDIR/steamtinkerlaunch
85 # yad cannot print its version without a graphical session https://github.com/v1cont/yad/issues/277
86 substituteInPlace $TMPDIR/steamtinkerlaunch --replace ${yad} ${fakeYad}
87 HOME=$TMPDIR $TMPDIR/steamtinkerlaunch compat add
89 cp -a $steamdir/compatibilitytools.d/SteamTinkerLaunch $steamcompattool
90 # It creates this symlink but it points to $TMPDIR
91 ln -sfn $out/bin/steamtinkerlaunch $steamcompattool/
95 description = "Linux wrapper tool for use with the Steam client for custom launch options and 3rd party programs";
96 mainProgram = "steamtinkerlaunch";
97 homepage = "https://github.com/sonic2kk/steamtinkerlaunch";
98 license = licenses.gpl3;
99 maintainers = with maintainers; [ urandom surfaceflinger ];
100 platforms = lib.platforms.linux;