From a0e2b18ce8f0a915844c3cb1d4314f77c28bef23 Mon Sep 17 00:00:00 2001 From: Daniel Llewellyn Date: Sat, 16 May 2020 01:11:11 +0100 Subject: [PATCH] Snap progress Signed-off-by: Daniel Llewellyn --- snap/snapcraft.yaml | 199 ++++++++++++++++++++++++++++++++++++++++++++ snapcraft.yaml | 123 --------------------------- 2 files changed, 199 insertions(+), 123 deletions(-) create mode 100644 snap/snapcraft.yaml delete mode 100644 snapcraft.yaml diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml new file mode 100644 index 000000000..babf66ff9 --- /dev/null +++ b/snap/snapcraft.yaml @@ -0,0 +1,199 @@ +name: lutris +confinement: strict +base: core18 +grade: stable +adopt-info: lutris + +architectures: + - build-on: amd64 + - build-on: i386 + +# package-repositories: +# - type: apt +# deb-types: [deb] +# components: [main] +# suites: [$SNAPCRAFT_APT_RELEASE] +# key-id: 76F1A20FF987672F +# url: https://dl.winehq.org/wine-builds/ubuntu/ + +parts: + extensible-hooks: + plugin: dump + source: https://github.com/diddlesnaps/snapcraft-utils-library.git + source-subdir: snapcraft-assets/extensible-hooks + + ld-precache: + after: + - extensible-hooks + - gnome-extension-hack + - lutris + - lutris-runtime + plugin: dump + source: https://github.com/diddlesnaps/snapcraft-utils-library.git + source-subdir: snapcraft-assets/ld-precache + + enable-i386: + plugin: nil + override-build: | + snapcraftctl build + if [ "$SNAPCRAFT_ARCH_TRIPLET" = "x86_64-linux-gnu" ]; then + dpkg --add-architecture i386 + apt update + fi + + gnome-extension-hack: + plugin: dump + source: . + override-pull: | + cat <<'EOF' > gnome-extension-hack + #!/bin/sh + rm -f "$XDG_DATA_HOME/icons/hicolor/"* || true + if [ "$SNAP_ARCH" = "amd64" ]; then + export LD_LIBRARY_PATH="$SNAP/usr/lib/i386-linux-gnu:$SNAP/lib/i386-linux-gnu:$LD_LIBRARY_PATH" + + export LIBGL_DRIVERS_PATH="$LIBGL_DRIVERS_PATH:$SNAP/usr/lib/i386-linux-gnu/dri" + export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIBGL_DRIVERS_PATH" + export LIBVA_DRIVERS_PATH="$SNAP/usr/lib/i386-linux-gnu/dri" + fi + exec "$@" + EOF + chmod +x gnome-extension-hack + organize: + gnome-extension-hack: bin/gnome-extension-hack + + lutris: + after: [enable-i386] + plugin: python + python-version: python3 + source: . + parse-info: [share/metainfo/net.lutris.Lutris.metainfo.xml] + override-pull: | + snapcraftctl pull + sed -i 's|Icon=.*|Icon=${SNAP}/share/icons/hicolor/scalable/apps/lutris.svg|' share/applications/net.lutris.Lutris.desktop + build-packages: + - gobject-introspection + - libgirepository1.0-dev + - python3 + - python3-gi + - python3-pil + - python3-requests + - python3-setproctitle + - python3-yaml + + lutris-runtime: + after: [enable-i386] + plugin: nil + stage-packages: + - cabextract + - curl + - fluid-soundfont-gs + - gir1.2-glib-2.0 + - gir1.2-gnomedesktop-3.0 + - gir1.2-gtk-3.0 + - gir1.2-notify-0.7 + - gir1.2-webkit2-4.0 + - libgnutls30 + - libvulkan1 + - libxrandr2 + - mesa-utils + - p7zip + - psmisc + - python3 + - python3-dbus + - python3-gi + - python3-pil + - python3-requests + - python3-setproctitle + - python3-yaml + - unzip + - wine + - x11-xserver-utils + - xterm + - xz-utils + - on amd64: + - lib32gcc1 + - libc6-i386 + - libglu1-mesa:i386 + - libglvnd0:i386 + - libglx-mesa0:i386 + - libgnutls30:i386 + - libvulkan1:i386 + - libx11-6:i386 + - x11-xserver-utils:i386 + stage: + - -lib/ld-linux.so.2 + - -usr/bin/cpp-7 + - -usr/lib/*/libjavascript* + - -usr/lib/*/libwebkit* + - -usr/share/doc/cpp/README.Debian + - -usr/share/man/man1/cpp-7.1.gz + +hooks: + install: + command-chain: + - snap/command-chain/snapcraft-runner + - snap/command-chain/desktop-launch + - bin/gnome-extension-hack + post-refresh: + command-chain: + - snap/command-chain/snapcraft-runner + - snap/command-chain/desktop-launch + - bin/gnome-extension-hack + +layout: + /etc/ld.so.cache: + bind-file: $SNAP_DATA/etc/ld.so.cache + +slots: + dbus-lutris: + interface: dbus + bus: session + name: net.lutris.Lutris + +environment: + HOME: $SNAP_USER_COMMON + +apps: + lutris: + command: bin/gnome-extension-hack $SNAP/usr/bin/python3 $SNAP/bin/lutris -d + extensions: [gnome-3-28] + desktop: share/applications/net.lutris.Lutris.desktop + common-id: net.lutris.Lutris + plugs: + - audio-playback + - browser-support + - daemon-notify + - desktop + - desktop-legacy + - gsettings + - hardware-observe + - home + - io-ports-control + - joystick + - kvm + - libvirt + - mount-observe + - network + - network-bind + - network-manager + - opengl + - pulseaudio + - removable-media + - screen-inhibit-control + - unity7 + - wayland + - x11 + slots: + - dbus-lutris + + # wine: + # extensions: [gnome-3-28] + # command: usr/bin/wine-stable + + # wine64: + # extensions: [gnome-3-28] + # command: usr/bin/wine64-stable + + # winecfg: + # extensions: [gnome-3-28] + # command: usr/bin/winecfg-stable diff --git a/snapcraft.yaml b/snapcraft.yaml deleted file mode 100644 index d684c4ed0..000000000 --- a/snapcraft.yaml +++ /dev/null @@ -1,123 +0,0 @@ -name: lutris -version: git -confinement: devmode #chaning to strict causes errors trying to read nvidia version file, need to figure it out -base: core18 -grade: stable - -architectures: - - build-on: amd64 - - build-on: i386 - -summary: lutris snap -description: | - Lutris is a gaming platform for GNU/Linux. Its goal is to make - gaming on Linux as easy as possible by taking care of installing - and setting up the game for the user. The only thing you have to - do is play the game. It aims to support every game that is playable - on Linux. - -parts: - - enable-i386: - plugin: nil - override-build: | - snapcraftctl build - if [ "$SNAPCRAFT_ARCH_TRIPLET" = "x86_64-linux-gnu" ]; then - dpkg --add-architecture i386 - apt update - fi - - desktop-gnome-platform: - source: https://github.com/ubuntu/snapcraft-desktop-helpers.git - source-depth: 1 - source-subdir: gtk - plugin: make - build-packages: [build-essential, libgtk-3-dev] - override-build: | - snapcraftctl build - mkdir -pv $SNAPCRAFT_PART_INSTALL/gnome-platform - after: [enable-i386] - - wine: - plugin: nil - build-packages: [dpkg, wget] - override-build: | - snapcraftctl build - ARCH="$(dpkg --print-architecture)" - WINE_REL="wine-devel" - WINE_VER="4.7" - # wget and dpkg extract the wine debs - ## supporting binaries which are arch-specific but the same filenames in both architectures so we only install the native architecture - DEB_URLS="https://dl.winehq.org/wine-builds/ubuntu/dists/bionic/main/binary-${ARCH}/${WINE_REL}_${WINE_VER}~bionic_${ARCH}.deb" - ## wine loaders - this one is the native system architecture - DEB_URLS="$DEB_URLS https://dl.winehq.org/wine-builds/ubuntu/dists/bionic/main/binary-${ARCH}/${WINE_REL}-${ARCH}_${WINE_VER}~bionic_${ARCH}.deb" - if [ "$ARCH" = "amd64" ]; then - ## on amd64 builds we need to also bundle the i386 wine loaders - DEB_URLS="$DEB_URLS https://dl.winehq.org/wine-builds/ubuntu/dists/bionic/main/binary-i386/${WINE_REL}-i386_${WINE_VER}~bionic_i386.deb" - fi - for DEB_URL in ${DEB_URLS}; do - DEB=$(basename "${DEB_URL}") - echo "Downloading ${DEB_URL}..." - wget --quiet "${DEB_URL}" -O "${SNAPCRAFT_PART_INSTALL}/${DEB}" - echo "Unpacking ${DEB}..." - dpkg -x "${SNAPCRAFT_PART_INSTALL}/${DEB}" ${SNAPCRAFT_PART_INSTALL} - rm -f "${SNAPCRAFT_PART_INSTALL}/${DEB}" - done - # Organise and cleanup - cp -a ${SNAPCRAFT_PART_INSTALL}/opt/${WINE_REL}/* ${SNAPCRAFT_PART_INSTALL}/ - stage: [-opt, -share/applications, -share/man, -usr/share/doc, -usr/share/lintian] - after: [enable-i386] - - wine-runtime: - plugin: nil - stage-packages: [libasound2, libasound2-plugins, libglib2.0-0, libgphoto2-6, gstreamer1.0-plugins-base, libgstreamer-plugins-base1.0-0, liblcms2-2, libldap-2.4-2, libmpg123-0, libncurses5, libopenal1, libpcap0.8, libpulse0, libudev1, libxext6, libxml2, zlib1g, libcups2, libdbus-1-3, libfontconfig1, libfreetype6, libgif7, libglu1-mesa, libgnutls30, libgpg-error0, libgsm1, libgssapi-krb5-2, libjpeg8, libodbc1, libosmesa6, libpng16-16, libsane, libsdl2-2.0-0, libsqlite3-0, libtiff5, libva2, libv4l-0, libvulkan1, libxcomposite1, libxcursor1, libxfixes3, libxi6, libxinerama1, libxrandr2, libxrender1, libxslt1.1, libxxf86vm1, locales-all, va-driver-all, samba-libs, winbind, adwaita-icon-theme, dmz-cursor-theme, gnome-themes-standard, ibus-gtk3, libappindicator3-1, libgdk-pixbuf2.0-0, libgtk-3-0, libgtk-3-bin, libibus-1.0-5, libxkbcommon0, light-themes, shared-mime-info, ttf-ubuntu-font-family, unity-gtk3-module, xdg-user-dirs, on amd64: ['libasound2:i386', 'libasound2-plugins:i386', 'libc6:i386', 'libglib2.0-0:i386', 'libgphoto2-6:i386', 'gstreamer1.0-plugins-base:i386', 'libgstreamer-plugins-base1.0-0:i386', 'liblcms2-2:i386', 'libldap-2.4-2:i386', 'libmpg123-0:i386', 'libncurses5:i386', 'libopenal1:i386', 'libpcap0.8:i386', 'libpulse0:i386', 'libudev1:i386', 'libxext6:i386', 'libxml2:i386', 'zlib1g:i386', 'libcups2:i386', 'libdbus-1-3:i386', 'libfontconfig1:i386', 'libfreetype6:i386', 'libgif7:i386', 'libglu1-mesa:i386', 'libgnutls30:i386', 'libgpg-error0:i386', 'libgsm1:i386', 'libgssapi-krb5-2:i386', 'libjpeg8:i386', 'libodbc1:i386', 'libosmesa6:i386', 'libpng16-16:i386', 'libsane:i386', 'libsdl2-2.0-0:i386', 'libsqlite3-0:i386', 'libtiff5:i386', 'libv4l-0:i386', 'libva2:i386', 'libvulkan1:i386', 'libxcomposite1:i386', 'libxcursor1:i386', 'libxfixes3:i386', 'libxi6:i386', 'libxinerama1:i386', 'libxrandr2:i386', 'libxrender1:i386', 'libxslt1.1:i386', 'libxxf86vm1:i386', 'va-driver-all:i386', 'samba-libs:i386', 'winbind:i386', 'ibus-gtk3:i386', 'libappindicator3-1:i386', 'libgdk-pixbuf2.0-0:i386', 'libgtk-3-0:i386', 'libgtk-3-bin:i386', 'libibus-1.0-5:i386', 'libxkbcommon0:i386', 'unity-gtk3-module:i386']] - stage: [-etc/init, -etc/init.d, -etc/logrotate.d, -usr/share/apps, -usr/share/applications, -usr/share/bug, -usr/share/doc, -usr/share/doc-base, -usr/share/debhelper, -usr/share/lintian, -usr/share/man, -usr/share/pixmaps, -usr/share/pkgconfig, -lib/ld-linux.so.2] - after: [enable-i386] - - lutris: - plugin: python - python-version: python3 - source: https://github.com/lutris/lutris.git - override-build: | - snapcraftctl build - sed -i 's|Name=Lutris|Name=Lutris|' ${SNAPCRAFT_PART_INSTALL}/share/applications/net.lutris.Lutris.desktop - stage-packages: ['python3-all-dev', 'gir1.2-gtk-3.0', 'gir1.2-glib-2.0', 'gir1.2-gnomedesktop-3.0', 'gir1.2-webkit2-4.0', gir1.2-notify-0.7, libgirepository1.0-dev, libc-bin] - after: [enable-i386] - - lutris-runtime: - plugin: nil - stage-packages: [python3, python3-setproctitle, python3-yaml, python3-requests, python3-pil, python3-gi, dh-python, curl, cabextract, psmisc, gvfs-backends, unzip, p7zip, mesa-utils, fluid-soundfont-gs, libgnutls30, x11-xserver-utils, on amd64: ['libxrandr-dev:i386', 'libgnutls30:i386', 'x11-xserver-utils:i386', 'libc6-i386', 'lib32gcc1'] ] - stage: [-lib/ld-linux.so.2, -usr/bin/cpp-7, -usr/share/doc/cpp/README.Debian, -usr/share/man/man1/cpp-7.1.gz] - after: [enable-i386] - -plugs: - - gnome-3-28-1804: - interface: content - target: $SNAP/gnome-platform - default-provider: gnome-3-28-1804 - - -slots: - - lutris: - interface: dbus - bus: session - name: net.lutris.Lutris - -apps: - - lutris: - command: bin/desktop-launch $SNAP/bin/lutris -d - plugs: [home, daemon-notify, network, network-bind, network-manager, desktop, desktop-legacy, unity7, wayland, opengl, pulseaudio, gsettings, x11, screen-inhibit-control, kvm, libvirt, removable-media, joystick, io-ports-control, hardware-observe, mount-observe] - slots: [ lutris ] - desktop: share/applications/net.lutris.Lutris.desktop - - wine: - command: bin/desktop-launch $SNAP/bin/wine - - wine64: - command: bin/desktop-launch $SNAP/bin/wine64 - - winecfg: - command: bin/desktop-launch $SNAP/bin/winecfg