Building Eve Online in a snap

Hey guys,

has anyone ever tried to snap a game running with wine? Per example Eve Online?

I did try but it sadly doesn’t work.

So far that’s what I got

name: eve-online
version: 1104891
description: Eve online on Linux using Wine
summary: Play Eve Online on Linux
grade: stable
confinement: strict

parts:
    eve-online:
        plugin: dump
        source: https://binaries.eveonline.com/evelauncher-1104891.tar.gz
        stage-packages:
                - libc6
                - libglu1-mesa:i386
                - libtxc-dxtn-s2tc0:i386
                - wine:i386
                - libc6:i386
                - glibc

apps:
    eve-online:
       command: evelauncher.sh
       plugs: [ home, network, alsa, desktop, opengl, x11]

When I install it and try to run it, here is the ouput:

  /snap/eve-online/x1/evelauncher: error while loading shared libraries: libGL.so.1: wrong ELF class: ELFCLASS32

If I am going for the 64 bits packages, I am getting :

This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, xcb.

Reinstalling the application may fix this problem.
Aborted (core dumped)

I added multiple packages like qt5-base, qt5-dbus and qt5-gui but I would get the same message.

If anyone has a clue what to do, don’t be shy!

EDIT 1 :

Using both of your examples I am getting an error saying that I have no candidates for libpng12. I tried to add it manually but it tells me that it got to be available outside of the snap. I then changed wine to be for the same distro version than I am which is Ubuntu 17.10. It still didn’t work obviously becuase of libpng12 so I decided to remove it. It asks me to install libc6 so I did.

name: eve-online
version: 1104891
description: Eve online on Linux using Wine
summary: Play Eve Online on Linux
grade: stable
confinement: strict

parts:
  eve-online:
      plugin: dump
      source: https://binaries.eveonline.com/evelauncher-1104891.tar.gz
  enable-i386:
    plugin: nil
    prepare: |
      dpkg --add-architecture i386
      apt update
  wine-3p1:
    after: [enable-i386]
    plugin: dump
    source: https://dl.winehq.org/wine-builds/ubuntu/pool/main/wine-stable-i386_3.0.0~artful_i386.deb
    source-type: deb
    install: |
      spi=$SNAPCRAFT_PART_INSTALL
      lins=$spi/usr/share/lintian
      docs=$spi/usr/share/doc
      mans=$spi/usr/share/man
      ws=opt/wine-stable
      cp -r $ws/* $spi/ && cp -r $spi/share $spi/usr/ && rm -r $spi/opt $spi/share $mans $lins $docs
    stage-packages:
    - on i386:
      - libfreetype6
      - libncurses5
      - libgnutls30
      - libxext6
      - libudev1
      - libc6
      - libxrender1
      - zlib1g
    - on amd64:
      - libfreetype6:i386
      - libncurses5:i386
      - libgnutls30:i386
      - libxext6:i386
      - libudev1:i386
      - libc6:i386
      - libxrender1:i386
      - zlib1g:i386
      - libc6

  wine-3p2:
    plugin: dump
    source: https://dl.winehq.org/wine-builds/ubuntu/pool/main/wine-stable_3.0.0~artful_i386.deb
    source-type: deb
    install: |
      spi=$SNAPCRAFT_PART_INSTALL
      docs=$spi/usr/share/doc
      mans=$spi/share/man
      ws="opt/wine-stable"
      cp -r $ws/* $spi/ && rm -r $spi/opt $docs $mans $spi/share/wine/fonts
 
apps:
    eve-online:
       command: ./evelauncher.sh
       plugs:
          - desktop
          - desktop-legacy
          - network
          - network-bind
          - opengl
          - process-control
          - pulseaudio
          - wayland
          - x11 

here is a link to the error I am getting : snapcraft_error.txt

Yes, I’ve put a lot of work into getting WINE snapped. It’s still suffering issues which cannot be overcome yet, such as requiring ptrace capability which is currently denied by confinement.

The following plugs are required:

    plugs:
    - desktop
    - desktop-legacy
    - network
    - network-bind
    - opengl
    - process-control
    - pulseaudio
    - wayland
    - x11

The WINE build parts are as below:

parts:
  add-architecture:
    plugin: nil
    prepare: |
      if [ "$(uname -m)" = "x86_64" ]; then
        dpkg --add-architecture i386
        apt-get update
        apt-get install -yqq \
          'libcapi20-dev:i386' \
          'libcups2-dev:i386' \
          'libdbus-1-dev:i386' \
          'libfontconfig-dev:i386' \
          'libfreetype6-dev:i386' \
          'libgl-dev:i386' \
          'libglu-dev:i386' \
          'libgnutls-dev:i386' \
          'libgphoto2-dev:i386' \
          'libgsm1-dev:i386' \
          'libgstreamer1.0-dev:i386' \
          'libgstreamer-plugins-base1.0-dev:i386' \
          'libjpeg-dev:i386' \
          'libjson-c-dev:i386' \
          'libkrb5-dev:i386' \
          'liblcms2-dev:i386' \
          'libldap2-dev:i386' \
          'libmpg123-dev:i386' \
          'libncurses5-dev:i386' \
          'libnet1-dev:i386' \
          'libopenal-dev:i386' \
          'libosmesa6-dev:i386' \
          'libpng12-dev:i386' \
          'libpulse-dev:i386' \
          'libsane-dev:i386' \
          'libtiff-dev:i386' \
          'libv4l-dev:i386' \
          'libx11-dev:i386' \
          'libxcomposite-dev:i386' \
          'libxcursor-dev:i386' \
          'libxext-dev:i386' \
          'libxi-dev:i386' \
          'libxinerama-dev:i386' \
          'libxml2-dev:i386' \
          'libxrandr-dev:i386' \
          'libxrender-dev:i386' \
          'libxslt1-dev:i386' \
          'libxt-dev:i386' \
          'libxxf86vm-dev:i386' \
          lib32ncurses5-dev \
          'ocl-icd-opencl-dev:i386' \
          'pkg-config:i386' \
          'unixodbc-dev:i386'
      fi

  alsa-lib:
    after: [add-architecture]
    source: git://git.alsa-project.org/alsa-lib.git
    source-tag: 'v1.1.5'
    configflags:
    - --prefix=/usr
    - --sysconfdir=/etc
    - --libexec=/usr/lib
    - --libdir=/usr/lib
    - --localstatedir=/var
    - --with-configdir=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/share/alsa
    - --with-plugindir=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/lib/alsa-lib
    - --disable-alisp
    - --disable-aload
    - --disable-mixer
    - --disable-python
    - --disable-rawmidi
    - --disable-static
    - --disable-topology
    - --disable-ucm
    - --enable-symbolic-functions
    - --host=i386-linux-gnu
    - CFLAGS=-m32
    - CXXFLAGS=-m32
    - LDFLAGS=-m32
    organize:
      snap/*/current/usr/lib/*: usr/lib/
      snap/*/current/usr/share/*: usr/share/

  alsa-plugins:
    after: [add-architecture, alsa-lib]
    source: git://git.alsa-project.org/alsa-plugins.git
    source-tag: 'v1.1.5'
    configflags:
    - --prefix=/usr
    - --sysconfdir=/etc
    - --libexec=/usr/lib
    - --libdir=/usr/lib
    - --localstatedir=/var
    - --disable-arcamav
    - --disable-avcodec
    - --disable-jack
    - --disable-mix
    - --disable-oss
    - --disable-usbstream
    - --with-plugindir=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/lib/alsa-lib
    - --disable-static
    - --host=i386-linux-gnu
    - CFLAGS=-m32
    - CXXFLAGS=-m32
    - LDFLAGS=-m32 -L$SNAPCRAFT_STAGE/usr/lib
    organize:
      snap/*/current/usr/lib/*: usr/lib/

  alsa:
    after: [alsa-plugins, alsa-lib]
    build: |
      sed -i 's|ARCH="amd64-linux-gnu"|ARCH="i386-linux-gnu"|' alsa-launch

  wine:
    after: [add-architecture, alsa]
    plugin: autotools
    source: https://dl.winehq.org/wine/source/3.0/wine-3.0.tar.xz
    prepare: |
      wget https://dl.winehq.org/wine/wine-mono/4.7.1/wine-mono-4.7.1.msi

      cat > wine-launch <<EOF
      #!/bin/bash
      if [ "\$SNAP_ARCH" = "amd64" ]; then
        ARCH="x86_64-linux-gnu"
      elif [ "\$SNAP_ARCH" = "armhf" ]; then
        ARCH="arm-linux-gnueabihf"
      elif [ "\$SNAP_ARCH" = "arm64" ]; then
        ARCH="aarch64-linux-gnu"
      else
        ARCH="\$SNAP_ARCH-linux-gnu"
      fi

      WINEARCH="i386-linux-gnu"

      if [ "\$ARCH" != "\$WINEARCH" ]; then
        if [ -d "\$SNAP/lib/\$WINEARCH" ]; then
          export LD_LIBRARY_PATH="\$SNAP/lib/\$WINEARCH:\$LD_LIBRARY_PATH"
        fi
        if [ -d "\$SNAP/usr/lib/\$WINEARCH" ]; then
          export LD_LIBRARY_PATH="\$SNAP/usr/lib/\$WINEARCH:\$LD_LIBRARY_PATH"
        fi
        if [ -d "\$SNAP/usr/lib/\$WINEARCH/mesa" ]; then
          export LD_LIBRARY_PATH="\$SNAP/usr/lib/\$WINEARCH/mesa:\$LD_LIBRARY_PATH"
        fi
        if [ -d "\$SNAP/usr/lib/\$WINEARCH/samba" ]; then
          export LD_LIBRARY_PATH="\$SNAP/usr/lib/\$WINEARCH/samba:\$LD_LIBRARY_PATH"
        fi
        if [ -d "\$SNAP/usr/lib/\$WINEARCH/pulseaudio" ]; then
          export LD_LIBRARY_PATH="\$SNAP/usr/lib/\$WINEARCH/pulseaudio:\$LD_LIBRARY_PATH"
        fi
      fi

      export LD_LIBRARY_PATH="\$SNAP/usr/lib/\$ARCH/mesa:\$LD_LIBRARY_PATH"
      export LD_LIBRARY_PATH="\$SNAP/usr/lib/\$ARCH/samba:\$LD_LIBRARY_PATH"
      export LD_LIBRARY_PATH="\$SNAP/usr/lib/\$ARCH/pulseaudio:\$LD_LIBRARY_PATH"

      exec "\$@"
      EOF
    install: |
      install -m644 -D -t $SNAPCRAFT_PART_INSTALL/share/wine wine-mono-4.7.1.msi
      install -m755 -D -t $SNAPCRAFT_PART_INSTALL/bin wine-launch
    build-packages:
    - bison
    - desktop-file-utils
    - docbook-to-man
    - docbook-utils
    - docbook-xsl
    - flex
    - fontforge
    - gcc-multilib
    - gettext
    - prelink
    - on i386:
      - libasyncns-dev
      - libcapi20-dev
      - libcups2-dev
      - libdbus-1-dev
      - libfontconfig-dev
      - libfreetype6-dev
      - libgif-dev
      - libgl-dev
      - libglu-dev
      - libgnutls-dev
      - libgphoto2-dev
      - libgsm1-dev
      - libgstreamer1.0-dev
      - libgstreamer-plugins-base1.0-dev
      - libjpeg-dev
      - libjson-c-dev
      - libkrb5-dev
      - liblcms2-dev
      - libldap2-dev
      - libmpg123-dev
      - libncurses5-dev
      - libnet1-dev
      - libopenal-dev
      - libosmesa6-dev
      - libpng12-dev
      - libpulse-dev
      - libsane-dev
      - libtiff-dev
      - libv4l-dev
      - libx11-dev
      - libxcomposite-dev
      - libxcursor-dev
      - libxext-dev
      - libxi-dev
      - libxinerama-dev
      - libxml2-dev
      - libxrandr-dev
      - libxrender-dev
      - libxslt1-dev
      - libxt-dev
      - libxxf86vm-dev
      - linux-kernel-headers
      - ocl-icd-opencl-dev
      - unixodbc-dev
      - x11proto-xinerama-dev
    stage-packages:
    - winbind
    - on i386:
      - gstreamer1.0-plugins-base
      - libcapi20-3
      - libcups2
      - libdbus-1-3
      - libfontconfig1
      - libfreetype6
      - libgl1
      - libglu1-mesa
      - libgnutls30
      - libgphoto2-6
      - libgsm1
      - libgstreamer1.0-0
      - libgstreamer-plugins-base1.0-0
      - libjpeg-turbo8
      - libjson-c2
      - libkrb5-3
      - liblcms2-2
      - libldap-2.4-2
      - libmpg123-0
      - libncurses5
      - libnet1
      - libodbc1
      - libopenal1
      - libosmesa6
      - libpng12-0
      - libpulse0
      - libsane
      - libtiff5
      - libv4l-0
      - libx11-6
      - libxcursor1
      - libxext6
      - libxinerama1
      - libxml2
      - libxrandr2
      - libxrender1
      - libxslt1.1
      - libxt6
      - libxxf86vm1
      - ocl-icd-libopencl1
    - on amd64:
      - gstreamer1.0-plugins-base:i386
      - libcapi20-3:i386
      - libcups2:i386
      - libdbus-1-3:i386
      - libfontconfig1:i386
      - libfreetype6:i386
      - libgl1:i386
      - libglu1-mesa:i386
      - libgnutls30:i386
      - libgphoto2-6:i386
      - libgsm1:i386
      - libgstreamer1.0-0:i386
      - libgstreamer-plugins-base1.0-0:i386
      - libjpeg-turbo8:i386
      - libjson-c2:i386
      - libkrb5-3:i386
      - liblcms2-2:i386
      - libldap-2.4-2:i386
      - libmpg123-0:i386
      - libncurses5:i386
      - libnet1:i386
      - libodbc1:i386
      - libopenal1:i386
      - libosmesa6:i386
      - libpng12-0:i386
      - libpulse0:i386
      - libsane:i386
      - libtiff5:i386
      - libv4l-0:i386
      - libx11-6:i386
      - libxcursor1:i386
      - libxext6:i386
      - libxinerama1:i386
      - libxml2:i386
      - libxrandr2:i386
      - libxrender1:i386
      - libxslt1.1:i386
      - libxt6:i386
      - libxxf86vm1:i386
      - ocl-icd-libopencl1:i386

You’ll need to stage desktop-glib-only, too, using after: [desktop-glib-only] on at least one part. Then you’ll need to use the following command to launch your application:

    command: desktop-launch alsa-launch wine-launch $SNAP/usr/bin/wine $SNAP/path/to/your.exe
1 Like

This is an example of a (somewhat) working Wine snap

Also note that if you use Daniel’s Wine build part then you’ll want to remove Wine from stage-packages