From d539520d29f11ced8e263f34f441174867c366f6 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Mon, 21 Mar 2022 13:10:22 +1000 Subject: [PATCH] Kotatogram: bump version --- .../kotatogram_desktop-1.4.8.recipe | 334 ------------- .../kotatogram_desktop-1.4.9.recipe | 177 +++++++ .../patches/cmake_helpers-1.4.8.patchset | 39 -- ...hset => kotatogram_desktop-1.4.9.patchset} | 462 ++++++++++++++---- .../patches/lib_base-1.4.8.patchset | 170 ------- .../patches/lib_ui-1.4.8.patchset | 55 --- .../patches/lib_webrtc-1.4.8.patchset | 41 -- ....4.8.patchset => libtgvoip-1.4.9.patchset} | 133 +++-- .../patches/tgcalls-1.4.8.patchset | 44 -- 9 files changed, 637 insertions(+), 818 deletions(-) delete mode 100644 net-im/kotatogram-desktop/kotatogram_desktop-1.4.8.recipe create mode 100644 net-im/kotatogram-desktop/kotatogram_desktop-1.4.9.recipe delete mode 100644 net-im/kotatogram-desktop/patches/cmake_helpers-1.4.8.patchset rename net-im/kotatogram-desktop/patches/{kotatogram_desktop-1.4.8.patchset => kotatogram_desktop-1.4.9.patchset} (55%) delete mode 100644 net-im/kotatogram-desktop/patches/lib_base-1.4.8.patchset delete mode 100644 net-im/kotatogram-desktop/patches/lib_ui-1.4.8.patchset delete mode 100644 net-im/kotatogram-desktop/patches/lib_webrtc-1.4.8.patchset rename net-im/kotatogram-desktop/patches/{libtgvoip-1.4.8.patchset => libtgvoip-1.4.9.patchset} (80%) delete mode 100644 net-im/kotatogram-desktop/patches/tgcalls-1.4.8.patchset diff --git a/net-im/kotatogram-desktop/kotatogram_desktop-1.4.8.recipe b/net-im/kotatogram-desktop/kotatogram_desktop-1.4.8.recipe deleted file mode 100644 index 72c2304ae..000000000 --- a/net-im/kotatogram-desktop/kotatogram_desktop-1.4.8.recipe +++ /dev/null @@ -1,334 +0,0 @@ -SUMMARY="Experimental Telegram Desktop fork" -DESCRIPTION="Kotatogram Desktop, being based on Telegram Desktop, has all \ -its features, but it also has some more useful and cosmetic features." -HOMEPAGE="https://kotatogram.github.io/" -COPYRIGHT="2013-2021 Telegram - 2021 Kotatogram Team" -LICENSE="GNU GPL v3" -REVISION="2" -SOURCE_URI="https://github.com/kotatogram/kotatogram-desktop/archive/refs/tags/k$portVersion.tar.gz" -CHECKSUM_SHA256="ba65b7a056caca2c91b590463cf54fffe8dbab7b76d145bbfd64a8bb03978aac" -SOURCE_FILENAME="kotatogram-$portVersion.tar.gz" -SOURCE_DIR="kotatogram-desktop-k$portVersion" -#libtgvoip -srcGitRev_2="a090c6a8f7bfb365b301d85bb8c9664d71321c5c" -SOURCE_URI_2="https://github.com/telegramdesktop/libtgvoip/archive/$srcGitRev_2.tar.gz" -CHECKSUM_SHA256_2="34f1b49cfdc71dd05477986998c0e3888bac411853d8b2ee9ddd48dfc416e88e" -SOURCE_FILENAME_2="libtgvoip-$srcGitRev_2.tar.gz" -SOURCE_DIR_2="libtgvoip-$srcGitRev_2" -#rlottie -srcGitRev_3="8c69fc20cf2e150db304311f1233a4b55a8892d7" -SOURCE_URI_3="https://github.com/desktop-app/rlottie/archive/$srcGitRev_3.tar.gz" -CHECKSUM_SHA256_3="cbc1f4bf8c28ffeb89852eda7056ff6aa80d49cb45736a583c931d5ceeccdcdd" -SOURCE_FILENAME_3="rlottie-$srcGitRev_3.tar.gz" -SOURCE_DIR_3="rlottie-$srcGitRev_3" -#lib_crl -srcGitRev_4="ec103d6bccaa59b56537c8658c9e41415bb9ccaf" -SOURCE_URI_4="https://github.com/desktop-app/lib_crl/archive/$srcGitRev_4.tar.gz" -CHECKSUM_SHA256_4="64edbf9083c9ce7f6e98e741596e47dafc9dbcc818e45b3288186c9668fad153" -SOURCE_FILENAME_4="lib_crl-$srcGitRev_4.tar.gz" -SOURCE_DIR_4="lib_crl-$srcGitRev_4" -#lib_rpl -srcGitRev_5="94a42b775ab4e46e5edeb88d8ed6c06f9e869c61" -SOURCE_URI_5="https://github.com/desktop-app/lib_rpl/archive/$srcGitRev_5.tar.gz" -CHECKSUM_SHA256_5="355477e3b53ffff6260bab92f8acd859db4e6cfc7a69286ec49da85ad67decd3" -SOURCE_FILENAME_5="lib_rpl-$srcGitRev_5.tar.gz" -SOURCE_DIR_5="lib_rpl-$srcGitRev_5" -#lib_base -srcGitRev_6="087bf4e6159678fada93eea39e923ce634f51caf" -SOURCE_URI_6="https://github.com/desktop-app/lib_base/archive/$srcGitRev_6.tar.gz" -CHECKSUM_SHA256_6="95e29518b33f775c03d9fdd22d459d5bb4576178d1a10ad845b847d50a1724b8" -SOURCE_FILENAME_6="lib_base-$srcGitRev_6.tar.gz" -SOURCE_DIR_6="lib_base-$srcGitRev_6" -#codegen -srcGitRev_7="a60edf917419407cfe5c6095a56ccf363417ebd8" -SOURCE_URI_7="https://github.com/desktop-app/codegen/archive/$srcGitRev_7.tar.gz" -CHECKSUM_SHA256_7="06ee75ceb3be9cbd1471f14c1edce07b30189b012edb71a3c8ea1fdf8e30ad52" -SOURCE_FILENAME_7="codegen-$srcGitRev_7.tar.gz" -SOURCE_DIR_7="codegen-$srcGitRev_7" -#lib_ui -srcGitRev_8="f8f407004b139a1cd882c538f00e8a87b5e65b9a" -SOURCE_URI_8="https://github.com/kotatogram/lib_ui/archive/$srcGitRev_8.tar.gz" -CHECKSUM_SHA256_8="1e54c8b6b6da81c52a23d338947220ce30594ad565ddfa5424e909f9cae02531" -SOURCE_FILENAME_8="lib_ui-$srcGitRev_8.tar.gz" -SOURCE_DIR_8="lib_ui-$srcGitRev_8" -#lib_rlottie -srcGitRev_9="0671bf70547381effcf442ec9618e04502a8adbc" -SOURCE_URI_9="https://github.com/desktop-app/lib_rlottie/archive/$srcGitRev_9.tar.gz" -CHECKSUM_SHA256_9="28b68af080b03bf0dd66bab5f9dceb712e0b3203fd5ad7f8096050272234941b" -SOURCE_FILENAME_9="lib_rlottie-$srcGitRev_9.tar.gz" -SOURCE_DIR_9="lib_rlottie-$srcGitRev_9" -#lib_lottie -srcGitRev_10="ad7fce76f3b403471a296c928bae67cd36b8b2cf" -SOURCE_URI_10="https://github.com/desktop-app/lib_lottie/archive/$srcGitRev_10.tar.gz" -CHECKSUM_SHA256_10="b206fa1af74bf81bc54abcf14dc573e22d4e647de38b3c977d9e3fe18c99ec95" -SOURCE_FILENAME_10="lib_lottie-$srcGitRev_10.tar.gz" -SOURCE_DIR_10="lib_lottie-$srcGitRev_10" -#lib_tl -srcGitRev_11="45faed44e7f4d11fec79b7a70e4a35dc91ef3fdb" -SOURCE_URI_11="https://github.com/desktop-app/lib_tl/archive/$srcGitRev_11.tar.gz" -CHECKSUM_SHA256_11="1db86a372f9c5d87b836a60ee16bf6a69dd343840498bc0121118ac9fc2b80e1" -SOURCE_FILENAME_11="lib_tl-$srcGitRev_11.tar.gz" -SOURCE_DIR_11="lib_tl-$srcGitRev_11" -#lib_spellcheck -srcGitRev_12="b1b295fee18e44534d9a96ec9858baa4c932f7d2" -SOURCE_URI_12="https://github.com/desktop-app/lib_spellcheck/archive/$srcGitRev_12.tar.gz" -CHECKSUM_SHA256_12="2a3958a2d7b5db14b73508dd525b847e5fac20b2168a58fad83d4e33ac007ed1" -SOURCE_FILENAME_12="lib_spellcheck-$srcGitRev_12.tar.gz" -SOURCE_DIR_12="lib_spellcheck-$srcGitRev_12" -#lib_storage -srcGitRev_13="73d57840ac603107381e0e6b22d5b3bdcae492c6" -SOURCE_URI_13="https://github.com/desktop-app/lib_storage/archive/$srcGitRev_13.tar.gz" -CHECKSUM_SHA256_13="ce440ae1cbfc35a4e1f04adfe14497991a9347045970620b199abfd3f162b65b" -SOURCE_FILENAME_13="lib_storage-$srcGitRev_13.tar.gz" -SOURCE_DIR_13="lib_storage-$srcGitRev_13" -#cmake_helpers -srcGitRev_14="7d2037630abad09ee7b8857710aa7a0efd0c5672" -SOURCE_URI_14="https://github.com/kotatogram/cmake_helpers/archive/$srcGitRev_14.tar.gz" -CHECKSUM_SHA256_14="035954107782d63781f2328ce11c051e74a379d5cf63f4d38d6c77502f979a97" -SOURCE_FILENAME_14="cmake_helpers-$srcGitRev_14.tar.gz" -SOURCE_DIR_14="cmake_helpers-$srcGitRev_14" -#QR-Code-generator -srcGitRev_15="67c62461d380352500fc39557fd9f046b7fe1d18" -SOURCE_URI_15="https://github.com/nayuki/QR-Code-generator/archive/$srcGitRev_15.tar.gz" -CHECKSUM_SHA256_15="1f1218c0a0abfc420cbc651675434d971b5e672b54428860339c51ecdf1958fc" -SOURCE_FILENAME_15="QR-Code-generator-$srcGitRev_15.tar.gz" -SOURCE_DIR_15="QR-Code-generator-$srcGitRev_15" -#lib_qr -srcGitRev_16="2b08c71c6edcfc3e31f7d7f518cc963493b6e189" -SOURCE_URI_16="https://github.com/desktop-app/lib_qr/archive/$srcGitRev_16.tar.gz" -CHECKSUM_SHA256_16="f1aee181ebbcec2e8b8f4d8321d966f8a51ee0f015153602987e88113d6816e9" -SOURCE_FILENAME_16="lib_qr-$srcGitRev_16.tar.gz" -SOURCE_DIR_16="lib_qr-$srcGitRev_16" -#lib_webrtc -srcGitRev_17="04cc1ff4a6fdade551e26441488ac0d0a208e96c" -SOURCE_URI_17="https://github.com/desktop-app/lib_webrtc/archive/$srcGitRev_17.tar.gz" -CHECKSUM_SHA256_17="e2fd20f6b059ad6654abe640a48dea183cfc880c7c33424c168c5e86fad316c4" -SOURCE_FILENAME_17="lib_webrtc-$srcGitRev_17.tar.gz" -SOURCE_DIR_17="lib_webrtc-$srcGitRev_17" -#tgcalls -srcGitRev_18="955e51f15ba1b2e35a910064388e5c0737032bb7" -SOURCE_URI_18="https://github.com/TelegramMessenger/tgcalls/archive/$srcGitRev_18.tar.gz" -CHECKSUM_SHA256_18="694f6a5ce50e0b3ae0204c6d3692a9ca71b6347f35d41a45b52e5a04f7f7aeee" -SOURCE_FILENAME_18="tgcalls-$srcGitRev_18.tar.gz" -SOURCE_DIR_18="tgcalls-$srcGitRev_18" -#lib_webview -srcGitRev_19="8be9c0ff274569cbb1bc9dd4ea9ed9089c37ca93" -SOURCE_URI_19="https://github.com/desktop-app/lib_webview/archive/$srcGitRev_19.tar.gz" -CHECKSUM_SHA256_19="1dce150a586ca8ab8716c7880723ae5a8c390eeb689ed727bcd4f64311d3e88d" -SOURCE_FILENAME_19="lib_webview-$srcGitRev_19.tar.gz" -SOURCE_DIR_19="lib_webview-$srcGitRev_19" -#expected -srcGitRev_20="1d9c5d8c0da84b8ddc54bd3d90d632eec95c1f13" -SOURCE_URI_20="https://github.com/TartanLlama/expected/archive/$srcGitRev_20.tar.gz" -CHECKSUM_SHA256_20="95b82e57a6214ca84105016670eb7f080ad54f71290d8169fcaa969cb6dfc6c8" -SOURCE_FILENAME_20="expected-$srcGitRev_20.tar.gz" -SOURCE_DIR_20="expected-$srcGitRev_20" -#GSL -srcGitRev_21="1999b48a519196711f0d03af3b7eedd49fcc6db3" -SOURCE_URI_21="https://github.com/Microsoft/GSL/archive/$srcGitRev_21.tar.gz" -CHECKSUM_SHA256_21="486d9c18da2303e212165bee7e14fbe5565084b30b1ad7810e26a8a64059492f" -SOURCE_FILENAME_21="GSL-$srcGitRev_21.tar.gz" -SOURCE_DIR_21="GSL-$srcGitRev_21" -#APIKEY -srcGitRev_22="2b383fe05f8ae78ac99470b9a2b9ea22b3ee5a92" -SOURCE_URI_22="https://salsa.debian.org/debian/telegram-desktop/-/raw/$srcGitRev_22/debian/rules#noarchive" -CHECKSUM_SHA256_22="613e7e357518739e1f7d035337f37c344b248283fd4d916ddc95df73c2ff84ad" - -PATCHES="kotatogram_desktop-$portVersion.patchset" -PATCHES_2="libtgvoip-$portVersion.patchset" -PATCHES_6="lib_base-$portVersion.patchset" -PATCHES_8="lib_ui-$portVersion.patchset" -PATCHES_14="cmake_helpers-$portVersion.patchset" -PATCHES_17="lib_webrtc-$portVersion.patchset" -PATCHES_18="tgcalls-$portVersion.patchset" - -ADDITIONAL_FILES="kotatogram_desktop.rdef.in" - -ARCHITECTURES="all !x86_gcc2" -SECONDARY_ARCHITECTURES="x86" - -PROVIDES=" - kotatogram_desktop$secondaryArchSuffix = $portVersion - app:Kotatogram - " -REQUIRES=" - haiku$secondaryArchSuffix - lib:libabsl_strings$secondaryArchSuffix - lib:libabsl_throw_delegate$secondaryArchSuffix - lib:libatomic$secondaryArchSuffix - lib:libavcodec$secondaryArchSuffix - lib:libavformat$secondaryArchSuffix - lib:libavutil$secondaryArchSuffix - lib:libcrypto$secondaryArchSuffix - lib:libgiomm_2.4$secondaryArchSuffix - lib:libglib_2.0$secondaryArchSuffix - lib:libglibmm_2.4$secondaryArchSuffix - lib:libgthread_2.0$secondaryArchSuffix - lib:libhunspell_1.7$secondaryArchSuffix - lib:libintl$secondaryArchSuffix - lib:libjpeg$secondaryArchSuffix - lib:liblz4$secondaryArchSuffix - lib:liblzma$secondaryArchSuffix - lib:libminizip$secondaryArchSuffix - lib:libopenal$secondaryArchSuffix - lib:libopus$secondaryArchSuffix - lib:libQt6Core$secondaryArchSuffix - lib:libQt6Core5Compat$secondaryArchSuffix - lib:libQt6Gui$secondaryArchSuffix - lib:libQt6Network$secondaryArchSuffix - lib:libQt6Svg$secondaryArchSuffix - lib:libQt6Widgets$secondaryArchSuffix - lib:librnnoise$secondaryArchSuffix - lib:libsigc_2.0$secondaryArchSuffix - lib:libstdc++$secondaryArchSuffix - lib:libswresample$secondaryArchSuffix - lib:libswscale$secondaryArchSuffix - lib:libvpx$secondaryArchSuffix - lib:libxxhash$secondaryArchSuffix - lib:libz$secondaryArchSuffix - " - -BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel - qt6_tools${secondaryArchSuffix}_devel - devel:libabsl_strings$secondaryArchSuffix - devel:libabsl_throw_delegate$secondaryArchSuffix - devel:libavcodec$secondaryArchSuffix - devel:libavformat$secondaryArchSuffix - devel:libavutil$secondaryArchSuffix - devel:libcrypto$secondaryArchSuffix - devel:libglib_2.0$secondaryArchSuffix - devel:libglibmm_2.4$secondaryArchSuffix - devel:libgthread_2.0$secondaryArchSuffix - devel:libhunspell_1.7$secondaryArchSuffix - devel:libjpeg$secondaryArchSuffix - devel:liblz4$secondaryArchSuffix - devel:liblzma$secondaryArchSuffix - devel:libminizip$secondaryArchSuffix - devel:libopenal$secondaryArchSuffix - devel:libopus$secondaryArchSuffix - devel:libqrcodegen$secondaryArchSuffix - devel:libQt6Core$secondaryArchSuffix - devel:libQt6Core5Compat$secondaryArchSuffix - devel:libQt6Gui$secondaryArchSuffix - devel:libQt6Network$secondaryArchSuffix - devel:libQt6Svg$secondaryArchSuffix - devel:libQt6Widgets$secondaryArchSuffix - devel:librapidjson$secondaryArchSuffix - devel:librnnoise$secondaryArchSuffix - devel:libswresample$secondaryArchSuffix - devel:libswscale$secondaryArchSuffix - devel:libtg_owt$secondaryArchSuffix - devel:libvpx$secondaryArchSuffix - devel:libxxhash$secondaryArchSuffix - devel:libz$secondaryArchSuffix - devel:range_v3$secondaryArchSuffix - " -BUILD_PREREQUIRES=" - cmd:cmake - cmd:gawk - cmd:gcc$secondaryArchSuffix - cmd:make - cmd:pkg_config$secondaryArchSuffix - cmd:python - cmd:sed - cmd:yasm - " - -BUILD() -{ - export DISABLE_ASLR=1 - - # get API_ID and API_HASH from Debian - local TELEGRAM_API_ID=`sed -n "/TDESKTOP_API_ID/p" $sourceDir22/rules | cut -d'=' -f2 | cut -d' ' -f1` - local TELEGRAM_API_HASH=`sed -n "/TDESKTOP_API_HASH/p" $sourceDir22/rules | cut -d'=' -f2 | cut -d' ' -f1` - - if [ -z $TELEGRAM_API_ID ] || [ -z $TELEGRAM_API_HASH ]; then - TELEGRAM_API_ID="17349" - TELEGRAM_API_HASH="344583e45741c457fe1862106095a5eb" - echo -e "\e[91m***************************************************************************\e[39m" - echo -e "\e[91m Use demo API_ID = $TELEGRAM_API_ID and API_HASH = $TELEGRAM_API_HASH \e[39m" - echo -e "\e[91m***************************************************************************\e[39m" - else - echo -e "\e[32m***************************************************************************\e[39m" - echo -e "\e[32m Use custom API_ID = $TELEGRAM_API_ID and API_HASH = $TELEGRAM_API_HASH \e[39m" - echo -e "\e[32m***************************************************************************\e[39m" - fi - - # link submodules - rm -rf $sourceDir/cmake - rm -rf $sourceDir/Telegram/ThirdParty/{libtgvoip,rlottie,QR,tgcalls,expected,GSL} - rm -rf $sourceDir/Telegram/{lib_crl,lib_rpl,lib_base,codegen,lib_ui,lib_lottie,lib_rlottie} - rm -rf $sourceDir/Telegram/{lib_tl,lib_spellcheck,lib_storage,lib_qr,lib_webrtc,lib_webview} - - ln -sf $sourceDir2 $sourceDir/Telegram/ThirdParty/libtgvoip - ln -sf $sourceDir3 $sourceDir/Telegram/ThirdParty/rlottie - ln -sf $sourceDir4 $sourceDir/Telegram/lib_crl - ln -sf $sourceDir5 $sourceDir/Telegram/lib_rpl - ln -sf $sourceDir6 $sourceDir/Telegram/lib_base - ln -sf $sourceDir7 $sourceDir/Telegram/codegen - ln -sf $sourceDir8 $sourceDir/Telegram/lib_ui - ln -sf $sourceDir9 $sourceDir/Telegram/lib_rlottie - ln -sf $sourceDir10 $sourceDir/Telegram/lib_lottie - ln -sf $sourceDir11 $sourceDir/Telegram/lib_tl - ln -sf $sourceDir12 $sourceDir/Telegram/lib_spellcheck - ln -sf $sourceDir13 $sourceDir/Telegram/lib_storage - ln -sf $sourceDir14 $sourceDir/cmake - ln -sf $sourceDir15 $sourceDir/Telegram/ThirdParty/QR - ln -sf $sourceDir16 $sourceDir/Telegram/lib_qr - ln -sf $sourceDir17 $sourceDir/Telegram/lib_webrtc - ln -sf $sourceDir18 $sourceDir/Telegram/ThirdParty/tgcalls - ln -sf $sourceDir19 $sourceDir/Telegram/lib_webview - ln -sf $sourceDir20 $sourceDir/Telegram/ThirdParty/expected - ln -sf $sourceDir21 $sourceDir/Telegram/ThirdParty/GSL - - # build telegram - mkdir -p build - cd build - - cmake .. \ - -DCMAKE_BUILD_TYPE=Release \ - -DDESKTOP_APP_QT6=ON \ - -DTDESKTOP_API_TEST=OFF \ - -DTDESKTOP_DISABLE_GTK_INTEGRATION=ON \ - -DDESKTOP_APP_DISABLE_CRASH_REPORTS=ON \ - -DDESKTOP_APP_DISABLE_DBUS_INTEGRATION=ON \ - -DDESKTOP_APP_DISABLE_GTK_INTEGRATION=ON \ - -DDESKTOP_APP_DISABLE_WAYLAND_INTEGRATION=ON \ - -DDESKTOP_APP_DISABLE_X11_INTEGRATION=ON \ - -DDESKTOP_APP_DISABLE_AUTOUPDATE=ON \ - -DDESKTOP_APP_DISABLE_WEBKITGTK=ON \ - -DDESKTOP_APP_USE_PACKAGED_FONTS=OFF \ - -DDESKTOP_APP_USE_HUNSPELL_ONLY=ON \ - -DTDESKTOP_USE_PACKAGED_TGVOIP=OFF \ - -DLIBTGVOIP_DISABLE_ALSA=ON \ - -DLIBTGVOIP_DISABLE_PULSEAUDIO=ON \ - -DTDESKTOP_API_ID=$TELEGRAM_API_ID \ - -DTDESKTOP_API_HASH=$TELEGRAM_API_HASH - - make -j1 -} - -INSTALL() -{ - mkdir -p $appsDir - cp build/bin/Kotatogram $appsDir - strip $appsDir/Kotatogram - - local APP_SIGNATURE="application/x-vnd.kotatogram" - local MAJOR="`echo "$portVersion" | cut -d. -f1`" - local MIDDLE="`echo "$portVersion" | cut -d. -f2`" - local MINOR="`echo "$portVersion" | cut -d. -f3`" - local LONG_INFO="$SUMMARY" - sed \ - -e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \ - -e "s|@MAJOR@|$MAJOR|" \ - -e "s|@MIDDLE@|$MIDDLE|" \ - -e "s|@MINOR@|$MINOR|" \ - -e "s|@LONG_INFO@|$LONG_INFO|" \ - $portDir/additional-files/kotatogram_desktop.rdef.in > build/kotatogram_desktop.rdef - - addResourcesToBinaries build/kotatogram_desktop.rdef $appsDir/Kotatogram - addAppDeskbarSymlink $appsDir/Kotatogram -} diff --git a/net-im/kotatogram-desktop/kotatogram_desktop-1.4.9.recipe b/net-im/kotatogram-desktop/kotatogram_desktop-1.4.9.recipe new file mode 100644 index 000000000..a4dc82045 --- /dev/null +++ b/net-im/kotatogram-desktop/kotatogram_desktop-1.4.9.recipe @@ -0,0 +1,177 @@ +SUMMARY="Experimental Telegram Desktop fork" +DESCRIPTION="Kotatogram Desktop, being based on Telegram Desktop, has all \ +its features, but it also has some more useful and cosmetic features." +HOMEPAGE="https://kotatogram.github.io/" +COPYRIGHT="2013-2022 Telegram + 2022 Kotatogram Team" +LICENSE="GNU GPL v3" +REVISION="1" +SOURCE_URI="https://github.com/kotatogram/kotatogram-desktop/releases/download/k${portVersion}/kotatogram-desktop-${portVersion}-full.tar.gz" +CHECKSUM_SHA256="27d99f642939a9501bafe633c00b39983284f3fc7d84f0944f95adcbe9182d03" +SOURCE_DIR="kotatogram-desktop-$portVersion-full" +srcGitRev_2="2b383fe05f8ae78ac99470b9a2b9ea22b3ee5a92" +SOURCE_URI_2="https://salsa.debian.org/debian/telegram-desktop/-/raw/$srcGitRev_2/debian/rules#noarchive" +CHECKSUM_SHA256_2="613e7e357518739e1f7d035337f37c344b248283fd4d916ddc95df73c2ff84ad" + +PATCHES=" + libtgvoip-$portVersion.patchset + kotatogram_desktop-$portVersion.patchset + " +ADDITIONAL_FILES="kotatogram_desktop.rdef.in" + +ARCHITECTURES="all !x86_gcc2" +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + kotatogram_desktop$secondaryArchSuffix = $portVersion + app:Kotatogram + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libabsl_strings$secondaryArchSuffix + lib:libabsl_throw_delegate$secondaryArchSuffix + lib:libatomic$secondaryArchSuffix + lib:libavcodec$secondaryArchSuffix + lib:libavformat$secondaryArchSuffix + lib:libavutil$secondaryArchSuffix + lib:libcrypto$secondaryArchSuffix + lib:libgiomm_2.4$secondaryArchSuffix + lib:libglib_2.0$secondaryArchSuffix + lib:libglibmm_2.4$secondaryArchSuffix + lib:libgthread_2.0$secondaryArchSuffix + lib:libhunspell_1.7$secondaryArchSuffix + lib:libintl$secondaryArchSuffix + lib:libjpeg$secondaryArchSuffix + lib:liblz4$secondaryArchSuffix + lib:liblzma$secondaryArchSuffix + lib:libminizip$secondaryArchSuffix + lib:libopenal$secondaryArchSuffix + lib:libopus$secondaryArchSuffix + lib:libQt6Core$secondaryArchSuffix + lib:libQt6Core5Compat$secondaryArchSuffix + lib:libQt6Gui$secondaryArchSuffix + lib:libQt6Network$secondaryArchSuffix + lib:libQt6Svg$secondaryArchSuffix + lib:libQt6Widgets$secondaryArchSuffix + lib:librnnoise$secondaryArchSuffix + lib:libsigc_2.0$secondaryArchSuffix + lib:libstdc++$secondaryArchSuffix + lib:libswresample$secondaryArchSuffix + lib:libswscale$secondaryArchSuffix + lib:libvpx$secondaryArchSuffix + lib:libxxhash$secondaryArchSuffix + lib:libz$secondaryArchSuffix + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + qt6_tools${secondaryArchSuffix}_devel + devel:libabsl_strings$secondaryArchSuffix + devel:libabsl_throw_delegate$secondaryArchSuffix + devel:libavcodec$secondaryArchSuffix >= 58 + devel:libcrypto$secondaryArchSuffix + devel:libglib_2.0$secondaryArchSuffix + devel:libglibmm_2.4$secondaryArchSuffix + devel:libgthread_2.0$secondaryArchSuffix + devel:libhunspell_1.7$secondaryArchSuffix + devel:libjpeg$secondaryArchSuffix + devel:liblz4$secondaryArchSuffix + devel:liblzma$secondaryArchSuffix + devel:libminizip$secondaryArchSuffix + devel:libopenal$secondaryArchSuffix + devel:libopus$secondaryArchSuffix + devel:libqrcodegen$secondaryArchSuffix + devel:libQt6Core$secondaryArchSuffix + devel:libQt6Core5Compat$secondaryArchSuffix + devel:libQt6Gui$secondaryArchSuffix + devel:libQt6Network$secondaryArchSuffix + devel:libQt6Svg$secondaryArchSuffix + devel:libQt6Widgets$secondaryArchSuffix + devel:librapidjson$secondaryArchSuffix + devel:librnnoise$secondaryArchSuffix + devel:libtg_owt$secondaryArchSuffix + devel:libvpx$secondaryArchSuffix + devel:libxxhash$secondaryArchSuffix + devel:libz$secondaryArchSuffix + devel:range_v3$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:cmake + cmd:gawk + cmd:gcc$secondaryArchSuffix + cmd:make + cmd:pkg_config$secondaryArchSuffix + cmd:python + cmd:sed + cmd:yasm + " + +BUILD() +{ + export DISABLE_ASLR=1 + + # get API_ID and API_HASH from Debian + local TELEGRAM_API_ID=`sed -n "/TDESKTOP_API_ID/p" $sourceDir2/rules | cut -d'=' -f2 | cut -d' ' -f1` + local TELEGRAM_API_HASH=`sed -n "/TDESKTOP_API_HASH/p" $sourceDir2/rules | cut -d'=' -f2 | cut -d' ' -f1` + + if [ -z $TELEGRAM_API_ID ] || [ -z $TELEGRAM_API_HASH ]; then + TELEGRAM_API_ID="17349" + TELEGRAM_API_HASH="344583e45741c457fe1862106095a5eb" + echo -e "\e[91m***************************************************************************\e[39m" + echo -e "\e[91m Use demo API_ID = $TELEGRAM_API_ID and API_HASH = $TELEGRAM_API_HASH \e[39m" + echo -e "\e[91m***************************************************************************\e[39m" + else + echo -e "\e[32m***************************************************************************\e[39m" + echo -e "\e[32m Use custom API_ID = $TELEGRAM_API_ID and API_HASH = $TELEGRAM_API_HASH \e[39m" + echo -e "\e[32m***************************************************************************\e[39m" + fi + + # build telegram + mkdir -p build + cd build + + cmake .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DDESKTOP_APP_QT6=ON \ + -DTDESKTOP_API_TEST=OFF \ + -DTDESKTOP_DISABLE_GTK_INTEGRATION=ON \ + -DDESKTOP_APP_DISABLE_CRASH_REPORTS=ON \ + -DDESKTOP_APP_DISABLE_DBUS_INTEGRATION=ON \ + -DDESKTOP_APP_DISABLE_GTK_INTEGRATION=ON \ + -DDESKTOP_APP_DISABLE_WAYLAND_INTEGRATION=ON \ + -DDESKTOP_APP_DISABLE_X11_INTEGRATION=ON \ + -DDESKTOP_APP_DISABLE_AUTOUPDATE=ON \ + -DDESKTOP_APP_DISABLE_WEBKITGTK=ON \ + -DDESKTOP_APP_USE_PACKAGED_FONTS=OFF \ + -DDESKTOP_APP_USE_HUNSPELL_ONLY=ON \ + -DTDESKTOP_USE_PACKAGED_TGVOIP=OFF \ + -DLIBTGVOIP_DISABLE_ALSA=ON \ + -DLIBTGVOIP_DISABLE_PULSEAUDIO=ON \ + -DTDESKTOP_API_ID=$TELEGRAM_API_ID \ + -DTDESKTOP_API_HASH=$TELEGRAM_API_HASH + + make $jobArgs +} + +INSTALL() +{ + mkdir -p $appsDir + cp build/bin/Kotatogram $appsDir + strip $appsDir/Kotatogram + + local APP_SIGNATURE="application/x-vnd.kotatogram" + local MAJOR="`echo "$portVersion" | cut -d. -f1`" + local MIDDLE="`echo "$portVersion" | cut -d. -f2`" + local MINOR="`echo "$portVersion" | cut -d. -f3`" + local LONG_INFO="$SUMMARY" + sed \ + -e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \ + -e "s|@MAJOR@|$MAJOR|" \ + -e "s|@MIDDLE@|$MIDDLE|" \ + -e "s|@MINOR@|$MINOR|" \ + -e "s|@LONG_INFO@|$LONG_INFO|" \ + $portDir/additional-files/kotatogram_desktop.rdef.in > build/kotatogram_desktop.rdef + + addResourcesToBinaries build/kotatogram_desktop.rdef $appsDir/Kotatogram + addAppDeskbarSymlink $appsDir/Kotatogram +} diff --git a/net-im/kotatogram-desktop/patches/cmake_helpers-1.4.8.patchset b/net-im/kotatogram-desktop/patches/cmake_helpers-1.4.8.patchset deleted file mode 100644 index 20df14ba4..000000000 --- a/net-im/kotatogram-desktop/patches/cmake_helpers-1.4.8.patchset +++ /dev/null @@ -1,39 +0,0 @@ -From 3d7f45b060924521b13a80acd670fc32fbeabc28 Mon Sep 17 00:00:00 2001 -From: Gerasim Troeglazov <3dEyes@gmail.com> -Date: Wed, 10 Nov 2021 18:21:03 +1000 -Subject: Fixes for Haiku - - -diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt -index 58ba80a..fe98397 100644 ---- a/external/CMakeLists.txt -+++ b/external/CMakeLists.txt -@@ -37,7 +37,7 @@ if (add_hunspell_library) - add_checked_subdirectory(hunspell) - endif() - add_checked_subdirectory(iconv) --if (LINUX) -+if (LINUX AND NOT HAIKU) - add_checked_subdirectory(jemalloc) - endif() - add_checked_subdirectory(jpeg) -diff --git a/options_linux.cmake b/options_linux.cmake -index 2797c7b..26368f2 100644 ---- a/options_linux.cmake -+++ b/options_linux.cmake -@@ -45,10 +45,12 @@ if (DESKTOP_APP_SPECIAL_TARGET) - target_link_options(common_options INTERFACE $,,-g -flto -fuse-linker-plugin>) - endif() - -+if (NOT HAIKU) - target_link_libraries(common_options - INTERFACE - desktop-app::external_jemalloc - ) -+endif() - - if (DESKTOP_APP_USE_ALLOCATION_TRACER) - target_link_options(common_options --- -2.30.2 - diff --git a/net-im/kotatogram-desktop/patches/kotatogram_desktop-1.4.8.patchset b/net-im/kotatogram-desktop/patches/kotatogram_desktop-1.4.9.patchset similarity index 55% rename from net-im/kotatogram-desktop/patches/kotatogram_desktop-1.4.8.patchset rename to net-im/kotatogram-desktop/patches/kotatogram_desktop-1.4.9.patchset index c1b5a82ad..da8f4ca53 100644 --- a/net-im/kotatogram-desktop/patches/kotatogram_desktop-1.4.8.patchset +++ b/net-im/kotatogram-desktop/patches/kotatogram_desktop-1.4.9.patchset @@ -1,11 +1,11 @@ -From d2b97d1868c9a97d454ed559a82481d9f29825a5 Mon Sep 17 00:00:00 2001 +From e9df8a423c024845d8510404b9da6b29ac77b9a9 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> -Date: Sat, 1 Jan 2022 23:26:50 +1000 +Date: Mon, 21 Mar 2022 12:42:33 +1000 Subject: Add Haiku support diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt -index bc35728..a0b0531 100644 +index 3eb4de3..7495342 100644 --- a/Telegram/CMakeLists.txt +++ b/Telegram/CMakeLists.txt @@ -95,6 +95,15 @@ PRIVATE @@ -24,7 +24,7 @@ index bc35728..a0b0531 100644 target_precompile_headers(Telegram PRIVATE ${src_loc}/stdafx.h) nice_target_sources(Telegram ${src_loc} PRIVATE -@@ -1240,6 +1249,16 @@ else() +@@ -1252,6 +1261,16 @@ else() ) endif() @@ -41,7 +41,7 @@ index bc35728..a0b0531 100644 if (DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION) remove_target_sources(Telegram ${src_loc} platform/linux/linux_wayland_integration.cpp -@@ -1379,7 +1398,7 @@ else() +@@ -1389,7 +1408,7 @@ else() endif() set(bundle_identifier "io.github.kotatogram") @@ -51,7 +51,7 @@ index bc35728..a0b0531 100644 else() set(output_name "Kotatogram") diff --git a/Telegram/SourceFiles/calls/group/calls_group_menu.cpp b/Telegram/SourceFiles/calls/group/calls_group_menu.cpp -index 0fdaf4c..ea0f606 100644 +index 2f0c52d..63c550a 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_menu.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_menu.cpp @@ -583,6 +583,7 @@ void FillMenu( @@ -71,10 +71,10 @@ index 0fdaf4c..ea0f606 100644 if (const auto strong = weak.get()) { showBox(Box(SettingsBox, strong)); diff --git a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp -index f0248ed..d325571 100644 +index 1fd532c..504c62a 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp -@@ -1936,7 +1936,9 @@ void Panel::updateButtonsGeometry() { +@@ -1942,7 +1942,9 @@ void Panel::updateButtonsGeometry() { const auto muteSize = _mute->innerSize().width() + 2 * addSkip; const auto skip = st::groupCallButtonSkipSmall; const auto fullWidth = (_video->width() + skip) @@ -84,7 +84,7 @@ index f0248ed..d325571 100644 + (muteSize + skip) + (_settings ->width() + skip) + _hangup->width(); -@@ -1947,9 +1949,13 @@ void Panel::updateButtonsGeometry() { +@@ -1953,9 +1955,13 @@ void Panel::updateButtonsGeometry() { - membersWidth - membersSkip - fullWidth) / 2; @@ -99,10 +99,10 @@ index f0248ed..d325571 100644 _video->moveToLeft(left, buttonsTop); left += _video->width() + skip; diff --git a/Telegram/SourceFiles/core/core_settings.h b/Telegram/SourceFiles/core/core_settings.h -index 4e0b6d6..c7121c5 100644 +index 26c6f3d..d429c6f 100644 --- a/Telegram/SourceFiles/core/core_settings.h +++ b/Telegram/SourceFiles/core/core_settings.h -@@ -784,7 +784,7 @@ private: +@@ -797,7 +797,7 @@ private: rpl::variable _dialogsWidthRatio; // per-window rpl::variable _thirdColumnWidth = kDefaultThirdColumnWidth; // p-w bool _notifyFromAll = true; @@ -156,10 +156,21 @@ index 453ccfd..c8374f9 100644 if (internal::ShowXDPOpenWithDialog(filepath)) { return true; diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp -index 500b5b6..d784700 100644 +index 759f697..813002a 100644 --- a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp -@@ -934,11 +934,17 @@ bool MainWindow::hasTrayIcon() const { +@@ -42,6 +42,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL + #include "base/platform/linux/base_linux_xcb_utilities.h" + #endif // !DESKTOP_APP_DISABLE_X11_INTEGRATION + ++#ifdef Q_OS_HAIKU ++#include ++#endif ++ + #include + #include + #include +@@ -532,11 +536,17 @@ bool MainWindow::hasTrayIcon() const { bool MainWindow::isActiveForTrayMenu() { updateIsActive(); @@ -172,14 +183,14 @@ index 500b5b6..d784700 100644 void MainWindow::psShowTrayMenu() { +#ifndef Q_OS_HAIKU - _trayIconMenuXEmbed->popup(QCursor::pos()); + _private->trayIconMenuXEmbed->popup(QCursor::pos()); +#endif } void MainWindow::psTrayMenuUpdated() { -@@ -977,6 +983,10 @@ void MainWindow::psSetupTrayIcon() { - } - trayIcon->setIcon(TrayIconGen(counter, muted)); +@@ -550,6 +560,10 @@ void MainWindow::psSetupTrayIcon() { + Core::App().unreadBadge(), + Core::App().unreadBadgeMuted())); +#ifdef Q_OS_HAIKU + trayIcon->setContextMenu(trayIconMenu); @@ -188,13 +199,13 @@ index 500b5b6..d784700 100644 attachToTrayIcon(trayIcon); } updateIconCounters(); -@@ -1067,8 +1077,10 @@ void MainWindow::updateIconCounters() { +@@ -628,8 +642,10 @@ void MainWindow::updateIconCounters() { } void MainWindow::initTrayMenuHook() { +#ifndef Q_OS_HAIKU - _trayIconMenuXEmbed.emplace(nullptr, trayIconMenu); - _trayIconMenuXEmbed->deleteOnHide(false); + _private->trayIconMenuXEmbed.emplace(nullptr, trayIconMenu); + _private->trayIconMenuXEmbed->deleteOnHide(false); +#endif } @@ -474,10 +485,10 @@ index 0000000..8605b28 +} // namespace Notifications +} // namespace Platform diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp -index 26168ba..1706cbb 100644 +index daf85b7..2ffb439 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp -@@ -34,6 +34,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +@@ -35,6 +35,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/platform/linux/base_linux_xsettings.h" #endif // !DESKTOP_APP_DISABLE_X11_INTEGRATION @@ -488,16 +499,7 @@ index 26168ba..1706cbb 100644 #include #include #include -@@ -44,7 +48,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - - #ifdef Q_OS_FREEBSD - #include --#else // Q_OS_FREEBSD -+#elif !defined (Q_OS_HAIKU) // Q_OS_FREEBSD - #include - #endif // Q_OS_FREEBSD - -@@ -78,6 +82,33 @@ constexpr auto kXDGDesktopPortalObjectPath = "/org/freedesktop/portal/desktop"_c +@@ -74,6 +78,33 @@ constexpr auto kXDGDesktopPortalObjectPath = "/org/freedesktop/portal/desktop"_c constexpr auto kIBusPortalService = "org.freedesktop.portal.IBus"_cs; constexpr auto kWebviewService = "io.github.kotatogram.GtkIntegration.WebviewHelper-%1-%2"_cs; @@ -531,7 +533,7 @@ index 26168ba..1706cbb 100644 #ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION void PortalAutostart(bool start, bool silent) { if (cExeName().isEmpty()) { -@@ -618,37 +649,6 @@ void psActivateProcess(uint64 pid) { +@@ -612,37 +643,6 @@ void psActivateProcess(uint64 pid) { // objc_activateProgram(); } @@ -569,7 +571,7 @@ index 26168ba..1706cbb 100644 QString psAppDataPath() { // We should not use ~/.TelegramDesktop, since it's a fork. /* -@@ -664,7 +664,11 @@ QString psAppDataPath() { +@@ -658,7 +658,11 @@ QString psAppDataPath() { } */ @@ -582,71 +584,349 @@ index 26168ba..1706cbb 100644 } void psDoCleanup() { -@@ -692,8 +696,9 @@ namespace Platform { - - void start() { - auto backgroundThread = true; -+#ifndef Q_OS_HAIKU - mallctl("background_thread", nullptr, nullptr, &backgroundThread, sizeof(bool)); -- -+#endif - // Prevent any later calls into setlocale() by Qt - QCoreApplicationPrivate::initLocale(); - -@@ -829,7 +834,7 @@ bool OpenSystemSettings(SystemSettingsType type) { - } else if (DesktopEnvironment::IsMATE()) { - add("mate-volume-control"); +@@ -823,7 +827,7 @@ bool OpenSystemSettings(SystemSettingsType type) { + add("mate-volume-control"); + } } -#ifdef __HAIKU__ +#ifdef Q_OS_HAIKU add("Media"); #endif // __ HAIKU__ add("pavucontrol-qt"); -diff --git a/Telegram/cmake/lib_tgvoip.cmake b/Telegram/cmake/lib_tgvoip.cmake -index 68a64ba..319e5b4 100644 ---- a/Telegram/cmake/lib_tgvoip.cmake -+++ b/Telegram/cmake/lib_tgvoip.cmake -@@ -116,6 +116,14 @@ if (NOT TGVOIP_FOUND) - os/linux/AudioPulse.cpp - os/linux/AudioPulse.h +diff --git a/Telegram/ThirdParty/tgcalls/tgcalls/MediaManager.cpp b/Telegram/ThirdParty/tgcalls/tgcalls/MediaManager.cpp +index 057a9b5..68abe1e 100644 +--- a/Telegram/ThirdParty/tgcalls/tgcalls/MediaManager.cpp ++++ b/Telegram/ThirdParty/tgcalls/tgcalls/MediaManager.cpp +@@ -967,7 +967,7 @@ void MediaManager::fillCallStats(CallStats &callStats) { + } -+ # Haiku -+ os/haiku/AudioInputHaiku.cpp -+ os/haiku/AudioInputHaiku.h -+ os/haiku/AudioOutputHaiku.cpp -+ os/haiku/AudioOutputHaiku.h -+ os/haiku/RingBuffer.cpp -+ os/haiku/RingBuffer.h + void MediaManager::setAudioInputDevice(std::string id) { +-#if defined(WEBRTC_IOS) ++#if defined(WEBRTC_IOS) || defined(__HAIKU__) + #else + SetAudioInputDeviceById(_audioDeviceModule.get(), id); + #endif +diff --git a/Telegram/ThirdParty/tgcalls/tgcalls/group/GroupInstanceCustomImpl.cpp b/Telegram/ThirdParty/tgcalls/tgcalls/group/GroupInstanceCustomImpl.cpp +index 574260c..a78bf44 100644 +--- a/Telegram/ThirdParty/tgcalls/tgcalls/group/GroupInstanceCustomImpl.cpp ++++ b/Telegram/ThirdParty/tgcalls/tgcalls/group/GroupInstanceCustomImpl.cpp +@@ -2782,7 +2782,7 @@ public: + } + + void setAudioOutputDevice(const std::string &id) { +-#ifndef WEBRTC_IOS ++#if !defined(WEBRTC_IOS) && !defined(__HAIKU__) + _threads->getWorkerThread()->Invoke(RTC_FROM_HERE, [&] { + SetAudioOutputDeviceById(_audioDeviceModule.get(), id); + }); +@@ -2790,7 +2790,7 @@ public: + } + + void setAudioInputDevice(const std::string &id) { +-#ifndef WEBRTC_IOS ++#if !defined(WEBRTC_IOS) && !defined(__HAIKU__) + _threads->getWorkerThread()->Invoke(RTC_FROM_HERE, [&] { + SetAudioInputDeviceById(_audioDeviceModule.get(), id); + }); +diff --git a/Telegram/lib_base/base/haiku_types.h b/Telegram/lib_base/base/haiku_types.h +new file mode 100644 +index 0000000..3a57ce2 +--- /dev/null ++++ b/Telegram/lib_base/base/haiku_types.h +@@ -0,0 +1,24 @@ ++#pragma once + - # POSIX - os/posix/NetworkSocketPosix.cpp - os/posix/NetworkSocketPosix.h -@@ -153,6 +161,25 @@ if (NOT TGVOIP_FOUND) - TGVOIP_NO_OSX_PRIVATE_API - ) - endif() -+ elseif (HAIKU) -+ target_compile_definitions(lib_tgvoip_bundled -+ PUBLIC -+ WEBRTC_POSIX -+ WEBRTC_HAIKU -+ ) -+ target_compile_options(lib_tgvoip_bundled -+ PRIVATE -+ -Wno-unknown-pragmas -+ -Wno-error=sequence-point -+ -Wno-error=unused-result -+ -mmmx -+ -msse2 -+ ) -+ target_link_libraries(lib_tgvoip_bundled -+ PRIVATE -+ network -+ media -+ ) - else() - add_library(lib_tgvoip_bundled_options INTERFACE) - target_compile_options(lib_tgvoip_bundled_options ++#ifdef Q_OS_HAIKU ++ ++#define _SUPPORT_DEFS_H ++ ++#ifdef __x86_64__ ++#define int64 __haiku_int64 ++#ifdef USE_HAIKU_UINT64 ++#define uint64 __haiku_uint64 ++#endif ++#else ++#define int32 __haiku_int32 ++#define uint32 __haiku_uint32 ++#endif ++ ++typedef int32 status_t; ++typedef uint32 type_code; ++typedef uint32 perform_code; ++ ++typedef int64 bigtime_t; ++typedef int64 nanotime_t; ++ ++#endif +diff --git a/Telegram/lib_base/base/platform/linux/base_file_utilities_linux.cpp b/Telegram/lib_base/base/platform/linux/base_file_utilities_linux.cpp +index aa65e5e..60b761f 100644 +--- a/Telegram/lib_base/base/platform/linux/base_file_utilities_linux.cpp ++++ b/Telegram/lib_base/base/platform/linux/base_file_utilities_linux.cpp +@@ -27,8 +27,58 @@ + #include + #include + ++#ifdef Q_OS_HAIKU ++#include ++#include ++#include ++#endif ++ + namespace base::Platform { + namespace { ++ ++#ifdef Q_OS_HAIKU ++bool HaikuShowInFolder(const QString &filepath) { ++ try { ++ BMessenger trackerMessenger("application/x-vnd.Be-TRAK"); ++ if (!trackerMessenger.IsValid()) ++ return false; ++ ++ BEntry fileEntry(filepath.toUtf8().data()); ++ entry_ref fileRef; ++ if (fileEntry.GetRef(&fileRef) != B_OK) ++ return false; ++ ++ if (!fileEntry.Exists()) ++ return false; ++ ++ BEntry folderEntry; ++ if (fileEntry.GetParent(&folderEntry) != B_OK) ++ return false; ++ ++ entry_ref folderRef; ++ if (folderEntry.GetRef(&folderRef) != B_OK) ++ return false; ++ ++ BMessage openCommand(B_REFS_RECEIVED); ++ openCommand.AddRef("refs", &folderRef); ++ node_ref fileNodeRef; ++ if (fileEntry.GetNodeRef(&fileNodeRef) == B_OK) { ++ openCommand.AddData("nodeRefToSelect", B_RAW_TYPE, ++ static_cast(&fileNodeRef), sizeof(node_ref)); ++ } ++ if (trackerMessenger.SendMessage(&openCommand) == B_OK) { ++ snooze(300000); ++ BMessage selectCommand('Tsel'); ++ selectCommand.AddRef("refs", &fileRef); ++ trackerMessenger.SendMessage(&selectCommand); ++ return true; ++ } ++ } catch (...) { ++ } ++ ++ return false; ++} ++#endif + + #ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION + bool PortalShowInFolder(const QString &filepath) { +@@ -152,6 +202,12 @@ bool ShowInFolder(const QString &filepath) { + return true; + } + ++#ifdef Q_OS_HAIKU ++ if (HaikuShowInFolder(filepath)) { ++ return true; ++ } ++#endif ++ + if (ProcessShowInFolder(filepath)) { + return true; + } +diff --git a/Telegram/lib_base/base/platform/linux/base_last_input_linux.cpp b/Telegram/lib_base/base/platform/linux/base_last_input_linux.cpp +index 033dcbd..bf7d541 100644 +--- a/Telegram/lib_base/base/platform/linux/base_last_input_linux.cpp ++++ b/Telegram/lib_base/base/platform/linux/base_last_input_linux.cpp +@@ -24,6 +24,11 @@ + #include + #endif // !DESKTOP_APP_DISABLE_X11_INTEGRATION + ++#ifdef Q_OS_HAIKU ++#include ++#include ++#endif ++ + namespace base::Platform { + namespace { + +@@ -184,9 +189,23 @@ std::optional MutterDBusLastUserInputTime() { + } + #endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION + ++#ifdef Q_OS_HAIKU ++std::optional HaikuLastUserInputTime() { ++ const auto idle = idle_time() / 1000; ++ return (crl::now() - static_cast(idle)); ++} ++#endif ++ + } // namespace + + std::optional LastUserInputTime() { ++#ifdef Q_OS_HAIKU ++ const auto haikuResult = HaikuLastUserInputTime(); ++ if (haikuResult.has_value()) { ++ return haikuResult; ++ } ++#endif ++ + #ifndef DESKTOP_APP_DISABLE_X11_INTEGRATION + if (::Platform::IsX11()) { + const auto xcbResult = XCBLastUserInputTime(); +diff --git a/Telegram/lib_base/base/platform/linux/base_power_save_blocker_linux.cpp b/Telegram/lib_base/base/platform/linux/base_power_save_blocker_linux.cpp +index cf86098..9933d26 100644 +--- a/Telegram/lib_base/base/platform/linux/base_power_save_blocker_linux.cpp ++++ b/Telegram/lib_base/base/platform/linux/base_power_save_blocker_linux.cpp +@@ -21,6 +21,10 @@ + #include + #endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION + ++#ifdef Q_OS_HAIKU ++#include ++#endif ++ + #include + #include + +diff --git a/Telegram/lib_base/base/platform/linux/base_url_scheme_linux.cpp b/Telegram/lib_base/base/platform/linux/base_url_scheme_linux.cpp +index 20aed5e..61d46fc 100644 +--- a/Telegram/lib_base/base/platform/linux/base_url_scheme_linux.cpp ++++ b/Telegram/lib_base/base/platform/linux/base_url_scheme_linux.cpp +@@ -13,6 +13,10 @@ + #include "base/platform/linux/base_linux_glibmm_helper.h" + #endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION + ++#ifdef Q_OS_HAIKU ++#include ++#endif ++ + #include + #include + #include +diff --git a/Telegram/lib_ui/ui/platform/linux/ui_utility_linux.cpp b/Telegram/lib_ui/ui/platform/linux/ui_utility_linux.cpp +index f55ed32..6ec825d 100644 +--- a/Telegram/lib_ui/ui/platform/linux/ui_utility_linux.cpp ++++ b/Telegram/lib_ui/ui/platform/linux/ui_utility_linux.cpp +@@ -618,7 +618,7 @@ TitleControls::Layout TitleControlsLayout() { + } + #endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION + +-#ifdef __HAIKU__ ++#ifdef Q_OS_HAIKU + return TitleControls::Layout{ + .left = { + TitleControls::Control::Close, +@@ -628,7 +628,7 @@ TitleControls::Layout TitleControlsLayout() { + TitleControls::Control::Maximize, + } + }; +-#else // __HAIKU__ ++#else // Q_OS_HAIKU + return TitleControls::Layout{ + .right = { + TitleControls::Control::Minimize, +@@ -636,7 +636,7 @@ TitleControls::Layout TitleControlsLayout() { + TitleControls::Control::Close, + } + }; +-#endif // !__HAIKU__ ++#endif // !Q_OS_HAIKU + } + + } // namespace Platform +diff --git a/Telegram/lib_ui/ui/ui_utility.cpp b/Telegram/lib_ui/ui/ui_utility.cpp +index e66055d..e31d635 100644 +--- a/Telegram/lib_ui/ui/ui_utility.cpp ++++ b/Telegram/lib_ui/ui/ui_utility.cpp +@@ -9,6 +9,10 @@ + #include "ui/platform/ui_platform_utility.h" + #include "ui/style/style_core.h" + ++#ifdef Q_OS_HAIKU ++#include ++#endif ++ + #include + #include + #include +diff --git a/Telegram/lib_webrtc/webrtc/details/webrtc_openal_adm.cpp b/Telegram/lib_webrtc/webrtc/details/webrtc_openal_adm.cpp +index 9955bd3..ca023c1 100644 +--- a/Telegram/lib_webrtc/webrtc/details/webrtc_openal_adm.cpp ++++ b/Telegram/lib_webrtc/webrtc/details/webrtc_openal_adm.cpp +@@ -4,6 +4,11 @@ + // For license and copyright information please follow this link: + // https://github.com/desktop-app/legal/blob/master/LEGAL + // ++ ++#ifdef Q_OS_HAIKU ++#include ++#endif ++ + #include "webrtc/details/webrtc_openal_adm.h" + + #include "base/timer.h" +diff --git a/Telegram/lib_webrtc/webrtc/webrtc_audio_input_tester.cpp b/Telegram/lib_webrtc/webrtc/webrtc_audio_input_tester.cpp +index 092b667..204e259 100644 +--- a/Telegram/lib_webrtc/webrtc/webrtc_audio_input_tester.cpp ++++ b/Telegram/lib_webrtc/webrtc/webrtc_audio_input_tester.cpp +@@ -4,6 +4,11 @@ + // For license and copyright information please follow this link: + // https://github.com/desktop-app/legal/blob/master/LEGAL + // ++ ++#ifdef Q_OS_HAIKU ++#include ++#endif ++ + #include "webrtc/webrtc_audio_input_tester.h" + + #include "webrtc/webrtc_create_adm.h" +diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt +index 465f5f7..f2f13fc 100644 +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt +@@ -5,7 +5,7 @@ + # https://github.com/desktop-app/legal/blob/master/LEGAL + + add_subdirectory(external) +-if (LINUX) ++if (LINUX AND NOT HAIKU) + add_subdirectory(linux_jemalloc_helper) + endif() + if (LINUX AND NOT DESKTOP_APP_USE_PACKAGED) +diff --git a/cmake/external/CMakeLists.txt b/cmake/external/CMakeLists.txt +index 0922a66..3d08188 100644 +--- a/cmake/external/CMakeLists.txt ++++ b/cmake/external/CMakeLists.txt +@@ -37,7 +37,7 @@ if (add_hunspell_library) + add_checked_subdirectory(hunspell) + endif() + add_checked_subdirectory(iconv) +-if (LINUX) ++if (LINUX AND NOT HAIKU) + add_checked_subdirectory(jemalloc) + endif() + add_checked_subdirectory(jpeg) +diff --git a/cmake/options_linux.cmake b/cmake/options_linux.cmake +index 9312468..53e8236 100644 +--- a/cmake/options_linux.cmake ++++ b/cmake/options_linux.cmake +@@ -62,12 +62,14 @@ if (DESKTOP_APP_SPECIAL_TARGET) + target_link_options(common_options INTERFACE $,,-g -flto -fuse-linker-plugin>) + endif() + ++if (NOT HAIKU) + target_link_libraries(common_options + INTERFACE + $ + $ + ${CMAKE_DL_LIBS} + ) ++endif() + + if (DESKTOP_APP_USE_ALLOCATION_TRACER) + target_link_options(common_options -- 2.30.2 diff --git a/net-im/kotatogram-desktop/patches/lib_base-1.4.8.patchset b/net-im/kotatogram-desktop/patches/lib_base-1.4.8.patchset deleted file mode 100644 index 8e49b0e2e..000000000 --- a/net-im/kotatogram-desktop/patches/lib_base-1.4.8.patchset +++ /dev/null @@ -1,170 +0,0 @@ -From 00c1e5974b4d6d6cbafe5ae42ab70766370b8580 Mon Sep 17 00:00:00 2001 -From: Gerasim Troeglazov <3dEyes@gmail.com> -Date: Wed, 10 Nov 2021 18:14:13 +1000 -Subject: Fixes for Haiku - - -diff --git a/base/haiku_types.h b/base/haiku_types.h -new file mode 100644 -index 0000000..3a57ce2 ---- /dev/null -+++ b/base/haiku_types.h -@@ -0,0 +1,24 @@ -+#pragma once -+ -+#ifdef Q_OS_HAIKU -+ -+#define _SUPPORT_DEFS_H -+ -+#ifdef __x86_64__ -+#define int64 __haiku_int64 -+#ifdef USE_HAIKU_UINT64 -+#define uint64 __haiku_uint64 -+#endif -+#else -+#define int32 __haiku_int32 -+#define uint32 __haiku_uint32 -+#endif -+ -+typedef int32 status_t; -+typedef uint32 type_code; -+typedef uint32 perform_code; -+ -+typedef int64 bigtime_t; -+typedef int64 nanotime_t; -+ -+#endif -diff --git a/base/platform/linux/base_file_utilities_linux.cpp b/base/platform/linux/base_file_utilities_linux.cpp -index b3ba5f3..a481e3b 100644 ---- a/base/platform/linux/base_file_utilities_linux.cpp -+++ b/base/platform/linux/base_file_utilities_linux.cpp -@@ -27,8 +27,58 @@ - #include - #include - -+#ifdef Q_OS_HAIKU -+#include -+#include -+#include -+#endif -+ - namespace base::Platform { - namespace { -+ -+#ifdef Q_OS_HAIKU -+bool HaikuShowInFolder(const QString &filepath) { -+ try { -+ BMessenger trackerMessenger("application/x-vnd.Be-TRAK"); -+ if (!trackerMessenger.IsValid()) -+ return false; -+ -+ BEntry fileEntry(filepath.toUtf8().data()); -+ entry_ref fileRef; -+ if (fileEntry.GetRef(&fileRef) != B_OK) -+ return false; -+ -+ if (!fileEntry.Exists()) -+ return false; -+ -+ BEntry folderEntry; -+ if (fileEntry.GetParent(&folderEntry) != B_OK) -+ return false; -+ -+ entry_ref folderRef; -+ if (folderEntry.GetRef(&folderRef) != B_OK) -+ return false; -+ -+ BMessage openCommand(B_REFS_RECEIVED); -+ openCommand.AddRef("refs", &folderRef); -+ node_ref fileNodeRef; -+ if (fileEntry.GetNodeRef(&fileNodeRef) == B_OK) { -+ openCommand.AddData("nodeRefToSelect", B_RAW_TYPE, -+ static_cast(&fileNodeRef), sizeof(node_ref)); -+ } -+ if (trackerMessenger.SendMessage(&openCommand) == B_OK) { -+ snooze(300000); -+ BMessage selectCommand('Tsel'); -+ selectCommand.AddRef("refs", &fileRef); -+ trackerMessenger.SendMessage(&selectCommand); -+ return true; -+ } -+ } catch (...) { -+ } -+ -+ return false; -+} -+#endif - - #ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION - bool PortalShowInFolder(const QString &filepath) { -@@ -152,6 +202,12 @@ bool ShowInFolder(const QString &filepath) { - return true; - } - -+#ifdef Q_OS_HAIKU -+ if (HaikuShowInFolder(filepath)) { -+ return true; -+ } -+#endif -+ - if (ProcessShowInFolder(filepath)) { - return true; - } -diff --git a/base/platform/linux/base_last_input_linux.cpp b/base/platform/linux/base_last_input_linux.cpp -index 1021c85..fd6e541 100644 ---- a/base/platform/linux/base_last_input_linux.cpp -+++ b/base/platform/linux/base_last_input_linux.cpp -@@ -24,6 +24,11 @@ - #include - #endif // !DESKTOP_APP_DISABLE_X11_INTEGRATION - -+#ifdef Q_OS_HAIKU -+#include -+#include -+#endif -+ - namespace base::Platform { - namespace { - -@@ -184,9 +189,23 @@ std::optional MutterDBusLastUserInputTime() { - } - #endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION - -+#ifdef Q_OS_HAIKU -+std::optional HaikuLastUserInputTime() { -+ const auto idle = idle_time() / 1000; -+ return (crl::now() - static_cast(idle)); -+} -+#endif -+ - } // namespace - - std::optional LastUserInputTime() { -+#ifdef Q_OS_HAIKU -+ const auto haikuResult = HaikuLastUserInputTime(); -+ if (haikuResult.has_value()) { -+ return haikuResult; -+ } -+#endif -+ - #ifndef DESKTOP_APP_DISABLE_X11_INTEGRATION - if (::Platform::IsX11()) { - const auto xcbResult = XCBLastUserInputTime(); -diff --git a/base/platform/linux/base_url_scheme_linux.cpp b/base/platform/linux/base_url_scheme_linux.cpp -index 20aed5e..61d46fc 100644 ---- a/base/platform/linux/base_url_scheme_linux.cpp -+++ b/base/platform/linux/base_url_scheme_linux.cpp -@@ -13,6 +13,10 @@ - #include "base/platform/linux/base_linux_glibmm_helper.h" - #endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION - -+#ifdef Q_OS_HAIKU -+#include -+#endif -+ - #include - #include - #include --- -2.30.2 - diff --git a/net-im/kotatogram-desktop/patches/lib_ui-1.4.8.patchset b/net-im/kotatogram-desktop/patches/lib_ui-1.4.8.patchset deleted file mode 100644 index e7a52001a..000000000 --- a/net-im/kotatogram-desktop/patches/lib_ui-1.4.8.patchset +++ /dev/null @@ -1,55 +0,0 @@ -From 44831be8f21e06291cb1d8cbfd911eb621bde849 Mon Sep 17 00:00:00 2001 -From: Gerasim Troeglazov <3dEyes@gmail.com> -Date: Wed, 10 Nov 2021 18:18:12 +1000 -Subject: Fixes for Haiku - - -diff --git a/ui/platform/linux/ui_utility_linux.cpp b/ui/platform/linux/ui_utility_linux.cpp -index 2a7fb2d..8eaae4c 100644 ---- a/ui/platform/linux/ui_utility_linux.cpp -+++ b/ui/platform/linux/ui_utility_linux.cpp -@@ -609,7 +609,7 @@ TitleControls::Layout TitleControlsLayout() { - } - #endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION - --#ifdef __HAIKU__ -+#ifdef Q_OS_HAIKU - return TitleControls::Layout{ - .left = { - TitleControls::Control::Close, -@@ -619,7 +619,7 @@ TitleControls::Layout TitleControlsLayout() { - TitleControls::Control::Maximize, - } - }; --#else // __HAIKU__ -+#else // Q_OS_HAIKU - return TitleControls::Layout{ - .right = { - TitleControls::Control::Minimize, -@@ -627,7 +627,7 @@ TitleControls::Layout TitleControlsLayout() { - TitleControls::Control::Close, - } - }; --#endif // !__HAIKU__ -+#endif // !Q_OS_HAIKU - } - - } // namespace Platform -diff --git a/ui/ui_utility.cpp b/ui/ui_utility.cpp -index e66055d..e31d635 100644 ---- a/ui/ui_utility.cpp -+++ b/ui/ui_utility.cpp -@@ -9,6 +9,10 @@ - #include "ui/platform/ui_platform_utility.h" - #include "ui/style/style_core.h" - -+#ifdef Q_OS_HAIKU -+#include -+#endif -+ - #include - #include - #include --- -2.30.2 - diff --git a/net-im/kotatogram-desktop/patches/lib_webrtc-1.4.8.patchset b/net-im/kotatogram-desktop/patches/lib_webrtc-1.4.8.patchset deleted file mode 100644 index 2b5538e4a..000000000 --- a/net-im/kotatogram-desktop/patches/lib_webrtc-1.4.8.patchset +++ /dev/null @@ -1,41 +0,0 @@ -From d65252fda59ee58fc8e913be59358b42b34e3a32 Mon Sep 17 00:00:00 2001 -From: Gerasim Troeglazov <3dEyes@gmail.com> -Date: Wed, 10 Nov 2021 18:19:20 +1000 -Subject: Fixes for Haiku - - -diff --git a/webrtc/details/webrtc_openal_adm.cpp b/webrtc/details/webrtc_openal_adm.cpp -index 8aa87d7..19deeff 100644 ---- a/webrtc/details/webrtc_openal_adm.cpp -+++ b/webrtc/details/webrtc_openal_adm.cpp -@@ -4,6 +4,11 @@ - // For license and copyright information please follow this link: - // https://github.com/desktop-app/legal/blob/master/LEGAL - // -+ -+#ifdef Q_OS_HAIKU -+#include -+#endif -+ - #include "webrtc/details/webrtc_openal_adm.h" - - #include "base/timer.h" -diff --git a/webrtc/webrtc_audio_input_tester.cpp b/webrtc/webrtc_audio_input_tester.cpp -index 092b667..204e259 100644 ---- a/webrtc/webrtc_audio_input_tester.cpp -+++ b/webrtc/webrtc_audio_input_tester.cpp -@@ -4,6 +4,11 @@ - // For license and copyright information please follow this link: - // https://github.com/desktop-app/legal/blob/master/LEGAL - // -+ -+#ifdef Q_OS_HAIKU -+#include -+#endif -+ - #include "webrtc/webrtc_audio_input_tester.h" - - #include "webrtc/webrtc_create_adm.h" --- -2.30.2 - diff --git a/net-im/kotatogram-desktop/patches/libtgvoip-1.4.8.patchset b/net-im/kotatogram-desktop/patches/libtgvoip-1.4.9.patchset similarity index 80% rename from net-im/kotatogram-desktop/patches/libtgvoip-1.4.8.patchset rename to net-im/kotatogram-desktop/patches/libtgvoip-1.4.9.patchset index 836cc76a8..959fb3407 100644 --- a/net-im/kotatogram-desktop/patches/libtgvoip-1.4.8.patchset +++ b/net-im/kotatogram-desktop/patches/libtgvoip-1.4.9.patchset @@ -1,13 +1,13 @@ -From 4f1be262da4a9901dc7129c5340290c9f6770dec Mon Sep 17 00:00:00 2001 +From 37f8ff4b3fb6faee3463d094d02b928e08cf7578 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> -Date: Wed, 10 Nov 2021 18:14:40 +1000 +Date: Mon, 21 Mar 2022 12:42:08 +1000 Subject: Add Haiku support -diff --git a/VoIPController.cpp b/VoIPController.cpp -index 22978e3..264cbee 100644 ---- a/VoIPController.cpp -+++ b/VoIPController.cpp +diff --git a/Telegram/ThirdParty/libtgvoip/VoIPController.cpp b/Telegram/ThirdParty/libtgvoip/VoIPController.cpp +index 0ae7625..7900169 100644 +--- a/Telegram/ThirdParty/libtgvoip/VoIPController.cpp ++++ b/Telegram/ThirdParty/libtgvoip/VoIPController.cpp @@ -8,6 +8,9 @@ #include #include @@ -18,7 +18,7 @@ index 22978e3..264cbee 100644 #include #include #include -@@ -3009,6 +3012,10 @@ double VoIPController::GetCurrentTime(){ +@@ -3013,6 +3016,10 @@ double VoIPController::GetCurrentTime(){ struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); return ts.tv_sec+(double)ts.tv_nsec/1000000000.0; @@ -29,10 +29,10 @@ index 22978e3..264cbee 100644 #elif defined(__APPLE__) static pthread_once_t token = PTHREAD_ONCE_INIT; pthread_once(&token, &initMachTimestart); -diff --git a/audio/AudioIO.cpp b/audio/AudioIO.cpp +diff --git a/Telegram/ThirdParty/libtgvoip/audio/AudioIO.cpp b/Telegram/ThirdParty/libtgvoip/audio/AudioIO.cpp index 29d5ad9..994d938 100644 ---- a/audio/AudioIO.cpp -+++ b/audio/AudioIO.cpp +--- a/Telegram/ThirdParty/libtgvoip/audio/AudioIO.cpp ++++ b/Telegram/ThirdParty/libtgvoip/audio/AudioIO.cpp @@ -39,6 +39,9 @@ #ifndef WITHOUT_PULSE #include "../os/linux/AudioPulse.h" @@ -52,10 +52,10 @@ index 29d5ad9..994d938 100644 #elif defined(__linux__) || defined(__FreeBSD__) #ifndef WITHOUT_ALSA #ifndef WITHOUT_PULSE -diff --git a/audio/AudioInput.cpp b/audio/AudioInput.cpp +diff --git a/Telegram/ThirdParty/libtgvoip/audio/AudioInput.cpp b/Telegram/ThirdParty/libtgvoip/audio/AudioInput.cpp index efdc535..12fbc5a 100644 ---- a/audio/AudioInput.cpp -+++ b/audio/AudioInput.cpp +--- a/Telegram/ThirdParty/libtgvoip/audio/AudioInput.cpp ++++ b/Telegram/ThirdParty/libtgvoip/audio/AudioInput.cpp @@ -33,6 +33,8 @@ #ifndef WITHOUT_PULSE #include "../os/linux/AudioPulse.h" @@ -65,10 +65,10 @@ index efdc535..12fbc5a 100644 #else #error "Unsupported operating system" #endif -diff --git a/audio/AudioOutput.cpp b/audio/AudioOutput.cpp +diff --git a/Telegram/ThirdParty/libtgvoip/audio/AudioOutput.cpp b/Telegram/ThirdParty/libtgvoip/audio/AudioOutput.cpp index 3f88799..97820b6 100644 ---- a/audio/AudioOutput.cpp -+++ b/audio/AudioOutput.cpp +--- a/Telegram/ThirdParty/libtgvoip/audio/AudioOutput.cpp ++++ b/Telegram/ThirdParty/libtgvoip/audio/AudioOutput.cpp @@ -37,6 +37,8 @@ #include "../os/linux/AudioOutputPulse.h" #include "../os/linux/AudioPulse.h" @@ -78,11 +78,11 @@ index 3f88799..97820b6 100644 #else #error "Unsupported operating system" #endif -diff --git a/os/haiku/AudioInputHaiku.cpp b/os/haiku/AudioInputHaiku.cpp +diff --git a/Telegram/ThirdParty/libtgvoip/os/haiku/AudioInputHaiku.cpp b/Telegram/ThirdParty/libtgvoip/os/haiku/AudioInputHaiku.cpp new file mode 100644 index 0000000..7cce3e3 --- /dev/null -+++ b/os/haiku/AudioInputHaiku.cpp ++++ b/Telegram/ThirdParty/libtgvoip/os/haiku/AudioInputHaiku.cpp @@ -0,0 +1,276 @@ +// +// libtgvoip is free and unencumbered public domain software. @@ -360,11 +360,11 @@ index 0000000..7cce3e3 + snooze(100); + } +} -diff --git a/os/haiku/AudioInputHaiku.h b/os/haiku/AudioInputHaiku.h +diff --git a/Telegram/ThirdParty/libtgvoip/os/haiku/AudioInputHaiku.h b/Telegram/ThirdParty/libtgvoip/os/haiku/AudioInputHaiku.h new file mode 100644 index 0000000..1c63afe --- /dev/null -+++ b/os/haiku/AudioInputHaiku.h ++++ b/Telegram/ThirdParty/libtgvoip/os/haiku/AudioInputHaiku.h @@ -0,0 +1,66 @@ +// +// libtgvoip is free and unencumbered public domain software. @@ -432,11 +432,11 @@ index 0000000..1c63afe +} + +#endif //LIBTGVOIP_AUDIOINPUTHAIKU_H -diff --git a/os/haiku/AudioOutputHaiku.cpp b/os/haiku/AudioOutputHaiku.cpp +diff --git a/Telegram/ThirdParty/libtgvoip/os/haiku/AudioOutputHaiku.cpp b/Telegram/ThirdParty/libtgvoip/os/haiku/AudioOutputHaiku.cpp new file mode 100644 index 0000000..2fca8a1 --- /dev/null -+++ b/os/haiku/AudioOutputHaiku.cpp ++++ b/Telegram/ThirdParty/libtgvoip/os/haiku/AudioOutputHaiku.cpp @@ -0,0 +1,99 @@ +// +// libtgvoip is free and unencumbered public domain software. @@ -537,11 +537,11 @@ index 0000000..2fca8a1 +bool AudioOutputHaiku::IsPlaying(){ + return isPlaying; +} -diff --git a/os/haiku/AudioOutputHaiku.h b/os/haiku/AudioOutputHaiku.h +diff --git a/Telegram/ThirdParty/libtgvoip/os/haiku/AudioOutputHaiku.h b/Telegram/ThirdParty/libtgvoip/os/haiku/AudioOutputHaiku.h new file mode 100644 index 0000000..91f2521 --- /dev/null -+++ b/os/haiku/AudioOutputHaiku.h ++++ b/Telegram/ThirdParty/libtgvoip/os/haiku/AudioOutputHaiku.h @@ -0,0 +1,35 @@ +// +// libtgvoip is free and unencumbered public domain software. @@ -578,11 +578,11 @@ index 0000000..91f2521 +} + +#endif //LIBTGVOIP_AUDIOOUTPUTHAIKU_H -diff --git a/os/haiku/RingBuffer.cpp b/os/haiku/RingBuffer.cpp +diff --git a/Telegram/ThirdParty/libtgvoip/os/haiku/RingBuffer.cpp b/Telegram/ThirdParty/libtgvoip/os/haiku/RingBuffer.cpp new file mode 100644 index 0000000..6c94933 --- /dev/null -+++ b/os/haiku/RingBuffer.cpp ++++ b/Telegram/ThirdParty/libtgvoip/os/haiku/RingBuffer.cpp @@ -0,0 +1,136 @@ +// +// libtgvoip is free and unencumbered public domain software. @@ -720,11 +720,11 @@ index 0000000..6c94933 +{ + return initialized?B_OK:B_ERROR; +} -diff --git a/os/haiku/RingBuffer.h b/os/haiku/RingBuffer.h +diff --git a/Telegram/ThirdParty/libtgvoip/os/haiku/RingBuffer.h b/Telegram/ThirdParty/libtgvoip/os/haiku/RingBuffer.h new file mode 100644 index 0000000..01f6096 --- /dev/null -+++ b/os/haiku/RingBuffer.h ++++ b/Telegram/ThirdParty/libtgvoip/os/haiku/RingBuffer.h @@ -0,0 +1,37 @@ +// +// libtgvoip is free and unencumbered public domain software. @@ -763,10 +763,10 @@ index 0000000..01f6096 +}; + +#endif -diff --git a/os/posix/NetworkSocketPosix.cpp b/os/posix/NetworkSocketPosix.cpp +diff --git a/Telegram/ThirdParty/libtgvoip/os/posix/NetworkSocketPosix.cpp b/Telegram/ThirdParty/libtgvoip/os/posix/NetworkSocketPosix.cpp index 78e0583..81bf9fc 100644 ---- a/os/posix/NetworkSocketPosix.cpp -+++ b/os/posix/NetworkSocketPosix.cpp +--- a/Telegram/ThirdParty/libtgvoip/os/posix/NetworkSocketPosix.cpp ++++ b/Telegram/ThirdParty/libtgvoip/os/posix/NetworkSocketPosix.cpp @@ -248,12 +248,13 @@ void NetworkSocketPosix::Open(){ } int flag=0; @@ -791,12 +791,12 @@ index 78e0583..81bf9fc 100644 #else struct ifaddrs* interfaces; if(!getifaddrs(&interfaces)){ -diff --git a/threading.h b/threading.h +diff --git a/Telegram/ThirdParty/libtgvoip/threading.h b/Telegram/ThirdParty/libtgvoip/threading.h old mode 100755 new mode 100644 index 37de500..2017b83 ---- a/threading.h -+++ b/threading.h +--- a/Telegram/ThirdParty/libtgvoip/threading.h ++++ b/Telegram/ThirdParty/libtgvoip/threading.h @@ -9,7 +9,7 @@ #include @@ -822,12 +822,12 @@ index 37de500..2017b83 } self->entry(); return NULL; -diff --git a/webrtc_dsp/rtc_base/logging_webrtc.cc b/webrtc_dsp/rtc_base/logging_webrtc.cc +diff --git a/Telegram/ThirdParty/libtgvoip/webrtc_dsp/rtc_base/logging_webrtc.cc b/Telegram/ThirdParty/libtgvoip/webrtc_dsp/rtc_base/logging_webrtc.cc old mode 100755 new mode 100644 index a8d1522..991241b ---- a/webrtc_dsp/rtc_base/logging_webrtc.cc -+++ b/webrtc_dsp/rtc_base/logging_webrtc.cc +--- a/Telegram/ThirdParty/libtgvoip/webrtc_dsp/rtc_base/logging_webrtc.cc ++++ b/Telegram/ThirdParty/libtgvoip/webrtc_dsp/rtc_base/logging_webrtc.cc @@ -28,6 +28,10 @@ static const int kMaxLogLineSize = 1024 - 60; #endif // WEBRTC_MAC && !defined(WEBRTC_IOS) || WEBRTC_ANDROID @@ -852,13 +852,13 @@ index a8d1522..991241b } if (file != nullptr) { -diff --git a/webrtc_dsp/rtc_base/platform_file.h b/webrtc_dsp/rtc_base/platform_file.h +diff --git a/Telegram/ThirdParty/libtgvoip/webrtc_dsp/rtc_base/platform_file.h b/Telegram/ThirdParty/libtgvoip/webrtc_dsp/rtc_base/platform_file.h old mode 100755 new mode 100644 -diff --git a/webrtc_dsp/rtc_base/platform_thread_types.cc b/webrtc_dsp/rtc_base/platform_thread_types.cc +diff --git a/Telegram/ThirdParty/libtgvoip/webrtc_dsp/rtc_base/platform_thread_types.cc b/Telegram/ThirdParty/libtgvoip/webrtc_dsp/rtc_base/platform_thread_types.cc index cf7d478..f27b9a1 100644 ---- a/webrtc_dsp/rtc_base/platform_thread_types.cc -+++ b/webrtc_dsp/rtc_base/platform_thread_types.cc +--- a/Telegram/ThirdParty/libtgvoip/webrtc_dsp/rtc_base/platform_thread_types.cc ++++ b/Telegram/ThirdParty/libtgvoip/webrtc_dsp/rtc_base/platform_thread_types.cc @@ -20,6 +20,8 @@ namespace rtc { PlatformThreadId CurrentThreadId() { #if defined(WEBRTC_WIN) @@ -868,10 +868,10 @@ index cf7d478..f27b9a1 100644 #elif defined(WEBRTC_POSIX) #if defined(WEBRTC_MAC) || defined(WEBRTC_IOS) return pthread_mach_thread_np(pthread_self()); -diff --git a/webrtc_dsp/rtc_base/platform_thread_types.h b/webrtc_dsp/rtc_base/platform_thread_types.h +diff --git a/Telegram/ThirdParty/libtgvoip/webrtc_dsp/rtc_base/platform_thread_types.h b/Telegram/ThirdParty/libtgvoip/webrtc_dsp/rtc_base/platform_thread_types.h index 0bc42eb..c87cde9 100644 ---- a/webrtc_dsp/rtc_base/platform_thread_types.h -+++ b/webrtc_dsp/rtc_base/platform_thread_types.h +--- a/Telegram/ThirdParty/libtgvoip/webrtc_dsp/rtc_base/platform_thread_types.h ++++ b/Telegram/ThirdParty/libtgvoip/webrtc_dsp/rtc_base/platform_thread_types.h @@ -35,6 +35,9 @@ typedef DWORD PlatformThreadRef; #elif defined(WEBRTC_FUCHSIA) typedef zx_handle_t PlatformThreadId; @@ -882,6 +882,51 @@ index 0bc42eb..c87cde9 100644 #elif defined(WEBRTC_POSIX) typedef pid_t PlatformThreadId; typedef pthread_t PlatformThreadRef; +diff --git a/Telegram/cmake/lib_tgvoip.cmake b/Telegram/cmake/lib_tgvoip.cmake +index 9b8ec54..7ffb710 100644 +--- a/Telegram/cmake/lib_tgvoip.cmake ++++ b/Telegram/cmake/lib_tgvoip.cmake +@@ -116,6 +116,14 @@ PRIVATE + os/linux/AudioPulse.cpp + os/linux/AudioPulse.h + ++ # Haiku ++ os/haiku/AudioInputHaiku.cpp ++ os/haiku/AudioInputHaiku.h ++ os/haiku/AudioOutputHaiku.cpp ++ os/haiku/AudioOutputHaiku.h ++ os/haiku/RingBuffer.cpp ++ os/haiku/RingBuffer.h ++ + # POSIX + os/posix/NetworkSocketPosix.cpp + os/posix/NetworkSocketPosix.h +@@ -153,6 +161,25 @@ elseif (APPLE) + TGVOIP_NO_OSX_PRIVATE_API + ) + endif() ++elseif (HAIKU) ++ target_compile_definitions(lib_tgvoip_bundled ++ PUBLIC ++ WEBRTC_POSIX ++ WEBRTC_HAIKU ++ ) ++ target_compile_options(lib_tgvoip_bundled ++ PRIVATE ++ -Wno-unknown-pragmas ++ -Wno-error=sequence-point ++ -Wno-error=unused-result ++ -mmmx ++ -msse2 ++ ) ++ target_link_libraries(lib_tgvoip_bundled ++ PRIVATE ++ network ++ media ++ ) + else() + add_library(lib_tgvoip_bundled_options INTERFACE) + target_compile_options(lib_tgvoip_bundled_options -- 2.30.2 diff --git a/net-im/kotatogram-desktop/patches/tgcalls-1.4.8.patchset b/net-im/kotatogram-desktop/patches/tgcalls-1.4.8.patchset deleted file mode 100644 index a813ba39f..000000000 --- a/net-im/kotatogram-desktop/patches/tgcalls-1.4.8.patchset +++ /dev/null @@ -1,44 +0,0 @@ -From d709b1c94721cae577710164b7640d1d42b7cda4 Mon Sep 17 00:00:00 2001 -From: Gerasim Troeglazov <3dEyes@gmail.com> -Date: Wed, 10 Nov 2021 18:11:20 +1000 -Subject: Fixes for Haiku - - -diff --git a/tgcalls/MediaManager.cpp b/tgcalls/MediaManager.cpp -index fd81ab1..73cdc47 100644 ---- a/tgcalls/MediaManager.cpp -+++ b/tgcalls/MediaManager.cpp -@@ -964,7 +964,7 @@ void MediaManager::fillCallStats(CallStats &callStats) { - } - - void MediaManager::setAudioInputDevice(std::string id) { --#if defined(WEBRTC_IOS) -+#if defined(WEBRTC_IOS) || defined(__HAIKU__) - #else - SetAudioInputDeviceById(_audioDeviceModule.get(), id); - #endif -diff --git a/tgcalls/group/GroupInstanceCustomImpl.cpp b/tgcalls/group/GroupInstanceCustomImpl.cpp -index b3fcaea..6a7ac01 100644 ---- a/tgcalls/group/GroupInstanceCustomImpl.cpp -+++ b/tgcalls/group/GroupInstanceCustomImpl.cpp -@@ -2791,7 +2791,7 @@ public: - } - - void setAudioOutputDevice(const std::string &id) { --#ifndef WEBRTC_IOS -+#if !defined(WEBRTC_IOS) && !defined(__HAIKU__) - _threads->getWorkerThread()->Invoke(RTC_FROM_HERE, [&] { - SetAudioOutputDeviceById(_audioDeviceModule.get(), id); - }); -@@ -2799,7 +2799,7 @@ public: - } - - void setAudioInputDevice(const std::string &id) { --#ifndef WEBRTC_IOS -+#if !defined(WEBRTC_IOS) && !defined(__HAIKU__) - _threads->getWorkerThread()->Invoke(RTC_FROM_HERE, [&] { - SetAudioInputDeviceById(_audioDeviceModule.get(), id); - }); --- -2.30.2 -