summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorMike Kazantsev2023-10-10 17:27:01 +0500
committerfraggod@malediction2023-10-10 17:27:01 +0500
commit54034eaf61d77b19831fffbba4ae7ba01f1c4984 (patch)
tree3382be66045a1f751508779fe6411b7ae389d9ee /PKGBUILD
parentc4b54eba51f4bf418d4f64b3c3f4454f51c78bec (diff)
downloadaur-54034eaf61d77b19831fffbba4ae7ba01f1c4984.tar.gz
Go back to using custom build steps, re-enable libtgvoip
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD41
1 files changed, 26 insertions, 15 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 73e7c851a385..4a8bcbe26a7e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,12 +2,12 @@
pkgname=telegram-tdlib-purple-git
pkgver=0.8.1.r518.1cc2a5d
-pkgrel=1
+pkgrel=2
pkgdesc='libpurple/pidgin Telegram plugin implemented using official tdlib client library'
arch=(x86_64 aarch64)
url='https://github.com/BenWiederhake/tdlib-purple'
license=(GPL2 LGPL2.1 custom:FTL custom:PIX custom:RPD custom:SKIA custom:STB)
-depends=(libpng libpurple libwebp)
+depends=(libtgvoip libpng libpurple libwebp)
makedepends=(cmake git gperf)
conflicts=(telegram-tdlib-purple)
provides=(telegram-tdlib-purple="${pkgver}")
@@ -21,22 +21,33 @@ pkgver() {
printf "%s.r%s.%s" "$ver" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
-prepare() {
+build() {
cd $pkgname
+
# build_and_install.sh is the proper way to build this, with the right tdlib version/commit
- # But cloning td repo from scratch every time gets old fast, so replaced with proper $srcdir clone here
- script=build_and_install.sh td_checkout="$(realpath "$srcdir")"/td
- sed -i \
- -e 's|^\( *\)git clone https://github.com/tdlib/td.git *$|\1'"ln -s '$td_checkout' td|" \
- -e 's|^\( *\)sudo make install *$|\1true|' "$script"
- grep -q "'$td_checkout'" "$script" && grep -qv '^ *sudo ' "$script" || {
- echo >&2 "ERROR: failed to patch git-clone/sudo in build_and_install.sh script"; exit 1; }
-}
+ # But it needs a bunch of tweaks for this build, so not used here, only grepped for that commit
+ td_commit=( $(grep -Po '(?<=git checkout )\S+' build_and_install.sh ||:) )
+ [[ ${#td_commit[@]} -eq 1 ]] || {
+ echo >&2 "ERROR: failed to grep compatible libtd commit in build_and_install.sh script"; exit 1; }
+ td_commit=${td_commit[0]} td_dir="$(realpath "$srcdir")"/td
-build() {
- cd $pkgname
- rm -rf build "$srcdir"/td/build # script will fail on repeated runs otherwise
- ./build_and_install.sh
+ # Build specific tdlib version - can be long, use "makepkg -e" to avoid rebuilding from scratch
+ pushd "$td_dir"
+ [[ $(git rev-parse "$td_commit") = $(git rev-parse HEAD) ]] || git reset --hard "$td_commit"
+ mkdir -p build && pushd build
+ cmake -DCMAKE_BUILD_TYPE=Release ..
+ make
+ make install DESTDIR=destdir
+ popd
+ popd
+
+ # Build and statically link tdlib-libpurple against tdlib above
+ mkdir -p build && pushd build
+ cmake \
+ -DTd_DIR="$td_dir"/build/destdir/usr/local/lib/cmake/Td/ \
+ -Dtgvoip_INCLUDE_DIRS=/usr/include/tgvoip ..
+ make
+ popd
}
package() {