snapcrafters / sommelier-core

Package a Windows application for Linux using a Snap with Wine.
MIT License
30 stars 10 forks source link
snap wine

Sommelier Core Scripts

This repository contains the sommelier script which helps you put a Windows application in a snap. This is a wrapper script which runs when your snap starts. It initializes and tweaks Wine, installs your application and runs it.

Note: many Wine snaps were originally built by copying the sommelier script and modifying it. This made it hard to maintain and update that script. The goal of this repository is to create a single version of the sommelier script which can be used by every snapped Wine application without modification. Is this script not working for your application? Please let me know! Contributions are welcome!

Pros:

How to use

Step by step

  1. Add the following part to your snapcraft.yaml:
    parts:
      sommelier-core:
        plugin: make
        source: https://github.com/snapcrafters/sommelier-core.git
        source-branch: "1.0"
  2. Add the following plug definitions:
    plugs:
      wine-runtime:
        interface: content
        target: $SNAP/wine-runtime
        default-provider: wine-platform-runtime
      wine-5-stable: # number must match the number in default-provider
        interface: content
        target: $SNAP/wine-platform
        default-provider: wine-platform-5-stable # must be a valid snap
    • WINE version snaps are named wine-platform-[version]-[branch] where:
      • Version is one of 4, 5, or 6
      • And branch is one of stable, staging, or devel
      • Or, version is 3 and branch is stable
    • There is only one WINE runtime snap, which is named wine-platform-runtime.
  3. Add the following apps:
    apps:
      my-windows-app:
        extensions: [gnome-3-28]
        command: bin/sommelier run-exe
        environment:
          RUN_EXE: C:\path\to\installed\executable.exe
          INSTALL_URL: http://example.com/installer.exe
          INSTALL_FLAGS: /silent # optional commandline flags to pass to the installer
        plugs: # change these as required
        - home
        - network
        - network-bind
        - removable-media
      wine:
        extensions: [gnome-3-28]
        command: bin/sommelier
        plugs:
          - home
          - network
      winetricks:
        extensions: [gnome-3-28]
        command: bin/sommelier winetricks
        plugs:
          - home
          - network

Example Snaps

See the following snaps for complete examples of how to use sommelier-core.

Variables

Compatibility

This repository uses branches for stable and backwards-compatible releases. For example, all updates to the "1.0" branch of this repository will be backwards compatible. Set the source-branch property of the sommelier part in your snapcraft.yaml file to use a stable version.

parts:
  sommelier:
    plugin: make
    source: https://github.com/snapcrafters/sommelier-core.git
    source-branch: "1.0"

Development and debugging variables

License