Skip to content

Commit

Permalink
Proton-tkg: Fix makepkg builds following the prefix system changes + …
Browse files Browse the repository at this point in the history
…cleanups
  • Loading branch information
Tk-Glitch committed Apr 24, 2021
1 parent 88fedc4 commit c8cf6cf
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 36 deletions.
28 changes: 22 additions & 6 deletions proton-tkg/proton-tkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,14 @@ function steam_is_running {
fi
}

function wine_is_running {
if pgrep -x wineserver >/dev/null; then
echo -e "\n Wineserver is running. Waiting for it to finish..."
sleep 3
wine_is_running
fi
}

function proton_tkg_uninstaller {
# Never cross the Proton streams!
i=0
Expand Down Expand Up @@ -649,7 +657,8 @@ else
# Grab conf template and inject version
echo "$_versionpre" "proton-tkg-$_protontkg_true_version" > "proton_tkg_$_protontkg_version/version" && cp "proton_template/conf"/* "proton_tkg_$_protontkg_version"/ && sed -i -e "s|TKGVERSION|$_protontkg_version|" "proton_tkg_$_protontkg_version/compatibilitytool.vdf"

cp "$_nowhere"/proton_template/steampipe_fixups.py "$_nowhere"/"proton_tkg_$_protontkg_version"/
# steampipe fixups
#cp "$_nowhere"/proton_template/steampipe_fixups.py "$_nowhere"/"proton_tkg_$_protontkg_version"/

# Patch our proton script to use the current proton tree prefix version value
_prefix_version=$(cat "$_nowhere/Proton/proton" | grep "CURRENT_PREFIX_VERSION=")
Expand Down Expand Up @@ -759,11 +768,6 @@ else
echo "Fixing PE files..."
find "$_nowhere"/"proton_tkg_$_protontkg_version"/ -type f -name "*.dll" -printf "%p\0" | xargs --verbose -0 -r -P8 -n3 "$_nowhere/proton_template/pefixup.py" >"$_nowhere"/pefixup.log 2>&1

# Generate default prefix
#echo ''
#echo "Generating default prefix..."
#python3 "$_nowhere"/proton_template/default_pfx.py "$_nowhere"/"proton_tkg_$_protontkg_version"/files/share/default_pfx/ "$_nowhere"/"proton_tkg_$_protontkg_version"/files

# steampipe fixups
#python3 "$_nowhere"/proton_template/steampipe_fixups.py process "$_nowhere"/"proton_tkg_$_protontkg_version"

Expand Down Expand Up @@ -806,6 +810,18 @@ else
echo ""
echo "####################################################################################################"
fi
else
# Generate default prefix
echo ''
echo "Generating default prefix..."
mkdir "$_nowhere"/"proton_tkg_$_protontkg_version"/files/share/default_pfx
WINEPREFIX="$_nowhere/proton_tkg_$_protontkg_version/files/share/default_pfx" "$_nowhere/proton_tkg_$_protontkg_version"/files/bin/wineboot -u
wine_is_running
for _d in "$_nowhere/proton_tkg_$_protontkg_version/files/share/default_pfx/dosdevices"; do
if [ "$_d" != "c:" ]; then
rm -rf "$_d"
fi
done
fi
else
rm "$_nowhere"/proton_tkg_token
Expand Down
23 changes: 0 additions & 23 deletions proton-tkg/proton_template/conf/proton
Original file line number Diff line number Diff line change
Expand Up @@ -172,28 +172,6 @@ class Proton:
if os.path.exists(old_dist_dir):
shutil.rmtree(old_dist_dir)

def do_steampipe_fixups(self):
fixups_json = self.path("steampipe_fixups.json")
fixups_mtime = self.path("files/steampipe_fixups_mtime")

if os.path.exists(fixups_json):
with self.dist_lock:
import steampipe_fixups

current_fixup_mtime = None
if os.path.exists(fixups_mtime):
with open(fixups_mtime, "r") as f:
current_fixup_mtime = f.readline().strip()

new_fixup_mtime = getmtimestr(fixups_json)

if current_fixup_mtime != new_fixup_mtime:
result_code = steampipe_fixups.do_restore(self.base_dir, fixups_json)

if result_code == 0:
with open(fixups_mtime, "w") as f:
f.write(new_fixup_mtime + "\n")

def missing_default_prefix(self):
'''Check if the default prefix dir is missing. Returns true if missing, false if present'''
return not os.path.isdir(self.default_pfx_dir)
Expand Down Expand Up @@ -1009,7 +987,6 @@ if __name__ == "__main__":
g_proton = Proton(os.path.dirname(sys.argv[0]))

g_proton.cleanup_legacy_dist()
g_proton.do_steampipe_fixups()

g_compatdata = CompatData(os.environ["STEAM_COMPAT_DATA_PATH"])

Expand Down
23 changes: 16 additions & 7 deletions proton-tkg/proton_template/makepkg_adjustments.patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ index 811de5e..7aacb34 100755

def path(self, d):
return self.base_dir + d
@@ -175,7 +175,7 @@ class Proton:
@@
makedirs(self.prefix_dir + "/drive_c")
set_dir_casefold_bit(self.prefix_dir + "/drive_c")

def do_steampipe_fixups(self):
fixups_json = self.path("steampipe_fixups.json")
- fixups_mtime = self.path("files/steampipe_fixups_mtime")
+ fixups_mtime = ("/tmp/steampipe_fixups_mtime")
- if not os.path.exists(self.prefix_dir + "/user.reg"):
- self.copy_pfx()

if os.path.exists(fixups_json):
with self.dist_lock:
# collect configuration info
if "STEAM_COMPAT_CLIENT_INSTALL_PATH" in os.environ:
@@ -789,6 +789,7 @@ class Session:
if local_env is None:
local_env = self.env
Expand All @@ -34,3 +34,12 @@ index 811de5e..7aacb34 100755

def run(self):
if "PROTON_DUMP_DEBUG_COMMANDS" in self.env and nonzero(self.env["PROTON_DUMP_DEBUG_COMMANDS"]):
@@ -994,8 +994,6 @@ if __name__ == "__main__":

g_session.init_wine()

- if g_proton.missing_default_prefix():
- g_proton.make_default_prefix()

g_session.init_session()

0 comments on commit c8cf6cf

Please sign in to comment.