mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-05 22:48:55 +02:00
190 lines
7.8 KiB
Bash
190 lines
7.8 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="1"
|
|
SOURCE_URI="https://github.com/telegramdesktop/tdesktop/archive/v$portVersion.tar.gz"
|
|
CHECKSUM_SHA256="b3ca072eb4c6e30fd17d34daa129d6211de427fa3953f4020b27a02e65400ef1"
|
|
SOURCE_FILENAME="tdesktop-$portVersion.tar.gz"
|
|
SOURCE_DIR="tdesktop-$portVersion"
|
|
srcGitRev_2="a19a0aff644127d8089f6a4ac18119ec5247dbd0"
|
|
SOURCE_URI_2="https://github.com/telegramdesktop/libtgvoip/archive/$srcGitRev_2.tar.gz"
|
|
CHECKSUM_SHA256_2="d839ab5a3358e171116b322e0053f441e023c9ced9aec3f0388969c2fce7ac43"
|
|
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="d259aebc11df52cb6ff8c738580dc4d8f245d681"
|
|
SOURCE_URI_6="https://github.com/telegramdesktop/crl/archive/$srcGitRev_6.tar.gz"
|
|
CHECKSUM_SHA256_6="f5ea3aeeda0290a44ac49b6300b033d171e67a5b27039fea2f8ae0cb3fc71253"
|
|
SOURCE_FILENAME_6="crl-$srcGitRev_6.tar.gz"
|
|
srcGitRev_7="4b10be9cbadd7d0880437f48f875185589fd86d3"
|
|
SOURCE_URI_7="https://github.com/ericniebler/range-v3/archive/$srcGitRev_7.tar.gz"
|
|
CHECKSUM_SHA256_7="86f6b8a2e2d8196d62312042af1953d0b16935550130a73ae0ec69f623b0b947"
|
|
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="a3fac9db920b167a5f91d678ee7968f100f6fe51"
|
|
SOURCE_URI_9="https://github.com/telegramdesktop/qtlottie/archive/$srcGitRev_9.tar.gz"
|
|
CHECKSUM_SHA256_9="16d4cda12e340b89007c610070c67130e87f60a85fd1206339ac92b2c71ce848"
|
|
SOURCE_FILENAME_9="qtlottie-$srcGitRev_9.tar.gz"
|
|
SOURCE_URI_10="https://salsa.debian.org/debian/telegram-desktop/raw/debian/master/debian/rules#noarchive"
|
|
CHECKSUM_SHA256_10="86382a56ef7163eedbfae7e4daf491e9d3e7a8811ff2c769e6d7c143def7727f"
|
|
|
|
PATCHES="
|
|
telegram_desktop-$portVersion-systemqt.patch
|
|
telegram_desktop-$portVersion.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: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: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/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,qtlottie}
|
|
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/qtlottie-$srcGitRev_9 Telegram/ThirdParty/qtlottie
|
|
|
|
# get API_ID and API_HASH from Debian
|
|
local TELEGRAM_API_ID=`sed -n 's/TELEGRAM_API_ID = \(.*\)/\1/p' < $sourceDir10/rules`
|
|
local TELEGRAM_API_HASH=`sed -n 's/TELEGRAM_API_HASH = \(.*\)/\1/p' < $sourceDir10/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
|
|
make
|
|
|
|
#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
|
|
}
|