mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-02 04:58:52 +02:00
202 lines
8.7 KiB
Bash
202 lines
8.7 KiB
Bash
SUMMARY="Telegram Desktop Messenger"
|
|
DESCRIPTION="Unofficial build of the original Telegram client for Haiku."
|
|
HOMEPAGE="https://www.telegram.org/"
|
|
COPYRIGHT="2013-2019 Telegram"
|
|
LICENSE="GNU GPL v3"
|
|
REVISION="3"
|
|
SOURCE_URI="https://github.com/telegramdesktop/tdesktop/archive/v$portVersion.tar.gz"
|
|
CHECKSUM_SHA256="3d5642d609415cbfe4ba72276947ec63b2ebeb6de2fdd0aa942e8a0f089f0f57"
|
|
SOURCE_FILENAME="tdesktop-$portVersion.tar.gz"
|
|
SOURCE_DIR="tdesktop-$portVersion"
|
|
srcGitRev_2="d4a0f719ffd8d29e88474f67abc9fc862661c3b9"
|
|
SOURCE_URI_2="https://github.com/telegramdesktop/libtgvoip/archive/$srcGitRev_2.tar.gz"
|
|
CHECKSUM_SHA256_2="bb75188b900907a5b00594ad3ddb78195c8d1fdc144e5a458b314dd666eba996"
|
|
SOURCE_FILENAME_2="libtgvoip-$srcGitRev_2.tar.gz"
|
|
srcGitRev_3="550ac2f159ca883d360c196149b466955c77a573"
|
|
SOURCE_URI_3="https://github.com/mapbox/variant/archive/$srcGitRev_3.tar.gz"
|
|
CHECKSUM_SHA256_3="aa794dfefe0a90501587e36d977b958d0df888503117a8d9aa43dc14f8526d9d"
|
|
SOURCE_FILENAME_3="variant-$srcGitRev_3.tar.gz"
|
|
srcGitRev_4="d846fe50a3f0bb7767c7e087a05f4be95f4da0ec"
|
|
SOURCE_URI_4="https://github.com/Microsoft/GSL/archive/$srcGitRev_4.tar.gz"
|
|
CHECKSUM_SHA256_4="be81db4ab1b57102a0fa1cd0c4a6469294eb9daf24294347592245b754f65ff6"
|
|
SOURCE_FILENAME_4="GSL-$srcGitRev_4.tar.gz"
|
|
srcGitRev_5="5ca44b68721833ae3731802ed99af67c6f38a53a"
|
|
SOURCE_URI_5="https://github.com/philsquared/Catch/archive/$srcGitRev_5.tar.gz"
|
|
CHECKSUM_SHA256_5="d24e6d9df2b8aa5739d3b9077c6b0ff0ef4d5ef8acc52c3a57e32893854d8d18"
|
|
SOURCE_FILENAME_5="Catch-$srcGitRev_5.tar.gz"
|
|
srcGitRev_6="52baf11aaeb7f5ea6955a438abaa1aee4c4308d8"
|
|
SOURCE_URI_6="https://github.com/telegramdesktop/crl/archive/$srcGitRev_6.tar.gz"
|
|
CHECKSUM_SHA256_6="9ab12f23916a66665dce9b3baf16594886322f426516d34e2166e7057d78e18e"
|
|
SOURCE_FILENAME_6="crl-$srcGitRev_6.tar.gz"
|
|
srcGitRev_7="8a732ee6736af8af024b5b2032580b85a9be8239"
|
|
SOURCE_URI_7="https://github.com/ericniebler/range-v3/archive/$srcGitRev_7.tar.gz"
|
|
CHECKSUM_SHA256_7="6cd6a412db92bf3c26a408f5807751f976b4a4cb2801c705cb63001e53b47a11"
|
|
SOURCE_FILENAME_7="range-$srcGitRev_7.tar.gz"
|
|
srcGitRev_8="7cc9639699f64b750c0b82333dced9ea77e8436e"
|
|
SOURCE_URI_8="https://github.com/Cyan4973/xxHash/archive/$srcGitRev_8.tar.gz"
|
|
CHECKSUM_SHA256_8="0d1e2b4ae15f98acc49084e23ba94853dba2b0f654865ecedb1072b3959421bf"
|
|
SOURCE_FILENAME_8="xxHash-$srcGitRev_8.tar.gz"
|
|
srcGitRev_9="589db026ec211bc4979e3bffe074f6e48ce7cedc"
|
|
SOURCE_URI_9="https://github.com/john-preston/rlottie/archive/$srcGitRev_9.zip"
|
|
CHECKSUM_SHA256_9="35047dc59500aa9c98459a8d656e07bfc6f0cf7189a902e83b8296f2f007f83a"
|
|
SOURCE_FILENAME_9="rlottie-$srcGitRev_9.zip"
|
|
srcGitRev_10="9a2a9f2d0f38a39c5ec9b329042ca5f060b058e0"
|
|
SOURCE_URI_10="https://github.com/lz4/lz4/archive/$srcGitRev_10.tar.gz"
|
|
CHECKSUM_SHA256_10="fb17b28934ea7f85bd381dd183d765973f7e90a7e2ebc2415af61fe6848741cc"
|
|
SOURCE_FILENAME_10="lz4-$srcGitRev_10.tar.gz"
|
|
srcGitRev_11="0663103551379b958b2e79c51d51d163ec484300"
|
|
SOURCE_URI_11="https://salsa.debian.org/debian/telegram-desktop/raw/$srcGitRev_11/debian/rules#noarchive"
|
|
CHECKSUM_SHA256_11="2b24fb808acee36b5a15824c4ff8bd8b8e83a326a9e4593d2b21922425c5ffb3"
|
|
|
|
PATCHES="
|
|
telegram_desktop-$portVersion.patchset
|
|
telegram_desktop-$portVersion-sonnet.patchset
|
|
"
|
|
PATCHES_2="
|
|
telegram_desktop-$portVersion-libtgvoip.patchset
|
|
"
|
|
ADDITIONAL_FILES="
|
|
telegram_desktop.rdef.in
|
|
logo_256_no_margin.png
|
|
"
|
|
|
|
ARCHITECTURES="!x86_gcc2 x86_64"
|
|
SECONDARY_ARCHITECTURES="x86"
|
|
|
|
PROVIDES="
|
|
telegram_desktop$secondaryArchSuffix = $portVersion
|
|
app:Telegram$secondaryArchSuffix
|
|
cmd:tg_notify_gate
|
|
"
|
|
REQUIRES="
|
|
haiku$secondaryArchSuffix
|
|
lib:libavcodec$secondaryArchSuffix
|
|
lib:libavformat$secondaryArchSuffix
|
|
lib:libavutil$secondaryArchSuffix
|
|
lib:libcrypto$secondaryArchSuffix
|
|
lib:libglib_2.0$secondaryArchSuffix
|
|
lib:libgthread_2.0$secondaryArchSuffix
|
|
lib:libKF5SonnetCore$secondaryArchSuffix
|
|
lib:libKF5SonnetUi$secondaryArchSuffix
|
|
lib:liblzma$secondaryArchSuffix
|
|
lib:libminizip$secondaryArchSuffix
|
|
lib:libopenal$secondaryArchSuffix
|
|
lib:libopus$secondaryArchSuffix
|
|
lib:libQt5Core$secondaryArchSuffix
|
|
lib:libQt5Gui$secondaryArchSuffix
|
|
lib:libQt5Network$secondaryArchSuffix
|
|
lib:libQt5Widgets$secondaryArchSuffix
|
|
lib:libswresample$secondaryArchSuffix
|
|
lib:libswscale$secondaryArchSuffix
|
|
lib:libz$secondaryArchSuffix
|
|
"
|
|
|
|
BUILD_REQUIRES="
|
|
haiku${secondaryArchSuffix}_devel
|
|
devel:libavcodec$secondaryArchSuffix
|
|
devel:libavformat$secondaryArchSuffix
|
|
devel:libavutil$secondaryArchSuffix
|
|
devel:libcrypto$secondaryArchSuffix
|
|
devel:libglib_2.0$secondaryArchSuffix
|
|
devel:libgthread_2.0$secondaryArchSuffix
|
|
devel:libKF5SonnetCore$secondaryArchSuffix
|
|
devel:libKF5SonnetUi$secondaryArchSuffix
|
|
devel:liblzma$secondaryArchSuffix
|
|
devel:libminizip$secondaryArchSuffix
|
|
devel:libopenal$secondaryArchSuffix
|
|
devel:libopus$secondaryArchSuffix
|
|
devel:libQt5Core$secondaryArchSuffix
|
|
devel:libQt5Gui$secondaryArchSuffix
|
|
devel:libQt5Network$secondaryArchSuffix
|
|
devel:libQt5Widgets$secondaryArchSuffix
|
|
devel:librapidjson$secondaryArchSuffix
|
|
devel:libswresample$secondaryArchSuffix
|
|
devel:libswscale$secondaryArchSuffix
|
|
devel:libz$secondaryArchSuffix
|
|
"
|
|
BUILD_PREREQUIRES="
|
|
cmd:cmake
|
|
cmd:gcc$secondaryArchSuffix
|
|
cmd:gyp
|
|
cmd:lrelease$secondaryArchSuffix
|
|
cmd:make
|
|
cmd:pkg_config$secondaryArchSuffix
|
|
cmd:sed
|
|
"
|
|
|
|
PATCH()
|
|
{
|
|
sed -i "s|@HAIKU_HEADERS@|/system/$relativeIncludeDir|" Telegram/gyp/telegram/haiku.gypi
|
|
sed -i "s|@HAIKU_HEADERS@|/system/$relativeIncludeDir|" Telegram/gyp/common/haiku.gypi
|
|
sed -i "s|@HAIKU_HEADERS@|/system/$relativeIncludeDir|" Telegram/gyp/modules/qt.gypi
|
|
sed -i "s|@HAIKU_LIBS@|/system/$relativeLibDir|" Telegram/gyp/telegram/haiku.gypi
|
|
cp -f $sourceDir/../../../additional-files/logo_256_no_margin.png Telegram/Resources/art
|
|
}
|
|
|
|
BUILD()
|
|
{
|
|
# link submodules
|
|
rm -rf Telegram/ThirdParty/{libtgvoip,variant,GSL,Catch,crl,range,xxHash,rlottie,lz4}
|
|
ln -sfn $sourceDir2/libtgvoip-$srcGitRev_2 Telegram/ThirdParty/libtgvoip
|
|
ln -sfn $sourceDir3/variant-$srcGitRev_3 Telegram/ThirdParty/variant
|
|
ln -sfn $sourceDir4/GSL-$srcGitRev_4 Telegram/ThirdParty/GSL
|
|
ln -sfn $sourceDir5/Catch2-$srcGitRev_5 Telegram/ThirdParty/Catch
|
|
ln -sfn $sourceDir6/crl-$srcGitRev_6 Telegram/ThirdParty/crl
|
|
ln -sfn $sourceDir7/range-v3-$srcGitRev_7 Telegram/ThirdParty/range
|
|
ln -sfn $sourceDir8/xxHash-$srcGitRev_8 Telegram/ThirdParty/xxHash
|
|
ln -sfn $sourceDir9/rlottie-$srcGitRev_9 Telegram/ThirdParty/rlottie
|
|
ln -sfn $sourceDir10/lz4-$srcGitRev_10 Telegram/ThirdParty/lz4
|
|
|
|
# get API_ID and API_HASH from Debian
|
|
local TELEGRAM_API_ID=`sed -n 's/TELEGRAM_API_ID = \(.*\)/\1/p' < $sourceDir11/rules`
|
|
local TELEGRAM_API_HASH=`sed -n 's/TELEGRAM_API_HASH = \(.*\)/\1/p' < $sourceDir11/rules`
|
|
|
|
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
|
|
|
|
Telegram/gyp/refresh.sh --api-id $TELEGRAM_API_ID --api-hash $TELEGRAM_API_HASH
|
|
cd out/Release
|
|
# multi-job takes too much memory
|
|
export DISABLE_ASLR=1
|
|
make VERBOSE=1 || (cd /sources/tdesktop-1.8.13/Telegram/gyp && strace /sources/tdesktop-1.8.13/out/Release/codegen_style -I ../Resources -I ../SourceFiles -o /sources/tdesktop-1.8.13/out/Release/obj/gen/styles -w /sources/tdesktop-1.8.13/out/Release/.. ../Resources/basic.style; false)
|
|
|
|
#build notify gate tool
|
|
gcc -o tg-notify-gate $sourceDir/Telegram/SourceFiles/platform/haiku/notifications_haiku_gate.cpp -lbe
|
|
rc -o tg-notify-gate.rsrc $sourceDir/Telegram/SourceFiles/platform/haiku/notifications_haiku_gate.rdef
|
|
xres -o tg-notify-gate tg-notify-gate.rsrc
|
|
mimeset --all tg-notify-gate
|
|
}
|
|
|
|
INSTALL()
|
|
{
|
|
mkdir -p $appsDir $prefix/bin
|
|
cp out/Release/tg-notify-gate $prefix/bin
|
|
cp out/Release/Telegram $appsDir
|
|
strip $appsDir/Telegram
|
|
|
|
local APP_SIGNATURE="application/x-vnd.telegram"
|
|
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/telegram_desktop.rdef.in > telegram_desktop.rdef
|
|
|
|
addResourcesToBinaries telegram_desktop.rdef $appsDir/Telegram
|
|
addAppDeskbarSymlink $appsDir/Telegram
|
|
}
|