diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index b44b50d5..6664d766 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -8,7 +8,6 @@ contact: https://0xzer0x.github.io/contact summary: Read and listen to the Quran description: | Quran Companion is a cross-platform Quran reader and player with recitation download capabilities, verse highlighting, re-sizable Quran font, and a variety of tafsir books and translations. - grade: stable confinement: strict architectures: [amd64] @@ -17,17 +16,16 @@ lint: ignore: - classic - library - apps: quran-companion: + command-chain: [bin/desktop-launch] command: usr/bin/quran-companion common-id: io.github._0xzer0x.qurancompanion desktop: usr/share/applications/io.github._0xzer0x.qurancompanion.desktop environment: - LD_LIBRARY_PATH: "$SNAP/opt/qt6/6.7.3/gcc_64/lib:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio:$LD_LIBRARY_PATH" + LD_LIBRARY_PATH: "$SNAP/opt/qt6/6.8.0/gcc_64/lib:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/pulseaudio:$LD_LIBRARY_PATH" PULSE_RUNTIME_PATH: "$XDG_RUNTIME_DIR/../pulse" - XDG_DATA_DIRS: "$SNAP/usr/share:$XDG_DATA_DIRS" - WAYLAND_DISPLAY: "/run/user/1000/wayland-0" + WAYLAND_DISPLAY: "$XDG_RUNTIME_DIR/../wayland-0" QT_QPA_PLATFORM: "wayland-egl;xcb" QT_QPA_PLATFORMTHEME: "xdgdesktopportal" plugs: @@ -39,44 +37,229 @@ apps: - opengl - wayland - x11 - +hooks: + configure: + command-chain: + - bin/hooks-configure-desktop + plugs: + - desktop layout: - /usr/share/libdrm: - bind: $SNAP/graphics/usr/share/libdrm - /usr/share/X11/XErrorDB: - symlink: $SNAP/graphics/usr/share/X11/XErrorDB - /usr/share/X11/locale: - symlink: $SNAP/graphics/usr/share/X11/locale - /usr/share/X11/xkb: - symlink: $SNAP/usr/share/X11/xkb - /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/gdk-pixbuf-2.0: - symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/gdk-pixbuf-2.0 - + /usr/share/X11: + symlink: $SNAP/usr/share/X11 +plugs: + desktop: + mount-host-font-cache: false + icon-themes: + interface: content + target: $SNAP/data-dir/icons + default-provider: gtk-common-themes + sound-themes: + interface: content + target: $SNAP/data-dir/sounds + default-provider: gtk-common-themes parts: qt: plugin: nil build-packages: - - python3 - - python3-pip - override-build: > - mkdir -p $SNAPCRAFT_PART_INSTALL/usr/bin - - echo -en "[Paths]\nPlugins = - ../../opt/qt6/6.7.3/gcc_64/plugins\nLibraries = - ../../opt/qt6/6.7.3/gcc_64/lib\nImports = - ../../opt/qt6/6.7.3/gcc_64/qml\nQml2Imports = - ../../opt/qt6/6.7.3/gcc_64/qml" > "$SNAPCRAFT_PART_INSTALL/usr/bin/qt.conf" - - mkdir -p $SNAPCRAFT_PART_INSTALL/opt/qt6 - - cd $SNAPCRAFT_PART_INSTALL/opt/qt6 - - pip install aqtinstall - - aqt install-qt linux desktop 6.7.3 linux_gcc_64 -m qtimageformats qtmultimedia qtnetworkauth + - libaudio-dev + - libao-dev + - libpcaudio-dev + - libasound2-dev + - libavdevice-dev + - libvpx-dev + - libvdpau-dev + - libva-dev + - libudfread-dev + - libtwolame-dev + - libtheora-dev + - libswscale-dev + - libswresample-dev + - libssh-gcrypt-dev + - libsrt-gnutls-dev + - libspeex-dev + - libsodium-dev + - libsnappy-dev + - libshine-dev + - librsvg2-dev + - librabbitmq-dev + - libpgm-dev + - libopenmpt-dev + - libopenjp2-7-dev + - libnuma-dev + - libnorm-dev + - libmpg123-dev + - libmfx-dev + - libgme-dev + - libdav1d-dev + - libchromaprint-dev + - libcodec2-dev + - libbluray-dev + - libavutil-dev + - libavformat-dev + - libavcodec-dev + - libaom-dev + - ocl-icd-opencl-dev + - libopus-dev + - libpulse-dev + - libopenal-dev + - libsqlite3-dev + - libdbus-1-dev + - libegl-dev + - libfontconfig1-dev + - libfreetype-dev + - libglx-dev + - libgtk-3-dev + - libharfbuzz-dev + - libice-dev + - libicu-dev + - liblcms2-dev + - libopengl-dev + - libpcre2-dev + - libpng-dev + - libsm-dev + - libssl-dev + - libvulkan-dev + - libwayland-dev + - libx11-dev + - libx11-xcb-dev + - libxcb-composite0-dev + - libxcb1-dev + - libxcb-cursor-dev + - libxcb-glx0-dev + - libxcb-icccm4-dev + - libxcb-image0-dev + - libxcb-keysyms1-dev + - libxcb-randr0-dev + - libxcb-render0-dev + - libxcb-render-util0-dev + - libxcb-shape0-dev + - libxcb-shm0-dev + - libxcb-sync-dev + - libxcb-util-dev + - libxcb-xfixes0-dev + - libxcb-xkb-dev + - libxkbcommon-dev + - libxkbcommon-x11-dev + - libxext-dev + - libxi-dev + - libxinerama-dev + - zlib1g-dev + stage-packages: + - libxcomposite1 + - libxcursor1 + - libaudio2 + - libao4 + - libpcaudio0 + - libasound2 + - libavdevice58 + - libwebpmux3 + - libvpx7 + - libvorbisfile3 + - libvdpau1 + - libva-x11-2 + - libudfread0 + - libtwolame0 + - libtheora0 + - libswscale5 + - libswresample3 + - libssh-gcrypt-4 + - libspeex1 + - libsodium23 + - libsnappy1v5 + - libshine3 + - librsvg2-2 + - librabbitmq4 + - libpgm-5.3-0 + - libopenmpt0 + - libopenjp2-7 + - libnuma1 + - libnorm1 + - libmpg123-0 + - libmfx1 + - libgme0 + - libdav1d5 + - libchromaprint1 + - libcodec2-1.0 + - libbluray2 + - libavutil56 + - libavformat58 + - libavcodec58 + - libaom3 + - ocl-icd-libopencl1 + - libpulse0 + - libpulsedsp + - libdbus-1-3 + - libegl1 + - libfontconfig1 + - libfreetype6 + - libglx0 + - libgtk-3-0 + - libharfbuzz0b + - libice6 + - libicu70 + - liblcms2-2 + - libopengl0 + - libpcre2-16-0 + - libpng16-16 + - libsm6 + - libssl3 + - libvulkan1 + - libwayland-client0 + - libwayland-cursor0 + - libwayland-egl1 + - libwayland-server0 + - libx11-6 + - libx11-xcb1 + - libxcb1 + - libxcb-cursor0 + - libxcb-glx0 + - libxcb-icccm4 + - libxcb-image0 + - libxcb-keysyms1 + - libxcb-randr0 + - libxcb-render0 + - libxcb-render-util0 + - libxcb-shape0 + - libxcb-shm0 + - libxcb-sync1 + - libxcb-util1 + - libxcb-xfixes0 + - libxcb-xkb1 + - libxkbcommon0 + - libxkbcommon-x11-0 + - zlib1g + override-pull: | + QT=6.8.0 + git clone -b v${QT} --depth=1 https://code.qt.io/qt/qt5.git . + git submodule update --init --recursive --depth=1 qtbase qtdeclarative qtwayland qtimageformats qtsvg qtmultimedia qtshadertools qttools + override-build: | + ./configure \ + -prefix /usr \ + -libdir /usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR \ + -release \ + -opensource \ + -confirm-license \ + -openssl-linked \ + -nomake examples \ + -nomake tests \ + -- -DFFMPEG_DIR=/usr -DQT_DEPLOY_FFMPEG=ON \ + + cmake --build . -j$CRAFT_PARALLEL_BUILD_COUNT + DESTDIR="$CRAFT_PART_INSTALL" cmake --install . prime: - - opt/qt6 - - usr/bin/qt.conf + - -./usr/bin + - -./usr/doc + - -./usr/include + - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/cmake + - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/metatypes + - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/pkgconfig + - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/*.a + - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/*.la + - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/*.so + - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/*.prl + - -./usr/libexec + - -./usr/mkspecs + - -./usr/modules metadata: plugin: dump @@ -89,21 +272,21 @@ parts: "*logo256.png": usr/share/icons/hicolor/256x256/apps/io.github._0xzer0x.qurancompanion.png quran-companion: - plugin: cmake + after: + - qt + - metadata source: . source-type: git source-branch: main source-depth: 1 + plugin: cmake parse-info: - [usr/share/metainfo/io.github._0xzer0x.qurancompanion.metainfo.xml] + - usr/share/metainfo/io.github._0xzer0x.qurancompanion.metainfo.xml cmake-generator: Ninja cmake-parameters: - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_INSTALL_PREFIX=/usr - - -DCMAKE_PREFIX_PATH="$CRAFT_STAGE/opt/qt6/6.7.3/gcc_64" - after: - - qt - - metadata + - -DCMAKE_PREFIX_PATH="$CRAFT_STAGE/opt/qt6/6.8.0/gcc_64" build-packages: - libpulse-dev - libsqlite3-dev @@ -126,42 +309,19 @@ parts: - libopengl0 - libgtk-3-0 - libgtk-3-common - - libgdk-pixbuf-2.0-0 - - libgdk-pixbuf2.0-common - - libglib2.0-0 - - libx11-6 - - libx11-xcb1 - - libxcb1 - - libxcb-cursor0 - - libxcb-glx0 - - libxcb-icccm4 - - libxcb-image0 - - libxcb-keysyms1 - - libxcb-randr0 - - libxcb-render0 - - libxcb-render-util0 - - libxcb-shape0 - - libxcb-shm0 - - libxcb-sync1 - - libxcb-util1 - - libxcb-xfixes0 - - libxcb-xkb1 - - libxkbcommon0 - - libxkbcommon-x11-0 - - libwayland-egl1 - - libwayland-client0 - - libwayland-cursor0 - - hicolor-icon-theme - - adwaita-icon-theme - - shared-mime-info - - xdg-user-dirs - - libcanberra-gtk-module - - libcanberra-gtk3-module + prime: + - usr/bin - icons: - plugin: nil + desktop-qt: after: - quran-companion + source: https://github.com/desktop-app/snapcraft-desktop-helpers.git + source-depth: 1 + source-subdir: qt + plugin: make + make-parameters: ["FLAVOR=qt5"] + build-environment: + - LD_LIBRARY_PATH: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} build-packages: - build-essential - dpkg-dev @@ -171,17 +331,13 @@ parts: stage-packages: - libc-bin - libgdk-pixbuf-2.0-0 - - libgdk-pixbuf2.0-0 - - libgdk-pixbuf2.0-common - - libpng-tools - - libpng16-16 - libnvidia-egl-wayland1 - libxkbcommon0 + - locales-all - shared-mime-info - xdg-user-dirs override-prime: | craftctl default - usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders --update-cache update-mime-database usr/share/mime glib-compile-schemas usr/share/glib-2.0/schemas for theme in usr/share/icons/*; do