Skip to content

Commit

Permalink
Merge pull request #68 from hartwork/issue-55-support-wine-upstream-d…
Browse files Browse the repository at this point in the history
…ebian-packages

Start supporting Wine upstream's Debian package locations (fixes #55)
  • Loading branch information
hartwork authored Oct 27, 2024
2 parents db0be5d + f25e4e1 commit 452cab4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sandwine/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import os
import random
import shlex
import shutil
import signal
import subprocess
import sys
Expand Down Expand Up @@ -359,6 +360,19 @@ def create_bwrap_argv(config):
mount_tasks += [MountTask(MountMode.TMPFS, dotwine_target_path)]
del dotwine_target_path

# More Wine: Mount the place that upstream's Debian packages installed to
# if(!) that's the Wine we'll be running
if config.with_wine and (wine_bin_abs_path := shutil.which("wine")) is not None:
resolved_wine_bin_abs_path = os.path.realpath(wine_bin_abs_path)
for wine_opt_prefix in (
"/opt/wine-devel/",
"/opt/wine-stable/",
"/opt/wine-staging/",
):
if resolved_wine_bin_abs_path.startswith(wine_opt_prefix):
mount_tasks += [MountTask(MountMode.BIND_RO, wine_opt_prefix.rstrip("/"))]
break

# Extra binds
for bind in config.extra_binds:
mount_target_orig, mount_access = parse_path_colon_access(bind)
Expand Down

0 comments on commit 452cab4

Please sign in to comment.