Files
haikuports/net-im/tdesktop/tdesktop-1.1.23.recipe
2017-09-18 22:17:45 +10:00

117 lines
4.0 KiB
Bash

SUMMARY="Telegram Desktop Messenger"
DESCRIPTION="Official desktop version of Telegram messaging app."
HOMEPAGE="https://www.telegram.org/"
COPYRIGHT="2013-2017 Telegram"
LICENSE="GNU GPL v3"
REVISION="4"
SOURCE_URI="https://github.com/telegramdesktop/tdesktop/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="56b7fce84adf85a4af1c3174353169f32d0b0c052a4e7a284fc741fa96b04030"
COMMIT_2="757a5d8ec31aadcf387ac3cb135256152c18de1c"
SOURCE_URI_2="https://github.com/telegramdesktop/libtgvoip/archive/$COMMIT_2.zip"
CHECKSUM_SHA256_2="afd82dde02fb43c0e66e462a3da1d9e84ae76aa3e71d37e696c261aa151d3cdd"
COMMIT_3="550ac2f159ca883d360c196149b466955c77a573"
SOURCE_URI_3="https://github.com/mapbox/variant/archive/$COMMIT_3.zip"
CHECKSUM_SHA256_3="3676117c49db1ef1ff2818f6f70713c3a4469f0da8ecb5c98c157499322501fc"
COMMIT_4="c5851a8161938798c5594a66420cb814fea92711"
SOURCE_URI_4="https://github.com/Microsoft/GSL/archive/$COMMIT_4.zip"
CHECKSUM_SHA256_4="2fe4befdd1cd69de435797c8c50cd7ce749d140982f2260eead90f31721d2c95"
COMMIT_5="5ca44b68721833ae3731802ed99af67c6f38a53a"
SOURCE_URI_5="https://github.com/philsquared/Catch/archive/$COMMIT_5.zip"
CHECKSUM_SHA256_5="3774ee51ab7a14045b151c4f8927b85349436525f1fefe033f6e5772752f9cd9"
ADDITIONAL_FILES="tdesktop.rdef.in"
PATCHES="tdesktop-$portVersion.patchset"
PATCHES_2="tdesktop-$portVersion-libtgvoip.patchset"
ARCHITECTURES="!x86_gcc2 x86_64"
SECONDARY_ARCHITECTURES="?x86"
PROVIDES="
tdesktop$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
"
BUILD()
{
# link submodules
rm -rf Telegram/ThirdParty/{libtgvoip,variant,GSL,Catch}
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/Catch-$COMMIT_5 Telegram/ThirdParty/Catch
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/tdesktop.rdef.in > tdesktop.rdef
addResourcesToBinaries tdesktop.rdef $appsDir/Telegram
addAppDeskbarSymlink $appsDir/Telegram
}