Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PortProton
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mikhail Tergoev
PortProton
Commits
3018c99e
Commit
3018c99e
authored
Aug 22, 2023
by
Mikhail Tergoev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firt minimal run
parent
77935dcf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
132 additions
and
53 deletions
+132
-53
portproton-cmd
portproton-cmd
+132
-53
No files found.
portproton-cmd
View file @
3018c99e
...
...
@@ -23,6 +23,9 @@ check_variables STAGING_SHARED_MEMORY "1"
check_variables WINE_LARGE_ADDRESS_AWARE
"1"
check_variables WINE_FULLSCREEN_FSR
"1"
check_variables PROTON_DISABLE_LSTEAMCLIENT
"1"
check_variables WINE_DO_NOT_CREATE_DXGI_DEVICE_MANAGER
"0"
check_variables WINE_HEAP_DELAY_FREE
"0"
check_variables WINE_ALLOW_XIM
"0"
check_variables DEBUG 0
if
[[
$DEBUG
!=
1
]]
;
then
...
...
@@ -46,11 +49,11 @@ fi
check_variables PP_WINDOWS_VER
"10"
check_variables PP_USE_GSTREAMER
"1"
check_variables PP_USE_D3D_EXTRAS
"1"
check_variables WINE_WIN_START
"start /wait /high /unix"
check_variables WINE_ALLOW_XIM
"0"
check_variables PP_USE_SHADER_CACHE
"1"
check_variables PP_USE_EAC_AND_BE
"1"
check_variables WINE_WIN_START
"start /wait /high /unix"
if
[[
-z
$WINE_CPU_TOPOLOGY
]]
;
then
check_variables PP_WINE_CPU_TOPOLOGY
"disabled"
else
...
...
@@ -143,10 +146,11 @@ try_force_link_dir () {
}
create_new_dir
()
{
if
[
!
-d
"
$1
"
]
;
then
mkdir
-p
"
$1
"
fi
return
0
for
cnd
in
"
$@
"
;
do
if
[[
!
-d
"
$cnd
"
]]
;
then
mkdir
-p
"
$cnd
"
fi
done
}
try_unpack_file
()
{
...
...
@@ -216,41 +220,22 @@ var_vk_istance_layers_config_update () {
fi
}
##### CHECK WINDOWS FILE #####
check_win_file
()
{
if
[[
-f
"
$1
"
]]
;
then
WIN_FILE_EXEC
=
"
$(
readlink
-f
"
$1
"
)
"
case
"
$(
basename
"
$WIN_FILE_EXEC
"
)
"
in
*
.exe
)
WIN_FILE_TYPE
=
exe
;;
*
.msi
)
WIN_FILE_TYPE
=
msi
;;
*
.bat
)
WIN_FILE_TYPE
=
bat
;;
*
)
print_error
"Unknown file extension."
return
1
;;
esac
WIN_FILE_PATH
=
"
$(
dirname
"
$WIN_FILE_EXEC
"
)
"
return
0
else
print_error
"File not found:
\n
$1
"
return
1
fi
##### CHECK VULKAN LIBRARY #####
check_and_download_d8vk
()
{
for
D8VK_VAR_VER
in
"
$D8VK_VER
"
$@
;
do
if
[[
!
-d
"
${
PP_VULKAN_LIBDIR
}
/d8vk-
$D8VK_VAR_VER
"
]]
;
then
D8VK_URL
=
"https://github.com/AlpyneDreams/d8vk/releases/download/d8vk-v
${
D8VK_VAR_VER
}
/d8vk-v
${
D8VK_VAR_VER
}
.tar.gz"
D8VK_PACKAGE
=
"
${
PP_VULKAN_LIBDIR
}
/d8vk-
${
D8VK_VAR_VER
}
.tar.gz"
if
try_download
"
$D8VK_URL
"
"
$D8VK_PACKAGE
"
;
then
if
try_unpack_file
"
$D8VK_PACKAGE
"
"
$PP_VULKAN_LIBDIR
/d8vk-
$D8VK_VAR_VER
"
then
try_remove_file
"
$D8VK_PACKAGE
"
fi
fi
fi
done
}
##### CHECK CONFIG FILE #####
PP_CONFIG_FILE
=
"
$HOME
/.config/PortProton.conf"
if
[[
!
-f
"
$PP_CONFIG_FILE
"
]]
;
then
if
[[
-z
"
$PORTPROTON_PATH
"
]]
;
then
echo
"export PORTPROTON_PATH=
\"
$PP_DEFAULT_PATH
\"
"
>
"
$PP_CONFIG_FILE
"
else
echo
"export PORTPROTON_PATH=
\"
$PORTPROTON_PATH
\"
"
>
"
$PP_CONFIG_FILE
"
fi
fi
.
"
$PP_CONFIG_FILE
"
PP_VULKAN_LIBDIR
=
"
$PORTPROTON_PATH
/vulkan"
create_new_dir
"
$PP_VULKAN_LIBDIR
"
##### CHECK VULKAN LIBRARY #####
check_and_download_dxvk
()
{
for
DXVK_VAR_VER
in
"
$DXVK_STABLE_VER
"
"
$DXVK_GIT_VER
"
$@
;
do
if
[[
!
-d
"
${
PP_VULKAN_LIBDIR
}
/dxvk-
$DXVK_VAR_VER
"
]]
;
then
...
...
@@ -281,26 +266,120 @@ check_and_download_vkd3d () {
done
}
check_and_download_d8vk
()
{
for
D8VK_VAR_VER
in
"
$D8VK_VER
"
$@
;
do
if
[[
!
-d
"
${
PP_VULKAN_LIBDIR
}
/d8vk-
$D8VK_VAR_VER
"
]]
;
then
D8VK_URL
=
"https://github.com/AlpyneDreams/d8vk/releases/download/d8vk-v
${
D8VK_VAR_VER
}
/d8vk-v
${
D8VK_VAR_VER
}
.tar.gz"
D8VK_PACKAGE
=
"
${
PP_VULKAN_LIBDIR
}
/d8vk-
${
D8VK_VAR_VER
}
.tar.gz"
if
try_download
"
$D8VK_URL
"
"
$D8VK_PACKAGE
"
;
then
if
try_unpack_file
"
$D8VK_PACKAGE
"
"
$PP_VULKAN_LIBDIR
/d8vk-
$D8VK_VAR_VER
"
then
try_remove_file
"
$D8VK_PACKAGE
"
fi
##### INITIAL WINE SETTINGS #####
init_wine_ver
()
{
export
WINEDIR
=
""
if
[[
-n
"
$WINEDIR
"
]]
;
then
export
WINE
=
"
${
WINEDIR
}
/bin/wine"
export
WINELOADER
=
"
${
WINEDIR
}
/bin/wine"
export
WINESERVER
=
"
${
WINEDIR
}
/bin/wineserver"
if
[
!
-z
"
${
PATH
}
"
]
then
export
PATH
=
"
${
WINEDIR
}
/bin:
${
PATH
}
"
else
export
PATH
=
"
${
WINEDIR
}
/bin"
fi
if
[
!
-z
"
${
LD_LIBRARY_PATH
}
"
]
then
export
LD_LIBRARY_PATH
=
"
${
WINEDIR
}
/lib:
${
LD_LIBRARY_PATH
}
"
else
export
LD_LIBRARY_PATH
=
"
${
WINEDIR
}
/lib"
fi
export
WINEDLLPATH
=
"
${
WINEDIR
}
/lib/wine"
if
[
-d
"
${
WINEDIR
}
/lib/gstreamer-1.0"
]
;
then
export
GST_PLUGIN_SYSTEM_PATH_1_0
=
"
${
WINEDIR
}
/lib/gstreamer-1.0"
fi
if
[[
"
${
WINEARCH
}
"
==
"win64"
]]
;
then
export
LD_LIBRARY_PATH+
=
":
${
WINEDIR
}
/lib64"
export
WINEDLLPATH+
=
":
${
WINEDIR
}
/lib64/wine"
if
[
-d
"
${
WINEDIR
}
/lib64/gstreamer-1.0"
]
;
then
export
GST_PLUGIN_SYSTEM_PATH_1_0+
=
":
${
WINEDIR
}
/lib64/gstreamer-1.0"
fi
fi
done
[[
!
-f
"
${
WINEDIR
}
/version"
]]
&&
echo
"
${
PP_WINE_USE
}
"
>
"
${
WINEDIR
}
/version"
if
[[
!
-d
"
${
WINEDIR
}
/lib64/"
]]
&&
[[
-d
"
${
WINEDIR
}
/lib/wine/x86_64-unix"
]]
;
then
create_new_dir
"
${
WINEDIR
}
/lib64/wine"
mv
-f
"
${
WINEDIR
}
/lib/wine/x86_64-unix"
"
${
WINEDIR
}
/lib64/wine/"
mv
-f
"
${
WINEDIR
}
/lib/wine/x86_64-windows"
"
${
WINEDIR
}
/lib64/wine/"
fi
for
mono_gecko_chk
in
"mono"
"gecko"
;
do
if
check_symlink
"
${
WINEDIR
}
/share/wine/
${
mono_gecko_chk
}
"
;
then
echo
"
${
WINEDIR
}
/share/wine/
${
mono_gecko_chk
}
is symlink. OK."
elif
[[
-d
"
${
WINEDIR
}
/share/wine/
${
mono_gecko_chk
}
"
]]
;
then
try_copy_dir
"
${
WINEDIR
}
/share/wine/
${
mono_gecko_chk
}
"
"
${
PP_TMP_DIR
}
"
| sszen
try_remove_dir
"
${
WINEDIR
}
/share/wine/
${
mono_gecko_chk
}
"
try_force_link_dir
"
${
PP_TMP_DIR
}
/
${
mono_gecko_chk
}
"
"
${
WINEDIR
}
"
/share/wine/
echo
"Copy
${
WINEDIR
}
/share/wine/
${
mono_gecko_chk
}
to tmp and create symlink to
${
WINEDIR
}
/share/wine/. OK."
else
try_remove_dir
"
${
WINEDIR
}
/share/wine/
${
mono_gecko_chk
}
"
try_force_link_dir
"
${
PP_TMP_DIR
}
/
${
mono_gecko_chk
}
"
"
${
WINEDIR
}
"
/share/wine
echo
"
${
WINEDIR
}
/share/wine/
${
mono_gecko_chk
}
is broken symlink. Repair... OK."
fi
done
else
# use system WINE
export
WINELOADER
=
wine
fi
}
##### CHECK WINDOWS FILE #####
check_win_file
()
{
if
[[
-f
"
$1
"
]]
;
then
WIN_FILE_EXEC
=
"
$(
readlink
-f
"
$1
"
)
"
case
"
$(
basename
"
$WIN_FILE_EXEC
"
)
"
in
*
.exe
)
WIN_FILE_TYPE_START
=
"
$WINE_WIN_START
"
;;
*
.msi
)
WIN_FILE_TYPE_START
=
"msiexec /i"
;;
*
.bat
)
WIN_FILE_TYPE_START
=
""
;;
*
)
print_error
"Unknown file extension."
return
1
;;
esac
WIN_FILE_PATH
=
"
$(
dirname
"
$WIN_FILE_EXEC
"
)
"
return
0
else
print_error
"File not found:
\n
$1
"
return
1
fi
}
###################### MAIN ######################
##### CHECK SYSTEM CONFIG FILE #####
PP_CONFIG_FILE
=
"
$HOME
/.config/PortProton.conf"
if
[[
!
-f
"
$PP_CONFIG_FILE
"
]]
;
then
if
[[
-z
"
$PORTPROTON_PATH
"
]]
;
then
echo
"export PORTPROTON_PATH=
\"
$PP_DEFAULT_PATH
\"
"
>
"
$PP_CONFIG_FILE
"
else
echo
"export PORTPROTON_PATH=
\"
$PORTPROTON_PATH
\"
"
>
"
$PP_CONFIG_FILE
"
fi
fi
.
"
$PP_CONFIG_FILE
"
PP_VULKAN_LIBDIR
=
"
$PORTPROTON_PATH
/vulkan"
PP_PREFIXES_DIR
=
"
$PORTPROTON_PATH
/prefixes"
PP_DIST_DIR
=
"
$PORTPROTON_PATH
/dist"
PP_TMP_DIR
=
"
$PORTPROTON_PATH
/tmp"
create_new_dir
"
$PP_VULKAN_LIBDIR
"
"
$PP_TMP_DIR
"
"
$PP_DIST_DIR
"
"
$PP_PREFIXES_DIR
"
##### CHECK USER CONFIG FILE #####
PP_USER_CONF
=
"
$PORTPROTON_PATH
/user.conf"
if
[[
!
-f
"
$PP_USER_CONF
"
]]
;
then
echo
"#!/usr/bin/env bash"
>
"
$PP_USER_CONF
"
echo
"# User overides db and var settings..."
>>
"
$PP_USER_CONF
"
fi
.
"
$PP_USER_CONF
"
check_win_file
"
$1
"
check_and_download_d8vk
check_and_download_dxvk
check_and_download_vkd3d
check_and_download_d8vk
init_wine_ver
# check_win_file "$1
"
# print_var WIN_FILE_EXEC WIN_FILE_TYPE WIN_FILE_PATH PP_DEFAULT_PATH PORTPROTON_PATH
cd
"
$WIN_FILE_PATH
"
"
$WINELOADER
"
"
$WIN_FILE_EXEC
"
exit
0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment