| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508 |
- name: telegram-desktop
- adopt-info: telegram
- base: core24
- grade: stable
- confinement: strict
- compression: lzo
- apps:
- telegram-desktop:
- command: usr/bin/telegram-desktop
- command-chain:
- - bin/desktop-launch
- common-id: org.telegram.desktop
- desktop: usr/share/applications/org.telegram.desktop.desktop
- autostart: telegram-desktop_telegram-desktop.desktop
- plugs:
- - alsa
- - audio-playback
- - audio-record
- - camera
- - desktop
- - desktop-legacy
- - gsettings
- - hardware-observe
- - home
- - network
- - network-bind
- - network-status
- - opengl
- - removable-media
- - unity7
- - wayland
- - x11
- slots:
- - mpris
- hooks:
- configure:
- command-chain:
- - bin/hooks-configure-desktop
- plugs:
- - desktop
- plugs:
- desktop:
- mount-host-font-cache: false
- # Support for common GTK themes
- # https://forum.snapcraft.io/t/how-to-use-the-system-gtk-theme-via-the-gtk-common-themes-snap/6235
- gtk-3-themes:
- interface: content
- target: $SNAP/data-dir/themes
- default-provider: gtk-common-themes
- 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
- layout:
- /usr/share/alsa:
- bind: $SNAP/usr/share/alsa
- /usr/share/pipewire:
- bind: $SNAP/usr/share/pipewire
- /usr/share/X11:
- bind: $SNAP/usr/share/X11
- /usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gtk-3.0:
- bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gtk-3.0
- /usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/pipewire-0.3:
- bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/pipewire-0.3
- /usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/spa-0.2:
- bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/spa-0.2
- /usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.1:
- bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.1
- parts:
- telegram:
- plugin: cmake
- source: .
- source-type: git
- parse-info: [usr/share/metainfo/org.telegram.desktop.metainfo.xml]
- build-environment:
- - LD_LIBRARY_PATH: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
- - LDFLAGS: ${LDFLAGS:+$LDFLAGS} -s
- build-packages:
- - clang
- - libtool-bin
- - python3
- - protobuf-compiler
- - libasound2-dev
- - libavif-dev
- - libboost-regex-dev
- - libgirepository1.0-dev
- - libglib2.0-dev
- - libheif-dev
- - libopenal-dev
- - libopus-dev
- - libprotobuf-dev
- - libpulse-dev
- - libssl-dev
- - libxcb1-dev
- - libxcb-keysyms1-dev
- - libxcb-record0-dev
- - libxcb-screensaver0-dev
- - zlib1g-dev
- stage-packages:
- - libasound2t64
- - libavif16
- - libboost-regex1.83.0
- - libgeoclue-2-0
- - libgeocode-glib-2-0
- - libglib2.0-0t64
- - libheif1
- - libopenal1
- - libopus0
- - libprotobuf-lite32t64
- - libpulse0
- - libssl3t64
- - libwebkit2gtk-4.1-0
- - libxcb1
- - libxcb-keysyms1
- - libxcb-record0
- - libxcb-screensaver0
- - zlib1g
- - glib-networking
- cmake-generator: Ninja
- cmake-parameters:
- - -DCMAKE_BUILD_TYPE=Release
- - -DCMAKE_INSTALL_PREFIX=/usr
- - -DCMAKE_PREFIX_PATH=$CRAFT_STAGE/usr
- - -DTDESKTOP_API_ID=611335
- - -DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c
- - -DDESKTOP_APP_USE_PACKAGED_LAZY=ON
- override-pull: |
- craftctl default
- version_file=Telegram/build/version
- version=$(sed -n "s/AppVersionStr[ ]\+\(.*\)\+/\1/p" $version_file)
- beta=$(sed -n "s/BetaChannel[ ]\+\(.*\)\+/\1/p" $version_file)
- if [ "$beta" != "0" ]; then
- version="$version-beta"
- fi
- version="${version}$(git describe --tags | sed 's,^v[^-]\+,,')"
- craftctl set version="$version"
- override-build: |
- craftctl default
- APP_ID=org.telegram.desktop
- sed -i "s/^Icon=$APP_ID$/Icon=snap.telegram-desktop./g" "$CRAFT_PART_INSTALL/usr/share/applications/$APP_ID.desktop"
- for i in $(find "$CRAFT_PART_INSTALL/usr/share/icons" -name "$APP_ID*.svg" -o -name "$APP_ID*.png"); do
- PREFIXED="$(dirname "$i")/snap.$CRAFT_PROJECT_NAME.$(basename "$i" | sed "s/$APP_ID//")"
- mv "$i" "$PREFIXED"
- DEST="$(dirname "$i" | sed 's@usr/share@meta/gui@')"
- mkdir -p "$DEST"
- cp -r "$PREFIXED" "$DEST"
- done
- after:
- - ada
- - ffmpeg
- - libjxl
- - qt
- - rnnoise
- - webrtc
- patches:
- source: https://github.com/desktop-app/patches.git
- source-depth: 1
- source-commit: fb35ec726cf0a99eead201ddf80e1e717b9fa7c2
- plugin: dump
- override-pull: |
- craftctl default
- cp -r . "$CRAFT_STAGE/patches"
- override-prime: |
- rm -rf patches
- stage: [-./*]
- desktop-qt:
- 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
- - gtk-update-icon-cache
- - libglib2.0-bin
- - libgtk-3-0t64
- stage-packages:
- - libc-bin
- - libgdk-pixbuf-2.0-0
- - libnvidia-egl-wayland1
- - libxkbcommon0
- - locales-all
- - shared-mime-info
- - xdg-user-dirs
- override-prime: |
- craftctl default
- update-mime-database usr/share/mime
- glib-compile-schemas usr/share/glib-2.0/schemas
- for theme in usr/share/icons/*; do
- if [ -f "$theme/index.theme" ] && [ ! -f "$theme/icon-theme.cache" ]; then
- update-icon-caches "$theme"
- fi
- done
- GTK_PATH=$PWD/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gtk-3.0 /usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libgtk-3-0t64/gtk-query-immodules-3.0 > usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gtk-3.0/3.0.0/immodules/immodules.cache
- after:
- - telegram
- ada:
- source: https://github.com/ada-url/ada.git
- source-depth: 1
- source-tag: v2.9.0
- plugin: cmake
- build-environment:
- - LDFLAGS: ${LDFLAGS:+$LDFLAGS} -s
- cmake-generator: Ninja
- cmake-parameters:
- - -DCMAKE_BUILD_TYPE=Release
- - -DCMAKE_INSTALL_PREFIX=/usr
- - -DADA_TESTING=OFF
- - -DADA_TOOLS=OFF
- prime:
- - -./usr/include
- - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/cmake
- - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/*.a
- ffmpeg:
- plugin: nil
- build-packages:
- - libavcodec-dev
- - libavfilter-dev
- - libavformat-dev
- - libavutil-dev
- - libswresample-dev
- - libswscale-dev
- stage-packages:
- - libavcodec60
- - libavfilter9
- - libavformat60
- - libavutil58
- - libswresample4
- - libswscale7
- - va-driver-all
- - vdpau-driver-all
- override-build: |
- craftctl default
- mv "$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/blas/"* "$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR"
- rmdir "$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/blas"
- mv "$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/lapack/"* "$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR"
- rmdir "$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/lapack"
- libjxl:
- source: https://github.com/libjxl/libjxl.git
- source-depth: 1
- source-tag: v0.11.1
- plugin: cmake
- build-environment:
- - LDFLAGS: ${LDFLAGS:+$LDFLAGS} -s
- cmake-generator: Ninja
- cmake-parameters:
- - -DCMAKE_BUILD_TYPE=Release
- - -DCMAKE_INSTALL_PREFIX=/usr
- - -DBUILD_TESTING=OFF
- - -DJPEGXL_ENABLE_DEVTOOLS=OFF
- - -DJPEGXL_ENABLE_TOOLS=OFF
- - -DJPEGXL_INSTALL_JPEGLI_LIBJPEG=ON
- - -DJPEGXL_ENABLE_DOXYGEN=OFF
- - -DJPEGXL_ENABLE_MANPAGES=OFF
- - -DJPEGXL_ENABLE_BENCHMARK=OFF
- - -DJPEGXL_ENABLE_EXAMPLES=OFF
- - -DJPEGXL_ENABLE_JNI=OFF
- - -DJPEGXL_ENABLE_SJPEG=OFF
- - -DJPEGXL_ENABLE_OPENEXR=OFF
- - -DJPEGXL_ENABLE_SKCMS=OFF
- stage:
- - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libbrotli*
- - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libhwy*
- prime:
- - -./usr/bin
- - -./usr/include
- - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/cmake
- - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/pkgconfig
- - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/*.a
- - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/*.so
- - -./usr/share
- qt:
- plugin: nil
- build-environment:
- - LDFLAGS: ${LDFLAGS:+$LDFLAGS} -s
- build-packages:
- - libdbus-1-dev
- - libegl-dev
- - libfontconfig1-dev
- - libfreetype-dev
- - libglib2.0-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
- - 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
- - zlib1g-dev
- stage-packages:
- - libdbus-1-3
- - libegl1
- - libfontconfig1
- - libfreetype6
- - libglib2.0-0t64
- - libglx0
- - libgtk-3-0t64
- - libharfbuzz0b
- - libice6
- - libicu74
- - liblcms2-2
- - libopengl0
- - libpcre2-16-0
- - libpng16-16t64
- - libsm6
- - libssl3t64
- - 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
- - mesa-vulkan-drivers
- - xkb-data
- override-pull: |
- QT=6.8.2
- git clone -b v${QT} --depth=1 https://github.com/qt/qt5.git .
- git submodule update --init --recursive --depth=1 qtbase qtdeclarative qtwayland qtimageformats qtsvg qtshadertools
- cd qtbase
- find $CRAFT_STAGE/patches/qtbase_${QT} -type f -print0 | sort -z | xargs -r0 git apply
- cd ../qtwayland
- find $CRAFT_STAGE/patches/qtwayland_${QT} -type f -print0 | sort -z | xargs -r0 git apply
- cd ..
- override-build: |
- cmake -GNinja -B $CRAFT_PART_BUILD \
- -DCMAKE_BUILD_TYPE=Release \
- -DCMAKE_INSTALL_PREFIX=/usr \
- -DCMAKE_PREFIX_PATH=$CRAFT_STAGE/usr \
- -DINSTALL_LIBDIR=/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR \
- -DQT_GENERATE_SBOM=OFF \
- -DINPUT_openssl=linked
- cmake --build . -j$CRAFT_PARALLEL_BUILD_COUNT
- DESTDIR="$CRAFT_PART_INSTALL" cmake --install .
- prime:
- - -./usr/bin
- - -./usr/doc
- - -./usr/include
- - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/cmake
- - -./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/*.prl
- - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/*.so
- - -./usr/libexec
- - -./usr/metatypes
- - -./usr/mkspecs
- - -./usr/modules
- - -./**/objects-*
- after:
- - libjxl
- - patches
- rnnoise:
- source: https://gitlab.xiph.org/xiph/rnnoise.git
- source-depth: 1
- source-commit: 7f449bf8bd3b933891d12c30112268c4090e4d59
- plugin: autotools
- build-environment:
- - CFLAGS: -O2 -s
- autotools-configure-parameters:
- - --prefix=/usr
- - --libdir=\${exec_prefix}/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR
- - --disable-static
- - --disable-examples
- - --disable-doc
- prime:
- - -./usr/include
- - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/pkgconfig
- - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/*.la
- - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/*.so
- - -./usr/share
- systemd:
- plugin: nil
- stage-packages:
- - systemd
- stage:
- - ./usr/bin/systemd-detect-virt
- webrtc:
- source: https://github.com/desktop-app/tg_owt.git
- source-depth: 1
- source-commit: 8198c4d8b91e22d68eb5c7327fd408e3b6abcc79
- plugin: cmake
- build-environment:
- - LDFLAGS: ${LDFLAGS:+$LDFLAGS} -s
- build-packages:
- - yasm
- - libdrm-dev
- - libegl-dev
- - libgbm-dev
- - libgl-dev
- - libglib2.0-dev
- - libopenh264-dev
- - libopus-dev
- - libpipewire-0.3-dev
- - libssl-dev
- - libvpx-dev
- - libx11-dev
- - libxcomposite-dev
- - libxdamage-dev
- - libxext-dev
- - libxfixes-dev
- - libxrender-dev
- - libxrandr-dev
- - libxtst-dev
- stage-packages:
- - libdrm2
- - libegl1
- - libgbm1
- - libgl1
- - libglib2.0-0t64
- - libopenh264-7
- - libopus0
- - libssl3t64
- - libvpx9
- - libx11-6
- - libxcomposite1
- - libxdamage1
- - libxext6
- - libxfixes3
- - libxrender1
- - libxrandr2
- - libxtst6
- - pipewire
- cmake-generator: Ninja
- cmake-parameters:
- - -DCMAKE_BUILD_TYPE=Release
- - -DCMAKE_INSTALL_PREFIX=/usr
- - -DCMAKE_PREFIX_PATH=$CRAFT_STAGE/usr
- prime:
- - -./usr/include
- - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/cmake
- - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/*.a
- after:
- - ffmpeg
- - libjxl
|