[neon/snap-packaging/kde-qt6-core-sdk] /: sdk: various fixes and improvements

Soumyadeep Ghosh null at kde.org
Tue May 28 14:45:29 BST 2024


Git commit 1fbf48d79a3fe20ee15313887a54f1c9de21f6a7 by Soumyadeep Ghosh.
Committed on 26/05/2024 at 07:08.
Pushed by scarlettmoore into branch 'master'.

sdk: various fixes and improvements

1. Added many needed development libraries
2. Added support for plugins in qtmultimedia(ffmpeg and gstreamer)
3. Added support for pulseaudio in qtmultimedia
4. Moved to cmake snap
5. Added cleanup part for deduplication

M  +262  -207  snapcraft.yaml

https://invent.kde.org/neon/snap-packaging/kde-qt6-core-sdk/-/commit/1fbf48d79a3fe20ee15313887a54f1c9de21f6a7

diff --git a/snapcraft.yaml b/snapcraft.yaml
index e78db1f..1162cc8 100644
--- a/snapcraft.yaml
+++ b/snapcraft.yaml
@@ -22,9 +22,9 @@ package-repositories:
     key-id: 6F71F525282841EEDAF851B42F59B5F99B1BE0B4
   - type: apt
     components:
-    - main
+      - main
     suites:
-    - jammy
+      - jammy
     key-id: 444DABCF3667D0283F894EDDE6D4736255751E5D
     url: http://origin.archive.neon.kde.org/user
     key-server: keyserver.ubuntu.com
@@ -33,30 +33,32 @@ parts:
   qt6:
     override-pull: |
       craftctl default
-      cd $SNAPCRAFT_PART_SRC/qtwebengine/src/3rdparty
-      patch -p1 < $SNAPCRAFT_PROJECT_DIR/FIXUP-Restore-GLX-usage.patch
+      cd $CRAFT_PART_SRC/qtwebengine/src/3rdparty
+      patch -p1 < $CRAFT_PROJECT_DIR/FIXUP-Restore-GLX-usage.patch
     plugin: cmake
     source: https://invent.kde.org/qt/qt/qt5.git
     source-tag: $SNAPCRAFT_PROJECT_VERSION
+    source-depth: 1
     cmake-generator: Ninja
     cmake-parameters:
-      - -DCMAKE_LIBRARY_PATH=$CRAFT_ARCH_TRIPLET
+      - -DCMAKE_BUILD_TYPE=Release
+      - -DCMAKE_LIBRARY_PATH=$CRAFT_ARCH_TRIPLET_BUILD_FOR
       - -DCMAKE_INSTALL_PREFIX=/usr
-      - -DINSTALL_BINDIR=lib/qt6/bin
-      - -DINSTALL_LIBDIR=lib/$CRAFT_ARCH_TRIPLET
+      - -DINSTALL_BINDIR=/usr/bin/qt6
+      - -DINSTALL_LIBDIR=lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR
       - -DINSTALL_LIBEXECDIR=lib/qt6/libexec
-      - -DINSTALL_ARCHDATADIR=lib/$CRAFT_ARCH_TRIPLET/qt6
-      - -DINSTALL_EXAMPLESDIR=lib/$CRAFT_ARCH_TRIPLET/qt6/examples
+      - -DINSTALL_ARCHDATADIR=lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qt6
+      - -DINSTALL_EXAMPLESDIR=lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qt6/examples
       - -DINSTALL_DATADIR=share/qt6
-      - -DINSTALL_HOSTDATADIR=lib/$CRAFT_ARCH_TRIPLET/qt6
-      - -DINSTALL_DOCDIR=share/qt6/doc
-      - -DINSTALL_SYSCONFDIR=/etc/xdg
-      - -DINSTALL_INCLUDEDIR=include/$CRAFT_ARCH_TRIPLET/qt6
-      - -DINSTALL_PLUGINDIR=lib/$CRAFT_ARCH_TRIPLET/qt6/plugins
+      - -DINSTALL_HOSTDATADIR=lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qt6
+      - -DINSTALL_SYSCONFDIR=/share
+      - -DINSTALL_INCLUDEDIR=include/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qt6
+      - -DINSTALL_PLUGINDIR=lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qt6/plugins
       - -DINSTALL_TRANSLATIONDIR=share/qt6/translations
-      - -DINSTALL_MKSPECSDIR=lib/$CRAFT_ARCH_TRIPLET/qt6/mkspecs
+      - -DINSTALL_MKSPECSDIR=lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qt6/mkspecs
       - -DINSTALL_PUBLICBINDIR=bin
-      - -DBUILD_EXAMPLES=ON
+      - -DBUILD_EXAMPLES=OFF
+      - -DBUILD_DOCS=OFF
       - -DFEATURE_mimetype_database=OFF
       - -DFEATURE_dbus_linked=ON
       - -DFEATURE_accessibility=ON
@@ -70,6 +72,9 @@ parts:
       - -DFEATURE_libproxy=ON
       - -DFEATURE_system_proxies=ON
       - -DFEATURE_cups=ON
+      - -DFEATURE_ffmpeg=ON
+      - -DFEATURE_gstreamer=ON
+      - -DFEATURE_pulseaudio=ON
       - -DFEATURE_fontconfig=ON
       - -DFEATURE_freetype=ON
       - -DFEATURE_harfbuzz=ON
@@ -103,224 +108,274 @@ parts:
       - -DFEATURE_webengine_webrtc=ON
       - -DFEATURE_webengine_webrtc-pipewire=ON
       - -DQT_FEATURE_alsa=ON
+    build-environment:
+      - PKG_CONFIG_PATH: /snap/ffmpeg-2204-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}
+      - CMAKE_PREFIX_PATH: /snap/ffmpeg-2204-sdk/current/usr${CMAKE_PREFIX_PATH:+:$CMAKE_PREFIX_PATH}
+    build-snaps:
+      - ffmpeg-2204-sdk
+      - cmake
     build-packages:
-      - libpq-dev
-      - libxcb-glx0-dev
-      - libjpeg-dev
-      - libdrm-dev
-      - libxcb-render-util0-dev
-      - libxcursor-dev
-      - zlib1g-dev
-      - liblttng-ust-dev
-      - libxkbcommon-x11-dev
-      - libxcomposite-dev
-      - libatspi2.0-dev
-      - libxcb-xtest0-dev
+      - bison
+      - clang
+      - default-libmysqlclient-dev
+      - dh-exec
       - firebird-dev
-      - libwayland-server0
-      - libxrender-dev
-      - libxcb-record0-dev
-      - libgl1-mesa-dev
-      - python3-minimal
-      - libglib2.0-dev
-      - python2-minimal
-      - libxcb-xvmc0-dev
-      - libxcb-xv0-dev
-      - libx11-dev
-      - libfontconfig-dev
-      - libxkbcommon-dev
-      - libxcb-dri2-0-dev
-      - libicu-dev
+      - flex
       - gperf
-      - libgl-dev
+      - libasound2-dev
+      - libatspi2.0-dev
+      - libb2-dev
+      - libclang-dev
+      - libcups2-dev
+      - libdbus-1-dev
       - libdouble-conversion-dev
-      - libglu-dev
+      - libdrm-dev
+      - libfreetype-dev
+      - libfreetype6-dev
+      - libfontconfig-dev
+      - libfontconfig1-dev
+      - libgbm-dev
+      - libgl-dev
+      - libgl1-mesa-dev
+      - libgles-dev
       - libgles2-mesa-dev
-      - python-pip
-      - llvm-dev
-      - libzstd-dev
-      - unixodbc-dev
-      - libsystemd-dev
-      - libxcb-xrm-dev
-      - pkg-config
-      - libmtdev-dev
-      - flex
+      - libglib2.0-dev
+      - libglx-dev
+      - libglu-dev
+      - libglu1-mesa-dev
+      - libgstreamer1.0-dev
+      - libgstreamer-plugins-base1.0-dev
+      - libharfbuzz-dev
+      - libhunspell-dev
+      - libicu-dev
+      - libinput-dev
+      - libjpeg-dev
       - libkrb5-dev
+      - liblttng-ust-dev
+      - libmd4c-dev
+      - libmd4c-html0-dev
+      - libmtdev-dev
+      - libnss3-dev
       - libopengl-dev
-      - libglu1-mesa-dev
-      - libb2-dev
-      - libxcb-util-dev
-      - cmake-data
+      - libpcre2-dev
       - libpng-dev
-      - clang
-      - libfreetype-dev
+      - libpq-dev
+      - libproxy-dev
+      - libpulse-dev
+      - libqt5-dev
+      - libsqlite3-dev
+      - libsctp-dev
+      - libssl-dev
+      - libsystemd-dev
       - libts-dev
+      - libudev-dev
+      - libva-dev
+      - libwayland-dev
+      - libwayland-egl1-mesa
+      - libwayland-server0
       - libxcb-composite0-dev
-      - libxcb-ewmh-dev
-      - libasound2-dev
-      - libxcb-shape0-dev
-      - libxcb-res0-dev
-      - libxcb1-dev
-      - libxcb-cursor-dev
+      - libxcb-damage0-dev
       - libxcb-dpms0-dev
-      - libsctp-dev
+      - libxcb-dri2-0-dev
       - libxcb-dri3-dev
-      - libnss3-dev
-      - libxcb-xinerama0-dev
-      - python3-html5lib
-      - libdbus-1-dev
-      - libxcb-xf86dri0-dev
-      - bison
+      - libxcb-ewmh-dev
+      - libxcb-glx0-dev
+      - libxcb-icccm4-dev
+      - libxcb-image0-dev
+      - libxcb-keysyms1-dev
       - libxcb-present-dev
       - libxcb-randr0-dev
-      - libgbm-dev
+      - libxcb-record0-dev
+      - libxcb-render0-dev
+      - libxcb-render-util0-dev
+      - libxcb-res0-dev
+      - libxcb-screensaver0-dev
+      - libxcb-shape0-dev
       - libxcb-shm0-dev
       - libxcb-sync-dev
-      - libinput-dev
-      - nodejs
-      - libgtk-3-dev
       - libxcb-sync0-dev
-      - libcups2-dev
-      - libxshmfence-dev
-      - libgstreamer1.0-dev
-      - libclang-dev
-      - dh-exec
-      - libproxy-dev
-      - libsqlite3-dev
-      - libglx-dev
-      - libxcb-xkb-dev
-      - libxcb-screensaver0-dev
-      - libpcre2-dev
-      - libharfbuzz-dev
-      - libxcb-damage0-dev
-      - default-libmysqlclient-dev
-      - libxfixes-dev
-      - libx11-xcb-dev
-      - libvulkan-dev
-      - libmd4c-dev
-      - libxcb-render0-dev
-      - libxcb-keysyms1-dev
+      - libxcb-util-dev
+      - libxcb-xf86dri0-dev
       - libxcb-xfixes0-dev
-      - ninja-build
-      - libwayland-dev
-      - libgles-dev
+      - libxcb-xinerama0-dev
       - libxcb-xinput-dev
+      - libxcb-xkb-dev
+      - libxcb-xrm-dev
+      - libxcb-xv0-dev
+      - libxcb-xvmc0-dev
+      - libx11-dev
+      - libx11-xcb-dev
+      - libxcomposite-dev
+      - libxcursor-dev
       - libxext-dev
-      - libfreetype6-dev
-      - libudev-dev
-      - libmd4c-html0-dev
-      - libxcb-icccm4-dev
-      - libwayland-egl1-mesa
-      - libhunspell-dev
-      - libfontconfig1-dev
-      - libxcb-image0-dev
+      - libxfixes-dev
       - libxi-dev
-      - libssl-dev
+      - libxkbcommon-dev
+      - libxkbcommon-x11-dev
+      - libxkbfile-dev
+      - libxrender-dev
+      - libxshmfence-dev
       - libxtst-dev
+      - llvm-dev
+      - mesa-no-patchelf
+      - ninja-build
       - nodejs
-      - libxkbfile-dev
+      - pkg-config
+      - polkit-qt-1
+      - python-pip
+      - python2-minimal
+      - python3-html5lib
+      - python3-minimal
+      - qtconf
+      - zlib1g-dev
     override-build: |
       craftctl default
       mkdir -p $CRAFT_PART_INSTALL/etc/$CRAFT_PART_NAME
       cp $CRAFT_PART_BUILD/config.summary $CRAFT_PART_INSTALL/etc/$CRAFT_PART_NAME
+
+  debs:
+    after: [qt6]
+    plugin: nil
     stage-packages:
-      - libpq5
-      - libxcb-glx0
-      - libjpeg8
-      - libdrm-common
-      - libxcb-render-util0
-      - libxcursor1
-      - zlib1g
-      - liblttng-ust1
-      - libxkbcommon-x11-0
-      - libxcomposite1
-      - libatspi2.0-0
-      - libxcb-xtest0
-      - firebird3.0-common
-      - libxrender1
-      - libxcb-record0
-      - libgl1-mesa-glx
-      - libglib2.0-0
-      - libxcb-xvmc0
-      - libxcb-xv0
-      - libx11-6
-      - libfontconfig
-      - libxkbcommon0
-      - libxcb-dri2-0
-      - libicu70
-      - libgl1
-      - libdouble-conversion3
-      - libgles2-mesa
-      - llvm
-      - libzstd1
-      - unixodbc
-      - libsystemd0
-      - libxcb-xrm0
-      - libmtdev1
-      - libkrb5-3
-      - libopengl0
-      - libglu1-mesa
-      - libb2-1
-      - libxcb-util1
-      - libpng16-16
-      - libts0
-      - libxcb-composite0
-      - libxcb-ewmh2
-      - libasound2
-      - libxcb-shape0
-      - libxcb-res0
-      - libxcb1
-      - libxcb-cursor0
-      - libxcb-dpms0
-      - libsctp1
-      - libxcb-dri3-0
-      - libnss3
-      - libxcb-xinerama0
-      - libdbus-1-3
-      - libxcb-xf86dri0
-      - libxcb-present0
-      - libxcb-randr0
-      - libgbm1
-      - libxcb-shm0
-      - libinput10
-      - libgtk-3-0
-      - libxcb-sync1
-      - libcups2
-      - libxshmfence1
-      - libgstreamer1.0-0
-      - libclang1
-      - libproxy1v5
-      - libsqlite3-0
-      - libglx0
-      - libxcb-xkb1
-      - libxcb-screensaver0
-      - libpcre2-32-0
-      - libharfbuzz0b
-      - libxcb-damage0
-      - libmysqlclient21
-      - libxfixes3
-      - libx11-xcb1
-      - libvulkan1
-      - libmd4c0
-      - libxcb-render0
-      - libxcb-keysyms1
-      - libxcb-xfixes0
+      - bison
+      - clang
+      - default-libmysqlclient-dev
+      - docbook
+      - docbook-xml
+      - docbook-xsl
+      - firebird-dev
+      - flex
+      - gettext
+      - gperf
+      - libasound2-dev
+      - libass-dev
+      - libatspi2.0-dev
+      - libb2-dev
+      - libclang-dev
+      - libcups2-dev
+      - libdbus-1-dev
+      - libdouble-conversion-dev
+      - libdrm-dev
+      - libfreetype-dev
+      - libfreetype6-dev
+      - libfontconfig-dev
+      - libfontconfig1-dev
+      - libgbm-dev
+      - libgl-dev
+      - libgl1-mesa-dev
+      - libgles-dev
+      - libgles2-mesa-dev
+      - libglib2.0-dev
+      - libglx-dev
+      - libglu-dev
+      - libglu1-mesa-dev
+      - libgstreamer1.0-dev
+      - libgstreamer-plugins-base1.0-dev
+      - libharfbuzz-dev
+      - libhunspell-dev
+      - libicu-dev
+      - libinput-dev
+      - libjpeg-dev
+      - libkrb5-dev
+      - liblttng-ust-dev
+      - libmd4c-dev
+      - libmd4c-html0-dev
+      - libmtdev-dev
+      - libnss3-dev
+      - libopengl-dev
+      - libpcre2-dev
+      - libpng-dev
+      - libpq-dev
+      - libproxy-dev
+      - libpulse-dev
+      - libsqlite3-dev
+      - libsctp-dev
+      - libssl-dev
+      - libsystemd-dev
+      - libts-dev
+      - libudev-dev
+      - libva-dev
+      - libwayland-dev
+      - libwayland-egl1-mesa
       - libwayland-server0
-      - libgles1
-      - libxcb-xinput0
-      - libxext6
-      - libfreetype6
-      - libudev1
-      - libmd4c-html0
-      - libxcb-icccm4
-      - libhunspell-1.7-0
-      - libfontconfig1
-      - libxcb-image0
-      - libxi6
-      - libssl3
-      - libxtst6
-      - libxkbfile1
-    override-stage: |
-      craftctl default
-      find $CRAFT_STAGE -type f,l -name "*.pc" -exec bash -c "sed -i 's:/root/stage:/snap/$CRAFT_PROJECT_NAME/current:g' {}*" \;
+      - libxcb-composite0-dev
+      - libxcb-damage0-dev
+      - libxcb-dpms0-dev
+      - libxcb-dri2-0-dev
+      - libxcb-dri3-dev
+      - libxcb-ewmh-dev
+      - libxcb-glx0-dev
+      - libxcb-icccm4-dev
+      - libxcb-image0-dev
+      - libxcb-keysyms1-dev
+      - libxcb-present-dev
+      - libxcb-randr0-dev
+      - libxcb-record0-dev
+      - libxcb-render0-dev
+      - libxcb-render-util0-dev
+      - libxcb-res0-dev
+      - libxcb-screensaver0-dev
+      - libxcb-shape0-dev
+      - libxcb-shm0-dev
+      - libxcb-sync-dev
+      - libxcb-sync0-dev
+      - libxcb-util-dev
+      - libxcb-xf86dri0-dev
+      - libxcb-xfixes0-dev
+      - libxcb-xinerama0-dev
+      - libxcb-xinput-dev
+      - libxcb-xkb-dev
+      - libxcb-xrm-dev
+      - libxcb-xv0-dev
+      - libxcb-xvmc0-dev
+      - libx11-dev
+      - libx11-xcb-dev
+      - libxcomposite-dev
+      - libxcursor-dev
+      - libxext-dev
+      - libxfixes-dev
+      - libxi-dev
+      - libxkbcommon-dev
+      - libxkbcommon-x11-dev
+      - libxkbfile-dev
+      - libxrender-dev
+      - libxshmfence-dev
+      - libxtst-dev
+      - llvm-dev
+      - mesa-no-patchelf
+      - ninja-build
+      - nodejs
+      - pkg-config
+      - polkit-qt-1
+      - python-pip
+      - python2-minimal
+      - python3-html5lib
+      - python3-minimal
+      - qtconf
+      - zlib1g-dev
+    organize:
+      usr/share/pkgconfig: usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/pkgconfig
+      lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR: usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR
+    prime:
+      - -etc
+      - -lib
+      - -usr/lib/systemd
+      - -usr/share/bug
+      - -usr/share/dbus-1
+      - -usr/share/doc
+      - -usr/share/doc-base
+      - -usr/share/lintian
+      - -usr/share/man
 
+  fix-pkgconfig:
+    plugin: nil
+    after: [debs]
+    override-stage: |
+      set -eux
+      for PC in $(find . -path "*/pkgconfig/*.pc")
+      do
+        sed -i '1cprefix=/snap/$CRAFT_PROJECT_NAME/current/usr' $PC
+      done
+      for snap in "core22" "ffmpeg-2204-sdk"; do
+        cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$SNAPCRAFT_PRIME/{}" \;
+      done



More information about the Neon-commits mailing list