summaryrefslogtreecommitdiff
path: root/net-libs/tdlib/tdlib-1.8.49_p20250510-r1.ebuild
diff options
context:
space:
mode:
Diffstat (limited to 'net-libs/tdlib/tdlib-1.8.49_p20250510-r1.ebuild')
-rw-r--r--net-libs/tdlib/tdlib-1.8.49_p20250510-r1.ebuild77
1 files changed, 77 insertions, 0 deletions
diff --git a/net-libs/tdlib/tdlib-1.8.49_p20250510-r1.ebuild b/net-libs/tdlib/tdlib-1.8.49_p20250510-r1.ebuild
new file mode 100644
index 000000000000..9e053501604c
--- /dev/null
+++ b/net-libs/tdlib/tdlib-1.8.49_p20250510-r1.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="Cross-platform library for building Telegram clients"
+HOMEPAGE="https://github.com/tdlib/td"
+
+MY_PV="51743dfd01dff6179e2d8f7095729caa4e2222e9"
+SRC_URI="https://github.com/tdlib/td/archive/${MY_PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/td-${MY_PV}"
+
+LICENSE="Boost-1.0"
+SLOT="0/${PV%_p*}"
+KEYWORDS="amd64 ~arm64 ~loong ~riscv"
+IUSE="+tde2e test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ dev-libs/openssl:=
+ virtual/zlib:=
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ dev-util/gperf
+"
+
+src_prepare() {
+ sed -e '/add_library(/s/ STATIC//' \
+ -i CMakeLists.txt */CMakeLists.txt || die
+ sed -e '/set(INSTALL_STATIC_TARGETS /s/ tdjson_static TdJsonStatic//' \
+ -e '/generate_pkgconfig(tdjson_static /d' \
+ -i CMakeLists.txt || die
+
+ # Benchmarks take way too long to compile
+ sed -e '/add_subdirectory(benchmark)/d' \
+ -i CMakeLists.txt || die
+
+ # Fix tests linking
+ sed -e 's/target_link_libraries(run_all_tests PRIVATE /&tdmtproto /' \
+ -i test/CMakeLists.txt
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_TESTING=$(usex test)
+ -DTDE2E_INSTALL_INCLUDES=yes
+ )
+ cmake_src_configure
+
+ if use tde2e; then
+ # Generate cmake configuration files for the e2e-only variant
+ # These are required by certain programs which depend on "tde2e"
+ mycmakeargs+=( -DTD_E2E_ONLY=ON )
+ BUILD_DIR="${S}_tde2e" cmake_src_configure
+ fi
+}
+
+src_install() {
+ cmake_src_install
+
+ if use tde2e; then
+ # Install the tde2e headers
+ insinto /usr/include/td/e2e
+ doins tde2e/td/e2e/e2e_api.h tde2e/td/e2e/e2e_errors.h
+
+ # Install the tde2e cmake files
+ cd "${S}_tde2e" || die
+ insinto /usr/$(get_libdir)/cmake/tde2e
+ doins tde2eConfig.cmake tde2eConfigVersion.cmake
+ doins CMakeFiles/Export/*/tde2eStaticTargets*.cmake
+ fi
+}