Files
haikuports/net-im/kotatogram-desktop/kotatogram_desktop-1.4.9.recipe

206 lines
7.4 KiB
Bash

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="3"
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"
srcGitRev2="25c8637f5975db830cc5d74477641a8b609e248d"
SOURCE_URI_2="https://github.com/desktop-app/tg_owt/archive/$srcGitRev2.tar.gz"
SOURCE_DIR_2="tg_owt-$srcGitRev2"
CHECKSUM_SHA256_2="beb9965fc26df034e29d171ac9f6ed936066330692e935f9e662d57e689c6a04"
SOURCE_FILENAME_2="tg_owt-$srcGitRev2.tar.gz"
srcGitRev_3="5b3351bd07e83f9f9a4cb6629561331ecdb7c546"
SOURCE_URI_3="https://github.com/lemenkov/libyuv/archive/$srcGitRev_3.tar.gz"
CHECKSUM_SHA256_3="242e3c42d2c6ff7770d62d78cfb45642541e92dea6afe2ebe07a9a04db3a98cb"
SOURCE_FILENAME_3="libyuv-$srcGitRev_3.tar.gz"
srcGitRev_4="2b383fe05f8ae78ac99470b9a2b9ea22b3ee5a92"
SOURCE_URI_4="https://salsa.debian.org/debian/telegram-desktop/-/raw/$srcGitRev_4/debian/rules#noarchive"
CHECKSUM_SHA256_4="613e7e357518739e1f7d035337f37c344b248283fd4d916ddc95df73c2ff84ad"
PATCHES="
libtgvoip-$portVersion.patchset
kotatogram_desktop-$portVersion.patchset
"
PATCHES_2="tg_owt-$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:libprotobuf$secondaryArchSuffix
lib:libqrcodegencpp$secondaryArchSuffix
lib:libQt5Core$secondaryArchSuffix
lib:libQt5Gui$secondaryArchSuffix
lib:libQt5Network$secondaryArchSuffix
lib:libQt5Svg$secondaryArchSuffix
lib:libQt5Widgets$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
ffmpeg${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:libLLVM_12$secondaryArchSuffix
devel:liblz4$secondaryArchSuffix
devel:liblzma$secondaryArchSuffix
devel:libminizip$secondaryArchSuffix
devel:libopenal$secondaryArchSuffix
devel:libopus$secondaryArchSuffix
devel:libprotobuf$secondaryArchSuffix
devel:libqrcodegen$secondaryArchSuffix
devel:libQt5Core$secondaryArchSuffix
devel:libQt5Gui$secondaryArchSuffix
devel:libQt5Network$secondaryArchSuffix
devel:libQt5Svg$secondaryArchSuffix
devel:libQt5Widgets$secondaryArchSuffix
devel:libssl$secondaryArchSuffix
devel:librapidjson$secondaryArchSuffix
devel:librnnoise$secondaryArchSuffix
devel:libvpx$secondaryArchSuffix
devel:libxxhash$secondaryArchSuffix
devel:libz$secondaryArchSuffix
devel:range_v3$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gawk
cmd:gcc$secondaryArchSuffix
cmd:lrelease$secondaryArchSuffix
cmd:ninja
cmd:pkg_config$secondaryArchSuffix
cmd:python3
cmd:sed
cmd:yasm
"
BUILD()
{
export DISABLE_ASLR=1
# build tg_owt
rm -rf $sourceDir2/src/third_party/libyuv
ln -s $sourceDir3/libyuv-$srcGitRev_3 $sourceDir2/src/third_party/libyuv
cmake -S $sourceDir2 -B build2 -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$sourceDir/build2/install \
-DBUILD_SHARED_LIBS=FALSE \
-DTG_OWT_PACKAGED_BUILD=TRUE \
-DTG_OWT_BUILD_AUDIO_BACKENDS=OFF \
-DTG_OWT_USE_PROTOBUF=FALSE \
-DTG_OWT_USE_PIPEWIRE=FALSE
ninja -v -C build2 install
# get API_ID and API_HASH from Debian
local TELEGRAM_API_ID=`sed -n "/TDESKTOP_API_ID/p" $sourceDir4/rules | cut -d'=' -f2 | cut -d' ' -f1`
local TELEGRAM_API_HASH=`sed -n "/TDESKTOP_API_HASH/p" $sourceDir4/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
cmake -S $sourceDir -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=$sourceDir/build2/install/lib/cmake \
-DCMAKE_C_FLAGS="-Wno-unknown-warning-option -Wno-unused-command-line-argument" \
-DCMAKE_CXX_FLAGS="-Wno-unknown-warning-option -Wno-unused-command-line-argument" \
-DDESKTOP_APP_QT6=OFF \
-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
ninja -v -C build
}
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
}