mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-04 14:08:51 +02:00
147 lines
4.9 KiB
Bash
147 lines
4.9 KiB
Bash
SUMMARY="Telegram Desktop Messenger"
|
|
DESCRIPTION="Official desktop version of Telegram messaging app."
|
|
HOMEPAGE="https://www.telegram.org/"
|
|
COPYRIGHT="2013-2018 Telegram"
|
|
LICENSE="GNU GPL v3"
|
|
REVISION="1"
|
|
|
|
SOURCE_URI="https://github.com/telegramdesktop/tdesktop/archive/v$portVersion.tar.gz"
|
|
SOURCE_DIR="tdesktop-$portVersion"
|
|
CHECKSUM_SHA256="2cdf89859be93196def45145fabbbbeff6c54743f84fe2a1809d66644aac243c"
|
|
|
|
COMMIT_2="697eea96aa90205db4fc368df4127eef56b2a5c6"
|
|
SOURCE_URI_2="https://github.com/telegramdesktop/libtgvoip/archive/$COMMIT_2.zip"
|
|
CHECKSUM_SHA256_2="3028061037a181c1ae9088a1f8e6ae8524858b647f218370323dff33fcfeebb9"
|
|
|
|
COMMIT_3="550ac2f159ca883d360c196149b466955c77a573"
|
|
SOURCE_URI_3="https://github.com/mapbox/variant/archive/$COMMIT_3.zip"
|
|
CHECKSUM_SHA256_3="3676117c49db1ef1ff2818f6f70713c3a4469f0da8ecb5c98c157499322501fc"
|
|
|
|
COMMIT_4="d846fe50a3f0bb7767c7e087a05f4be95f4da0ec"
|
|
SOURCE_URI_4="https://github.com/Microsoft/GSL/archive/$COMMIT_4.zip"
|
|
CHECKSUM_SHA256_4="320e2d7707aaa6f7bcc0d6ddc95e2e4413b433ddcc1c8afa0a93fb85a47db47b"
|
|
|
|
COMMIT_5="5ca44b68721833ae3731802ed99af67c6f38a53a"
|
|
SOURCE_URI_5="https://github.com/philsquared/Catch/archive/$COMMIT_5.zip"
|
|
CHECKSUM_SHA256_5="bec93e64dea2dd0c6662a75a81cdd1747a753ccd86025ef436b7d2fac3b408d2"
|
|
|
|
COMMIT_6="9bc641f2d4ab140a84aea64c7f2d4669f7633246"
|
|
SOURCE_URI_6="https://github.com/telegramdesktop/crl/archive/$COMMIT_6.zip"
|
|
CHECKSUM_SHA256_6="563424b0a56c8a3c7b05d82a0e3551a467051057b53e8f7e68f4815921e6953a"
|
|
|
|
COMMIT_7="4b10be9cbadd7d0880437f48f875185589fd86d3"
|
|
SOURCE_URI_7="https://github.com/ericniebler/range-v3/archive/$COMMIT_7.zip"
|
|
CHECKSUM_SHA256_7="67095606bd533dcffefb6a9ae6be0dc5176d77912928b60ad4e60cc66fc611c7"
|
|
|
|
PATCHES="
|
|
telegram_desktop-$portVersion-systemqt.patch
|
|
telegram_desktop-$portVersion.patchset
|
|
"
|
|
|
|
PATCHES_2="
|
|
telegram_desktop-$portVersion-libtgvoip.patchset
|
|
"
|
|
|
|
ADDITIONAL_FILES="telegram_desktop.rdef.in"
|
|
|
|
ARCHITECTURES="!x86_gcc2 x86_64"
|
|
SECONDARY_ARCHITECTURES="x86"
|
|
|
|
PROVIDES="
|
|
telegram_desktop$secondaryArchSuffix = $portVersion
|
|
app:Telegram$secondaryArchSuffix
|
|
"
|
|
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:libswresample$secondaryArchSuffix
|
|
devel:libswscale$secondaryArchSuffix
|
|
devel:libz$secondaryArchSuffix
|
|
"
|
|
BUILD_PREREQUIRES="
|
|
cmd:cmake
|
|
cmd:gyp
|
|
cmd:gcc$secondaryArchSuffix
|
|
cmd:make
|
|
cmd:pkg_config$secondaryArchSuffix
|
|
"
|
|
|
|
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
|
|
}
|
|
|
|
BUILD()
|
|
{
|
|
# link submodules
|
|
rm -rf Telegram/ThirdParty/{libtgvoip,variant,GSL,Catch,crl,range}
|
|
ln -sfn $sourceDir2/libtgvoip-$COMMIT_2 Telegram/ThirdParty/libtgvoip
|
|
ln -sfn $sourceDir3/variant-$COMMIT_3 Telegram/ThirdParty/variant
|
|
ln -sfn $sourceDir4/GSL-$COMMIT_4 Telegram/ThirdParty/GSL
|
|
ln -sfn $sourceDir5/Catch2-$COMMIT_5 Telegram/ThirdParty/Catch
|
|
ln -sfn $sourceDir6/crl-$COMMIT_6 Telegram/ThirdParty/crl
|
|
ln -sfn $sourceDir7/range-v3-$COMMIT_7 Telegram/ThirdParty/range
|
|
|
|
Telegram/gyp/refresh.sh ; cd out/Release
|
|
# multi-job takes too much memory
|
|
make
|
|
}
|
|
|
|
INSTALL()
|
|
{
|
|
mkdir -p $appsDir
|
|
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
|
|
}
|