0
0
forked from blender/blender
blender/release/bin/blender-launcher
YimingWu 0f1f0d92bc Fix #124454: Allow BF_DIST_BIN to be a symlink
In `blender-launcher` on linux, the `$0` could be assigned to
a symlink instead of an actual directory, which may cause infinite
chaining of the command which ultimately gives an arguent string that's
way too long. This fix prevents that by using `readlink -f` first.

This fix was implemented by @Joel-Schumacher

Ref: !124533
2024-07-14 20:20:19 +10:00

13 lines
387 B
Bash
Executable File

#!/bin/sh
BF_DIST_BIN=$(dirname $(readlink -f "$0"))
BF_PROGRAM="blender"
# Add own lib folder first, because Steam or other environments may set an
# $LD_LIBRARY_PATH that has priority over the run-path in the Blender executable,
# but contains incompatible libraries.
LD_LIBRARY_PATH=${BF_DIST_BIN}/lib:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
exec "$BF_DIST_BIN/$BF_PROGRAM" "$@"