From ab007c48158f8d12159e93e0df2e98c1b81f61b1 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Sun, 27 Feb 2022 15:59:07 -0500 Subject: [PATCH] Update snapcraft file to latest API --- release-tool | 4 - release-tool.ps1 | 5 -- snap/local/launchers/README.md | 10 --- snap/local/launchers/gtk3-env-launch | 14 ---- snap/snapcraft.yaml | 109 ++++++--------------------- 5 files changed, 23 insertions(+), 119 deletions(-) delete mode 100644 snap/local/launchers/README.md delete mode 100755 snap/local/launchers/gtk3-env-launch diff --git a/release-tool b/release-tool index afc3229b3..80b4df377 100755 --- a/release-tool +++ b/release-tool @@ -354,10 +354,6 @@ checkSnapcraft() { return fi - if ! $GREP -qPzo "version: ${RELEASE_NAME}" snap/snapcraft.yaml; then - exitError "'snapcraft.yaml' has not been updated to the '${RELEASE_NAME}' release!" - fi - if ! $GREP -qPzo "KEEPASSXC_BUILD_TYPE=Release" snap/snapcraft.yaml; then exitError "'snapcraft.yaml' is not set for a release build!" fi diff --git a/release-tool.ps1 b/release-tool.ps1 index 1c0647a60..f39ca158a 100644 --- a/release-tool.ps1 +++ b/release-tool.ps1 @@ -133,11 +133,6 @@ function Test-VersionInFiles { -pattern "" -Quiet)) { throw "share/linux/org.keepassxc.KeePassXC.appdata.xml does not contain a section for $Version." } - - # Check Snapcraft - if (!(Select-String "$SourceDir\snap\snapcraft.yaml" -pattern "version: $Version" -Quiet)) { - throw "snap/snapcraft.yaml has not been updated to $Version." - } } function Test-WorkingTreeClean { diff --git a/snap/local/launchers/README.md b/snap/local/launchers/README.md deleted file mode 100644 index 73be8135e..000000000 --- a/snap/local/launchers/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# /snap/local/launchers -Here are the launchers, or wrapper programs to deal with some runtime-fixable problems for the snapped applications, like setting proper environmental variables in snap. - -In convention launchers are named _something_-launch, for dealing certain problem with _something_, and usually can be called in a stacked manner to consolidate their modifications. - -```yaml -apps: - _app_name_: - command: foo-launch bar-launch _app_command_ -``` diff --git a/snap/local/launchers/gtk3-env-launch b/snap/local/launchers/gtk3-env-launch deleted file mode 100755 index f017e8611..000000000 --- a/snap/local/launchers/gtk3-env-launch +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash -# This is the maintainence launcher for the snap, make necessary runtime environment changes to make the snap work here. You may also insert security confinement/deprecation/obsoletion notice of the snap here. - -set \ - -o errexit \ - -o errtrace \ - -o nounset \ - -o pipefail - -# gtk-common-themes support -export QT_QPA_PLATFORMTHEME=gtk3 - -# Finally run the next part of the command chain -exec "${@}" diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 6ca739e85..a1d9d6c39 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,51 +1,36 @@ name: keepassxc -version: 2.7.0 +adopt-info: keepassxc grade: stable -summary: Community-driven port of the Windows application “KeePass Password Safe” -description: | - KeePassXC is an application for people with extremely high demands on secure - personal data management. It has a light interface, is cross-platform and - published under the terms of the GNU General Public License. -confinement: strict base: core18 +confinement: strict compression: lzo -plugs: # plugs for theming, font settings, cursor and to use gtk3 file chooser - gtk-3-themes: - interface: content - target: $SNAP/data-dir/themes - default-provider: gtk-common-themes:gtk-3-themes - icon-themes: - interface: content - target: $SNAP/data-dir/icons - default-provider: gtk-common-themes:icon-themes - sound-themes: - interface: content - target: $SNAP/data-dir/sounds - default-provider: gtk-common-themes:sounds-themes - apps: keepassxc: - adapter: full - command: usr/bin/keepassxc -style fusion - command-chain: - - bin/desktop-launch - - bin/gtk3-env-launch - plugs: [unity7, x11, opengl, gsettings, home, network, network-bind, removable-media, raw-usb, wayland, desktop-legacy, desktop] - desktop: usr/share/applications/org.keepassxc.KeePassXC.desktop - environment: - DISABLE_WAYLAND: 1 + command: keepassxc + common-id: org.keepassxc.KeePassXC.desktop + extensions: [kde-neon] + plugs: [kde-frameworks-5-plug, home, unity7, network, network-bind, removable-media, raw-usb] cli: command: keepassxc-cli - plugs: [x11, gsettings, home, removable-media, raw-usb] + extensions: [kde-neon] + plugs: [home, removable-media, raw-usb] proxy: command: keepassxc-proxy + extensions: [kde-neon] plugs: [home] + +slots: + session-dbus-interface: + interface: dbus + name: org.keepassxc.KeePassXC.MainWindow + bus: session parts: keepassxc: source: . plugin: cmake + parse-info: [usr/share/metainfo/org.keepassxc.KeePassXC.appdata.xml] configflags: - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_INSTALL_PREFIX=/usr @@ -53,79 +38,31 @@ parts: - -DKEEPASSXC_BUILD_TYPE=Release - -DWITH_TESTS=OFF - -DWITH_XC_ALL=ON + build-snaps: + - kde-frameworks-5-core18-sdk + - kde-frameworks-5-core18 build-packages: - g++ - - libgcrypt20-dev + - libbotan-2-dev - libqt5x11extras5-dev - libqt5svg5-dev - - qtbase5-dev - qtbase5-private-dev - qttools5-dev - qttools5-dev-tools - zlib1g-dev - libxi-dev - libxtst-dev - - libyubikey-dev - - libykpers-1-dev - - libsodium-dev - - libargon2-0-dev - libqrencode-dev + - libusb-1.0-0-dev - libminizip-dev - asciidoctor stage-packages: - dbus - - qttranslations5-l10n # common translations - - libgcrypt20 - - libykpers-1-1 - - libargon2-0 - - libsodium23 + - botan - libxtst6 - libqt5x11extras5 - libqt5svg5 - - try: [libqrencode3, libqrencode4] - libqt5concurrent5 - - libquazip5-1 - - libusb-1.0-0 - - qtwayland5 - - qt5-gtk-platformtheme # for theming, font settings, cursor and to use gtk3 file chooser - libqrencode3 + - libusb-1.0-0 - xclip - override-build: | - snapcraftctl build - sed -i 's|Icon=keepassxc|Icon=${SNAP}/usr/share/icons/hicolor/256x256/apps/keepassxc.png|g' $SNAPCRAFT_PART_INSTALL/usr/share/applications/org.keepassxc.KeePassXC.desktop - organize: - usr/share/qt5/translations/*.qm: usr/share/keepassxc/translations/ - stage: - - -opt - after: [desktop-qt5] - - launchers: # custom launcher to set QT_QPA_PLATFORMTHEME=gtk3 correctly - source: snap/local/launchers - plugin: dump - organize: - '*': bin/ - stage: - - -bin/README.* - - desktop-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 - - libgtk2.0-0 - - libqt5svg5 # for loading icon themes which are svg - - try: [appmenu-qt5] # not available on core18 - - locales-all