Scripts version 1036

This commit is contained in:
castro-fidel
2021-04-19 20:56:47 +03:00
parent 56c3da7d16
commit c4cab73dbb
16 changed files with 835 additions and 74 deletions

View File

@ -132,12 +132,16 @@ if [ ! -e "${PORT_WINE_TMP_PATH}/${portname}_ver" ]; then
echo "10" > "${PORT_WINE_TMP_PATH}/${portname}_ver"
fi
export pw_libs_ver="_v7"
export pw_libs_ver="_v8"
export mono_ver="6.1.1"
export gecko_ver="2.47.2"
export PW_DXVK_VER=1.8.1
export PW_VKD3D_VER=2.2
export url_mono="https://github.com/madewokherd/wine-mono/releases/download/wine-mono-${mono_ver}/wine-mono-${mono_ver}-x86.tar.xz"
export url_gecko_x86="https://dl.winehq.org/wine/wine-gecko/${gecko_ver}/wine-gecko-${gecko_ver}-x86.tar.xz"
export url_gecko_x86_64="https://dl.winehq.org/wine/wine-gecko/${gecko_ver}/wine-gecko-${gecko_ver}-x86_64.tar.xz"
export url_dxvk="https://github.com/doitsujin/dxvk/releases/download/v${PW_DXVK_VER}/dxvk-${PW_DXVK_VER}.tar.gz"
export url_vkd3d="https://github.com/HansKristian-Work/vkd3d-proton/releases/download/v${PW_VKD3D_VER}/vkd3d-proton-${PW_VKD3D_VER}.tar.zst"
export WINEARCH=win64
export PW_VULKAN_DLL="${PORT_WINE_PATH}"/data/vulkan
export WINEDIR="${PORT_WINE_PATH}"/data/dist
@ -151,6 +155,7 @@ export PW_FTP_URL="https://portwine-linux.ru/ftp"
export PW_TERM=""
export PW_WINE_VER_DXVK=""
export PW_WINDOWS_VER="7"
export PW_FORCE_LARGE_ADDRESS_AWARE=1
export PW_LOG=0
var_winedlloverride_update "winemenubuilder.exe="
@ -181,7 +186,8 @@ if [ -z "${INSTALLING_PORT}" ] ; then
try_remove_dir "${WINELIB}/pinned_libs_64"
export pw_yad="${WINELIB}/usr/bin/yad"
if [ -x "`which xterm 2>/dev/null`" ]; then
export PW_XTERM="xterm -geometry 159x37 -e"
export SYS_XTERM=`which xterm`
export PW_XTERM="${SYS_XTERM} -geometry 159x37 -e"
else
export PW_XTERM="${WINELIB}/amd64/usr/bin/xterm -geometry 159x37 -e"
fi
@ -244,18 +250,16 @@ if [ -z "${INSTALLING_PORT}" ] ; then
fi
START_PORTWINE ()
{
if [ "${PW_USE_TERMINAL}" = "1" ]; then
if [ -x "`which konsole 2>/dev/null`" ]; then
export PW_TERM="konsole -e"
elif [ -x "`which xterm 2>/dev/null`" ]; then
export PW_TERM="xterm -e"
elif [ -x "`which gnome-terminal 2>/dev/null`" ]; then
export PW_TERM="gnome-terminal -- $SHELL -c"
elif [ -x "`which lxterminal 2>/dev/null`" ]; then
export PW_TERM="lxterminal -e"
else
export PW_TERM="${PW_XTERM}"
fi
if [ -x "`which konsole 2>/dev/null`" ]; then
export PW_TERM="konsole --nofork -e"
elif [ -x "`which xterm 2>/dev/null`" ]; then
export PW_TERM="${PW_XTERM}"
elif [ -x "`which gnome-terminal 2>/dev/null`" ]; then
export PW_TERM="gnome-terminal -- $SHELL -c"
elif [ -x "`which lxterminal 2>/dev/null`" ]; then
export PW_TERM="lxterminal -e"
else
export PW_TERM="${PW_XTERM}"
fi
if [ -z "${INSTALLING_PORT}" ] ; then
PW_UPDATE
@ -266,7 +270,7 @@ START_PORTWINE ()
else
read "var_pw_vulkan" < "${PORT_WINE_TMP_PATH}/pw_vulkan" && export var_pw_vulkan
fi
PW_START_PROGRESS_BAR
PW_START_PROGRESS_BAR
if [ "${var_pw_vulkan}" = "0" ]; then
if [ -d "${WINEDIR}_dxvk" ]; then
export WINEDIR="${WINEDIR}_dxvk"
@ -284,7 +288,6 @@ START_PORTWINE ()
try_copy_file "${WINEDIR}"/lib/wine/fakedlls/dxgi.dll "${WINEPREFIX}/drive_c/windows/syswow64/"
try_copy_file "${WINEDIR}"/lib64/wine/fakedlls/dxgi.dll "${WINEPREFIX}/drive_c/windows/system32/"
var_winedlloverride_update "dxgi=b"
export PW_FORCE_LARGE_ADDRESS_AWARE=0
[ "${PW_MANGOHUD}" == "1" ] && export MANGOHUD_DLSYM=1
echo "Use OpenGL"
elif [ "${var_pw_vulkan}" = "dxvk" ]; then
@ -296,25 +299,32 @@ START_PORTWINE ()
try_copy_file "${PW_VULKAN_DLL}/dxvk/x64/${wine_dxvk_dll}.dll" "${WINEPREFIX}/drive_c/windows/system32/"
[ "$?" == 0 ] && var_winedlloverride_update "${wine_dxvk_dll}=n"
done
var_winedlloverride_update "d3d12="
[ "${PW_MANGOHUD}" == "1" ] && export MANGOHUD=1
echo "Use DXVK (DX9-DX11 to Vulkan)"
else
if [ -d "${WINEDIR}_vkd3d" ]; then
export WINEDIR="${WINEDIR}_vkd3d"
fi
for wine_vkd3d_dll in d3d12 libvkd3d-proton-utils-2 ; do
for wine_vkd3d_dll in d3d12 ; do
try_copy_file "${PW_VULKAN_DLL}/vkd3d-proton/x86/${wine_vkd3d_dll}.dll" "${WINEPREFIX}/drive_c/windows/syswow64/"
try_copy_file "${PW_VULKAN_DLL}/vkd3d-proton/x64/${wine_vkd3d_dll}.dll" "${WINEPREFIX}/drive_c/windows/system32/"
[ "$?" == 0 ] && var_winedlloverride_update "${wine_vkd3d_dll}=n"
done
if [ ! -z "${PW_DXGI_FROM_DXVK}" ] && [ "${PW_DXGI_FROM_DXVK}" != 0 ] ; then
try_copy_file "${PW_VULKAN_DLL}/dxvk/x32/dxgi.dll" "${WINEPREFIX}/drive_c/windows/syswow64/"
try_copy_file "${PW_VULKAN_DLL}/dxvk/x64/dxgi.dll" "${WINEPREFIX}/drive_c/windows/system32/"
var_winedlloverride_update "dxgi=n"
for wine_dxvk_dll in d3d11 d3d10 d3d10core d3d10_1 d3d9 dxgi ; do
try_copy_file "${PW_VULKAN_DLL}/dxvk/x32/${wine_dxvk_dll}.dll" "${WINEPREFIX}/drive_c/windows/syswow64/"
try_copy_file "${PW_VULKAN_DLL}/dxvk/x64/${wine_dxvk_dll}.dll" "${WINEPREFIX}/drive_c/windows/system32/"
done
else
try_copy_file "${WINEDIR}/lib/wine/fakedlls/dxgi.dll" "${WINEPREFIX}/drive_c/windows/syswow64/"
try_copy_file "${WINEDIR}/lib64/wine/fakedlls/dxgi.dll" "${WINEPREFIX}/drive_c/windows/system32/"
var_winedlloverride_update "dxgi=b"
for wine_build_dll in d3d11 d3d10 d3d10core d3d10_1 d3d9 ; do
try_copy_file "${WINEDIR}/lib/wine/${wine_build_dll}.dll" "${WINEPREFIX}/drive_c/windows/syswow64/"
try_copy_file "${WINEDIR}/lib64/wine/${wine_build_dll}.dll" "${WINEPREFIX}/drive_c/windows/system32/"
done
fi
[ "${PW_MANGOHUD}" == "1" ] && export MANGOHUD=1
export PW_WINDOWS_VER="10"
@ -374,11 +384,11 @@ START_PORTWINE ()
export WINE_MONO_OVERRIDES="Microsoft.Xna.Framework.*,Gac=n"
if [ ! -z "${PW_NO_ESYNC}" ] && [ "${PW_NO_ESYNC}" != 0 ]
then export WINEESYNC=""
then export WINEESYNC="0"
else export WINEESYNC="1"
fi
if [ ! -z "${PW_NO_FSYNC}" ] && [ "${PW_NO_FSYNC}" != 0 ] ; then
export WINEFSYNC=""
export WINEFSYNC="0"
export WINEFSYNC_FUTEX2="0"
else
export WINEFSYNC="1"
@ -418,7 +428,7 @@ START_PORTWINE ()
export DXVK_STATE_CACHE_PATH="${PORT_WINE_TMP_PATH}"/dxvk_cache
export DXVK_STATE_CACHE=1
export STAGING_SHARED_MEMORY=1
export optirun_on=
export optirun_on=""
export check_optimus_manager=
export PW_NVIDIA="$(lspci | grep NVIDIA)"
if [ -x "`which optimus-manager 2>/dev/null`" ]; then
@ -457,7 +467,7 @@ START_PORTWINE ()
export vblank_mode=1
export __GL_SYNC_TO_VBLANK=1 ;;
esac
#export DXVK_CONFIG_FILE="${PORT_WINE_PATH}/data/"
export DXVK_CONFIG_FILE="${PORT_WINE_PATH}/data/dxvk.conf"
export int_xneur=0
if [ $(pgrep xneur)>'0' ]; then
killall xneur
@ -544,7 +554,7 @@ RUN_WINETRICKS_FROM_DB () {
if [ "${USE_WT_FROM_DB}" == "1" ] ; then
UPDATE_WINETRICKS
PW_STOP_PROGRESS_BAR
${PW_XTERM} "${PW_RUNTIME}" "${PORT_WINE_TMP_PATH}/winetricks" -q ${PW_DLL_INSTALL}
${PW_TERM} "${PW_RUNTIME}" "${PORT_WINE_TMP_PATH}/winetricks" -q ${PW_DLL_INSTALL}
PW_START_PROGRESS_BAR
fi
PW_START_PROGRESS_BAR
@ -636,7 +646,7 @@ PW_CREATE_PFX () {
sed -i '/HKCR,steam\\shell\\open\\command/d' "${WINEDIR}"*/share/wine/wine.inf
sed -i '/HKCR,steam\\shell\\open\\command/d' "${WINEDIR}"*/share/wine/wine.inf
PW_STOP_PROGRESS_BAR
${PW_XTERM} "${PW_RUNTIME}" "${WINELOADER}" wineboot -u
${PW_TERM} "${PW_RUNTIME}" "${WINELOADER}" wineboot -u
`zenity --info --title "Info..." --text " Updating prefix completed successfully.\n\n Restart ${portname}." --no-wrap ` > /dev/null 2>&1
exit 0
fi
@ -678,25 +688,24 @@ PW_RUN () {
export RUN_MANGOHUD=""
[ "${PW_MANGOHUD}" == "1" ] && export RUN_MANGOHUD=mangohud
print_var "WINEDIR" "WINEARCH" "WINEPREFIX" "WINEDLLOVERRIDES" "PATH_TO_GAME"
if [ "${PW_LOG}" == 1 ]
then export PW_LOG_TO_FILE="${PORT_WINE_PATH}/${portname}.log"
else export PW_LOG_TO_FILE="/dev/null"
fi
if [ ! -z "${PW_GAMEMODERUN}" ] && [ "${PW_GAMEMODERUN}" != 0 ] ; then
if [ ! -z ${optirun_on} ]; then
echo "Full command line: ${optirun_on} $PW_TERM "${PW_RUNTIME}" gamemoderun ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}" ${PW_LOG_TO_FILE}
${optirun_on} $PW_TERM "${PW_RUNTIME}" gamemoderun ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]} &>>"${PW_LOG_TO_FILE}"
else
echo "Full command line: $PW_TERM "${PW_RUNTIME}" gamemoderun ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}" ${PW_LOG_TO_FILE}
$PW_TERM "${PW_RUNTIME}" gamemoderun ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]} &>>"${PW_LOG_TO_FILE}"
if [ "${PW_LOG}" == 1 ] ; then
export PW_TERM=""
export PW_LOG_TO_FILE="${PORT_WINE_PATH}/${portname}.log"
if [ ! -z "${PW_GAMEMODERUN}" ] && [ "${PW_GAMEMODERUN}" != 0 ] ; then
echo "Full command line: $PW_TERM ${optirun_on} "${PW_RUNTIME}" gamemoderun ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}" "&>>${PW_LOG_TO_FILE}"
$PW_TERM ${optirun_on} "${PW_RUNTIME}" gamemoderun ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]} &>>"${PW_LOG_TO_FILE}"
else
echo "Full command line: $PW_TERM ${optirun_on} "${PW_RUNTIME}" ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}" "&>>${PW_LOG_TO_FILE}"
$PW_TERM ${optirun_on} "${PW_RUNTIME}" ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]} &>>"${PW_LOG_TO_FILE}"
fi
else
if [ ! -z ${optirun_on} ]; then
echo "Full command line: ${optirun_on} $PW_TERM "${PW_RUNTIME}" ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}" ${PW_LOG_TO_FILE}
${optirun_on} $PW_TERM "${PW_RUNTIME}" ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]} &>>"${PW_LOG_TO_FILE}"
else
echo "Full command line: $PW_TERM "${PW_RUNTIME}" ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}" ${PW_LOG_TO_FILE}
$PW_TERM "${PW_RUNTIME}" ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]} &>>"${PW_LOG_TO_FILE}"
else
[ "${PW_USE_TERMINAL}" != "1" ] && export PW_TERM=""
if [ ! -z "${PW_GAMEMODERUN}" ] && [ "${PW_GAMEMODERUN}" != 0 ] ; then
echo "Full command line: $PW_TERM ${optirun_on} "${PW_RUNTIME}" gamemoderun ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}"
$PW_TERM ${optirun_on} "${PW_RUNTIME}" gamemoderun ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}
else
echo "Full command line: $PW_TERM ${optirun_on} "${PW_RUNTIME}" ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}"
$PW_TERM ${optirun_on} "${PW_RUNTIME}" ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}
fi
fi
}