From d61e79acd5c9bf826dea26214ea301dcf84c5250 Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Sun, 10 Oct 2021 19:03:41 +0200 Subject: [PATCH 1/2] Move to classic unconfined snap package --- snap/snapcraft.yaml | 99 ++++++++++++++++++++++++++++++--------------- 1 file changed, 66 insertions(+), 33 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 874bba278b..c1bc49154f 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -22,34 +22,37 @@ description: | apps: swipl: - command: swipl - extensions: - - kde-neon - plugs: - - home - - network - - removable-media - - opengl - - audio-playback - - audio-record + command: bin/desktop-launch $SNAP/usr/lib/swipl/bin/x86_64-linux/swipl swipl-win: - command: swipl-win - extensions: - - kde-neon - plugs: - - home - - network - - removable-media - - opengl - - audio-playback - - audio-record + command: bin/desktop-launch $SNAP/usr/lib/swipl/bin/x86_64-linux/swipl-win grade: stable -confinement: strict +confinement: classic +compression: lzo # should make startup nearly as fast as regular executables + +plugs: + graphics-core20: + interface: content + target: $SNAP/graphics + default-provider: mesa-core20 + +layout: + /usr/share/libdrm: # Needed by mesa-core20 on AMD GPUs + bind: $SNAP/graphics/libdrm + /usr/share/drirc.d: # Used by mesa-core20 for app specific workarounds + bind: $SNAP/graphics/drirc.d + +environment: + LD_LIBRARY_PATH: $SNAP/graphics/lib + LIBGL_DRIVERS_PATH: $SNAP/graphics/dri + LIBVA_DRIVERS_PATH: $SNAP/graphics/dri + __EGL_VENDOR_LIBRARY_DIRS: $SNAP/graphics/glvnd/egl_vendor.d parts: swi-prolog: source: https://github.com/SWI-Prolog/swipl-devel.git + after: + - qt5 source-type: git source-depth: 1 plugin: cmake @@ -64,23 +67,21 @@ parts: -DSWIPL_PACKAGES_JAVA=OFF \ -DCMAKE_INSTALL_PREFIX=/usr \ -DSWIPL_INSTALL_IN_LIB=ON \ - -DCMAKE_FIND_ROOT_PATH=/snap/kde-frameworks-5-core18-sdk/current \ -G Ninja .. ninja DESTDIR=$SNAPCRAFT_PART_INSTALL ninja install - build-snaps: [kde-frameworks-5-core18-sdk] stage-packages: # Remove packages available in the kde base - # - ca-certificates - # - libarchive13 - # - libdb5.3 - # - libedit2 - # - libfontconfig1 - # - libglu1-mesa - # - libgmp10 - # - libjpeg8 - # - libssl1.1 - # - libx11-6 + - ca-certificates + - libarchive13 + - libdb5.3 + - libedit2 + - libfontconfig1 + - libglu1-mesa + - libgmp10 + - libjpeg8 + - libssl1.1 + - libx11-6 - libossp-uuid16 - libpcre3 - libserd-0-0 @@ -117,3 +118,35 @@ parts: - libyaml-dev - libglvnd-dev - libgoogle-perftools-dev + qt5: + source: https://github.com/ubuntu/snapcraft-desktop-helpers.git + source-subdir: qt + plugin: make + make-parameters: ["FLAVOR=qt5"] + build-packages: + - qtbase5-dev + - dpkg-dev + stage-packages: + - libxkbcommon0 + - ttf-ubuntu-font-family + - dmz-cursor-theme + - light-themes + - adwaita-icon-theme + - gnome-themes-standard + - shared-mime-info + - libqt5gui5 + - libgdk-pixbuf2.0-0 + - libqt5svg5 # for loading icon themes which are svg + - locales-all + cleanup: + after: [swi-prolog] + plugin: nil + build-snaps: [ mesa-core20 ] + override-prime: | + set -eux + cd /snap/mesa-core20/current/egl/lib + find . -type f,l -exec rm -f $SNAPCRAFT_PRIME/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/{} \; + rm -fr "$SNAPCRAFT_PRIME/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/dri" + for CRUFT in bug drirc.d glvnd libdrm lintian man; do + rm -rf "$SNAPCRAFT_PRIME/usr/share/$CRUFT" + done \ No newline at end of file From ea90f899c7108cbd62a7f77577eebd01595f0f0e Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Tue, 26 Oct 2021 09:13:00 +0200 Subject: [PATCH 2/2] Avoid desktop-launch script when running CLI to speed up start --- snap/snapcraft.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index c1bc49154f..d3771ff514 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -22,9 +22,9 @@ description: | apps: swipl: - command: bin/desktop-launch $SNAP/usr/lib/swipl/bin/x86_64-linux/swipl + command: $SNAP/usr/lib/swipl/bin/x86_64-linux/swipl swipl-win: - command: bin/desktop-launch $SNAP/usr/lib/swipl/bin/x86_64-linux/swipl-win + command: bin/desktop-launch $SNAP/usr/lib/swipl/bin/x86_64-linux/swipl-win grade: stable confinement: classic @@ -149,4 +149,4 @@ parts: rm -fr "$SNAPCRAFT_PRIME/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/dri" for CRUFT in bug drirc.d glvnd libdrm lintian man; do rm -rf "$SNAPCRAFT_PRIME/usr/share/$CRUFT" - done \ No newline at end of file + done