aboutsummaryrefslogtreecommitdiffstats
path: root/testing/telegram-desktop/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'testing/telegram-desktop/APKBUILD')
-rw-r--r--testing/telegram-desktop/APKBUILD167
1 files changed, 90 insertions, 77 deletions
diff --git a/testing/telegram-desktop/APKBUILD b/testing/telegram-desktop/APKBUILD
index e6f4f864c9..d951cff246 100644
--- a/testing/telegram-desktop/APKBUILD
+++ b/testing/telegram-desktop/APKBUILD
@@ -1,14 +1,15 @@
# Maintainer: Alex Raschi <raschi.alex@gmail.com>
+# Contributor: Leo <thinkabit.ukim@gmail.com>
pkgname=telegram-desktop
pkgver=1.6.7
-_pkgurl="https://github.com/telegramdesktop/tdesktop.git"
# https://github.com/telegramdesktop/tdesktop/blob/v$pkgver/docs/building-cmake.md
-_gypver=702ac58e477214c635d9b541932e75a95d349352
-_gypurl="https://chromium.googlesource.com/external/gyp"
-_rangever=0.5.0
-_rangeurl="https://github.com/ericniebler/range-v3.git"
+_libtgvoip_commit=e7010506210fbb3a6704d7ac1276b3334f9ab6c9
+_GSL_commit=d846fe50a3f0bb7767c7e087a05f4be95f4da0ec
+_variant_commit=550ac2f159ca883d360c196149b466955c77a573
+_crl_commit=84072fba75f14620935e5e91788ce603daeb1988
pkgrel=0
pkgdesc="Telegram Desktop messaging app"
+options="!check" # Requires Catch2 to be packaged.
url="https://desktop.telegram.org/"
arch="all !s390x"
license="GPL-3.0-or-later WITH OpenSSL"
@@ -30,71 +31,81 @@ makedepends="cmake
alsa-lib-dev
libexecinfo-dev
python2
+ xxhash-dev
+ range-v3-dev
grep"
-source="http://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.gz
- libtgvoip.patch
+source="
+ $pkgname-$pkgver.tar.gz::https://github.com/telegramdesktop/tdesktop/archive/v${pkgver}.tar.gz
+ libtgvoip-$_libtgvoip_commit.tar.gz::https://github.com/telegramdesktop/libtgvoip/archive/${_libtgvoip_commit}.tar.gz
+ GSL-$_GSL_commit.tar.gz::https://github.com/Microsoft/GSL/archive/${_GSL_commit}.tar.gz
+ variant-$_variant_commit.tar.gz::https://github.com/mapbox/variant/archive/${_variant_commit}.tar.gz
+ crl-$_crl_commit.tar.gz::https://github.com/telegramdesktop/crl/archive/${_crl_commit}.tar.gz
musl.patch
no-gtk2.patch
no-pulse.patch
- tdesktop.patch
xdg.patch
ppc64le-enable-arch.patch
- system-wide-fonts.patch"
-builddir="$srcdir/$pkgname-$pkgver"
-_reldir="$builddir/out/Release"
+ system-wide-fonts.patch
+ FindBreakpad.cmake
+ Telegram.cmake
+ TelegramCodegen.cmake
+ TelegramCodegenTools.cmake
+ TelegramTests.cmake
+ ThirdParty-crl.cmake
+ ThirdParty-libtgvoip-webrtc.cmake
+ ThirdParty-libtgvoip.cmake
+ PrecompiledHeader-cmake.patch
+ add-private-qt-functions.patch
+ fix-missing-use-of-pch.patch
+ dynamic-linking-qt5.patch"
+builddir="$srcdir/tdesktop-$pkgver"
-snapshot() {
- local libs="$builddir"/Libraries
+prepare() {
+ cd "$builddir"
- mkdir -p "$srcdir"
- cd "$srcdir"
- git clone --recurse-submodules "$_pkgurl" -b "v$pkgver" "$builddir"
+ rmdir Telegram/ThirdParty/libtgvoip
+ rmdir Telegram/ThirdParty/GSL
+ rmdir Telegram/ThirdParty/variant
+ rmdir Telegram/ThirdParty/crl
- # clone also gyp and range-v3
- mkdir "$libs"
- cd "$libs"
- git clone --recurse-submodules "$_gypurl" -b "master" gyp
- git clone --recurse-submodules "$_rangeurl" -b "$_rangever" range-v3
- cd gyp
- # chromium.googlesource.com doesn't support cloning commits
- git reset --hard "$_gypver"
+ # Copy fetched libraries to their appropriate locations
+ mv ../libtgvoip-${_libtgvoip_commit} "${builddir}"/Telegram/ThirdParty/libtgvoip
+ mv ../GSL-${_GSL_commit} "${builddir}"/Telegram/ThirdParty/GSL
+ mv ../variant-${_variant_commit} "${builddir}"/Telegram/ThirdParty/variant
+ mv ../crl-${_crl_commit} "${builddir}"/Telegram/ThirdParty/crl
- cd "$srcdir"
- find "$builddir" -name .git -exec rm -rf {} +
- # git archive doesn't support submodules
- tar czf "$builddir".tar.gz "${builddir##*/}"
- scp "$builddir".tar.gz dev.alpinelinux.org:/archive/$pkgname/
-}
+ # Copy cmake files
+ mv ../Telegram.cmake "${builddir}"/Telegram/CMakeLists.txt
+ mv ../ThirdParty-crl.cmake "${builddir}"/Telegram/ThirdParty/crl/CMakeLists.txt
+ mv ../ThirdParty-libtgvoip.cmake "${builddir}"/Telegram/ThirdParty/libtgvoip/CMakeLists.txt
+ mv ../ThirdParty-libtgvoip-webrtc.cmake \
+ "${builddir}"/Telegram/ThirdParty/libtgvoip/webrtc_dsp/CMakeLists.txt
+
+ mkdir -p "${builddir}"/Telegram/cmake
+ mv ../FindBreakpad.cmake "${builddir}"/Telegram/cmake
+ mv ../TelegramCodegen.cmake "${builddir}"/Telegram/cmake
+ mv ../TelegramTests.cmake "${builddir}"/Telegram/cmake
+
+ mkdir -p "${builddir}"/Telegram/native
+ mv ../TelegramCodegenTools.cmake "${builddir}"/Telegram/native/CMakeLists.txt
-prepare() {
cd "$builddir/Telegram/ThirdParty"
rm -rf minizip # we have this system-wide
- cd "$builddir/Libraries"
- patch -p1 -i "$builddir"/Telegram/Patches/gyp.diff -d "gyp"
-
default_prepare
}
build() {
- cd "$builddir/Telegram/gyp"
+ cd "$builddir"/Telegram/native
+ CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= cmake .
+ make
+
+ mkdir "$builddir"/Telegram/telegram-build
+ cd "$builddir"/Telegram/telegram-build
export CPPFLAGS="$CPPFLAGS -Winvalid-pch"
export CXXFLAGS="$CXXFLAGS -Winvalid-pch"
-
- # https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/telegram-desktop#n80
- ../../Libraries/gyp/gyp \
- -Dapi_id=17349 \
- -Dapi_hash=344583e45741c457fe1862106095a5eb \
- -Dbuild_defines="TDESKTOP_DISABLE_CRASH_REPORTS,TDESKTOP_DISABLE_AUTOUPDATE,TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME,TDESKTOP_DISABLE_GTK_INTEGRATION,TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION" \
- -Gconfig=Release \
- --depth=. \
- --generator-output=../.. \
- -Goutput_dir=out \
- Telegram.gyp \
- --format=cmake
-
- cd "$_reldir"
- printf '%s\n' 'set_target_properties(Telegram PROPERTIES SKIP_BUILD_RPATH TRUE)' >> CMakeLists.txt
+ export CXXFLAGS="$CXXFLAGS -DTDESKTOP_API_ID=17349"
+ export CXXFLAGS="$CXXFLAGS -DTDESKTOP_API_HASH=344583e45741c457fe1862106095a5eb"
if [ "$CBUILD" != "$CHOST" ]; then
CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
@@ -105,35 +116,23 @@ build() {
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-DCMAKE_C_FLAGS="$CFLAGS" \
- -DCMAKE_ASM_COMPILER=as \
- ${CMAKE_CROSSOPTS}
+ -DENABLE_PULSEAUDIO=OFF \
+ -DENABLE_CRASH_REPORTS=OFF \
+ -DENABLE_GTK_INTEGRATION=OFF \
+ -DBUILD_TESTS=OFF \
+ ${CMAKE_CROSSOPTS} ..
make
}
-check() {
- local test
-
- cd "$_reldir"
- for test in tests_*; do
- ./"$test"
- done
-}
-
package() {
- local size
-
- cd "$_reldir"
+ cd "$builddir"/Telegram/telegram-build
mkdir -p "$pkgdir"/usr/bin
- mv Telegram "$pkgdir"/usr/bin/telegram-desktop
-
- cd "$builddir"
- mkdir -p "$pkgdir"/usr/share/applications
- mv lib/xdg/telegramdesktop.desktop "$pkgdir"/usr/share/applications/telegram-desktop.desktop
+ make DESTDIR="$pkgdir" install
- mkdir -p "$pkgdir"/usr/share/kservices5
- mv lib/xdg/tg.protocol "$pkgdir"/usr/share/kservices5
+ # Fix name to be telegram-desktop
+ mv "$pkgdir"/usr/bin/Telegram "$pkgdir"/usr/bin/telegram-desktop
- cd Telegram/Resources/art
+ cd "${builddir}"/Telegram/Resources/art
mkdir -p "$pkgdir"/usr/share/icons/hicolor
for size in 16 32 48 64 128 256 512; do
mkdir -p "$pkgdir"/usr/share/icons/hicolor/"$size"x"$size"/apps
@@ -141,12 +140,26 @@ package() {
done
}
-sha512sums="7a6775c42869617789862594a0665b2b9e6a1b3a05162f3c684a0fcc9960f608404a0f21f1edea261ab01e0bc0fa843a37e0cf1b0c189f3d5593cbe1abd8bcf8 telegram-desktop-1.6.7.tar.gz
-9ee0dbc4b04454a2f440daa381df765616962e8e8c4330e96851dbc5f2a283da687282d666d2667aac67c3467d2079a94e4fef358dbb18eb24a064d55adc7a40 libtgvoip.patch
+sha512sums="1292b686e47c82f7670e1a528092222c8a61532a9ed64d0e4d3879fa95037b284aa40a956ac1c6739262c4fdf22fb5e9492f6747e971668297cca142a51c5b46 telegram-desktop-1.6.7.tar.gz
+a8ef97da8ab50fdbb166933b8e8fd7b6d7db95a95dcdcd92f6882e1f1104e283a6dece5cf4c40bd8d56738efac3e3905bb403287ede2ec2dc5ace3815df4b097 libtgvoip-e7010506210fbb3a6704d7ac1276b3334f9ab6c9.tar.gz
+83560cb0c39b6a4781e916c6081ad2728296e1b19760ca1b6426a8431fb6d7093760a882c539dd77152f5892fe081b1795af6366ea91385bb10aba6adf27170f GSL-d846fe50a3f0bb7767c7e087a05f4be95f4da0ec.tar.gz
+537ce0a1731274da63a5be063311f7113c1391081e43970663a994b82a7b2e860302406c2931184789661d86343b2c60064c7014b73dc42799573f5b93bc12ff variant-550ac2f159ca883d360c196149b466955c77a573.tar.gz
+a148b62500c2c735065a0612d7168ee671e9b251b822efea90d25718fe0f0fc2abb8f4c93360d6ac38242c669a2d4349ea917cdc63564ebc4a8825fde13666fb crl-84072fba75f14620935e5e91788ce603daeb1988.tar.gz
fc672d8168f6b2807e596570bc57f3b89296891b5d62b8e12b38193ed4919e4eb17efd72691c4086fb0ff4383de54695a9faf9874a0727a0980ef35e5ca4bee7 musl.patch
cb01655dd097b68e89b15e6e4b1f6da10c52e8bec681eeef9807ca376283b10cb3da34acc976c790f3c8dea05acbef1ba1967612920a2e4acb3b9da79e251a0d no-gtk2.patch
-9df70f5057fd9938cab87529693ad9617da0fdbb9084ff57395cd540343a0dcc1ecfba4f868b0043b252fe1aca33d0d214fb07931860296e66fbf11825f95fb9 no-pulse.patch
-cdcc343e8507aed807ffb683f2b728db78c3b981a765746bbda59a97c00b373bfeb13c4251e36e8bc78c84728e91f964eb9d31616b4082393e074d7c12b44454 tdesktop.patch
+90caf4e67f1fb8bcb26455553b90e35d247cbf67097508bd430f7f790aad9e2ae1646b0ea174013c87c331fb37e60633031187a24787e6a73ca73b706d741739 no-pulse.patch
8de8c0508177da5fcac4f2dcee4d8baef4b99f74f1dca296567bc3689a6bd17a47c1c945df504abc8811b82a687010d0709503c7c32e47d2ebb1cf0e374c80c5 xdg.patch
3647ad5fff6326ba9c75fa98189a08c0909af8d1c2b704c8c62fd9da6603f5162af3176c37daa67eb5896bebe3814bf1fd66b9e93c78cbd9b439e472d0db4b44 ppc64le-enable-arch.patch
-ce6be003220267bac5483caf8302b492e1581892bc36d35a61236ebf9f9d766b8bd2159557a1c36256aa85f461797a38bfaae57b12da7a72101b21c0b17ed653 system-wide-fonts.patch"
+ce6be003220267bac5483caf8302b492e1581892bc36d35a61236ebf9f9d766b8bd2159557a1c36256aa85f461797a38bfaae57b12da7a72101b21c0b17ed653 system-wide-fonts.patch
+8b75da50a8212cd7c77e497ad5a49290e2656a2e01037d179cd6270105337a9adb238814f98bdf7a3e954ce8661dc3183a7400533067f9a21e38133a6628563a FindBreakpad.cmake
+485133c447b3414c60e94c074639404768798ec6993095ed108c3b927b6fd423dfee0b68c5c3e12e0d87cc1e53042ab1e76641290c2f71fb29db21245013d72f Telegram.cmake
+56aaf0e35ba1989d463ffa2699e7c0a7235168599f0720f66ff159f03541920e04e5944554b4d1b3a0893cf4581ff50ff00600b54522d24d59fa7192e4f80c0a TelegramCodegen.cmake
+f6e42004d36c69497fd635f1bbd9779027fef1b44fc506cba85ff19c5e49e6b41008782ffb65d59ef4acef78dc0a671c285789ae21cb7a67a9b215c28a2c2eeb TelegramCodegenTools.cmake
+4726ba77330d61f952c7e5af82454cc5536cd92634150406ea5dbc303acfd1d33093334b9b04cf06aa4adca84d97553f28b44dcc554d10af8052352f265c9505 TelegramTests.cmake
+fe1a860184fc31888430d8efb5d12bcf57ef0ed7d64a9570159b906138e987e711e52ea87e3e0567bf749f0336d394aba8a7af9bae6b156c621a13f0aa301b6e ThirdParty-crl.cmake
+2282dedd3d6551893674272ea1308d0c36469711ecf52d1ac2cdc719ab0560a35abc968cc903678dd4e3c2454324e18bcb897b46c597a02013c6d75a7406fffe ThirdParty-libtgvoip-webrtc.cmake
+72b7e188c6787b05f68031f24d901194315243a8b8fb5c3e0c10f1e7c75554ae147810e4d47fa2a0fdf7323da07f48b1cd4a6b840cffd65af96ad9a997e4caff ThirdParty-libtgvoip.cmake
+4f6e4d73fe5774a2fe813b9424438d86e23cfb47483b9f2be56ff14bc471c6312e93549a3a712f1b4e51a0663dc6df086134f5b139536709234a31a695635677 PrecompiledHeader-cmake.patch
+d7f8db23af250156b73b47ad4b1996b73643eb224c969cd1da2929eedfa23a3784ccf8a5728070f464891c621ec6f786e5da323f5bbb2a2cfba999cf80d9dec4 add-private-qt-functions.patch
+6289d5a3eb224ebb05ab64e23ca3d081e617d905cec07edbba423265dc617548005eeb643ce5dfb2fcef9ac774e9f7b64150729bd894ca0e94af0e2aea9c823b fix-missing-use-of-pch.patch
+ad7f1b811b7907b24e0708c5b8f7531891e163b3edebebb159e47cbc24a9201a6ddb5f276f4d0968f84c6d928997f1e94fe9ca678b31e9aad90cdf28449ce39f dynamic-linking-qt5.patch"