Skip to content

Instantly share code, notes, and snippets.

@shmerl
Last active November 3, 2023 05:15
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save shmerl/a2867c5a675ed1795f03326b32b47fe7 to your computer and use it in GitHub Desktop.
Environment setting for custom Wine usage
#!/bin/bash
# Helper script for wine_run.sh / winetricks_run.sh
# Sets environment. See wine_run.sh for details on
# configurable variables usage.
# $wine variable is a shortcut, setting /opt/$wine for $wine_path
# But explicitly set $wine_path takes priority.
if [[ "${wine+isset}" ]] && ! [[ "${wine_path+isset}" ]]; then
wine_path="/opt/${wine}"
fi
if [[ "${wine_path+isset}" ]]; then
export PATH=${wine_path}/bin:$PATH
if [[ -e "${wine_path}/lib64/wine/x86_64-unix" ]]; then
export LD_LIBRARY_PATH="${wine_path}/lib64/wine/x86_64-unix:${LD_LIBRARY_PATH}"
fi
if [[ -e "${wine_path}/lib/wine/x86_64-unix" ]]; then
export LD_LIBRARY_PATH="${wine_path}/lib/wine/x86_64-unix:${LD_LIBRARY_PATH}"
fi
if [[ -e "${wine_path}/lib/wine/i386-unix" ]]; then
export LD_LIBRARY_PATH="${wine_path}/lib/wine/i386-unix:${LD_LIBRARY_PATH}"
fi
fi
# Since 64-bit prefixes are now universal, by default using wine64 binary.
# Once Wine will unify everything in a 64-bit wine binary, this can be changed.
# If you want to force wine binary instead of wine64, use $wine_bin variable.
export wine_bin=${wine_bin:-"wine64"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment