diff options
author | Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in> | 2022-11-10 21:31:40 +0500 |
---|---|---|
committer | Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in> | 2022-11-10 23:02:23 +0500 |
commit | 93261750a79ce8ec6bd7e6c89fd58b4d7ff074ce (patch) | |
tree | 6a2750e936e0a375bf831a827ea9612f375cccfa /net-libs/td | |
parent | net-libs/td: java fixup (diff) | |
download | guru-93261750a79ce8ec6bd7e6c89fd58b4d7ff074ce.tar.gz guru-93261750a79ce8ec6bd7e6c89fd58b4d7ff074ce.tar.bz2 guru-93261750a79ce8ec6bd7e6c89fd58b4d7ff074ce.zip |
net-libs/td: add 9999
Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
Diffstat (limited to 'net-libs/td')
-rw-r--r-- | net-libs/td/metadata.xml | 1 | ||||
-rw-r--r-- | net-libs/td/td-9999.ebuild | 112 |
2 files changed, 113 insertions, 0 deletions
diff --git a/net-libs/td/metadata.xml b/net-libs/td/metadata.xml index cbe66e366..49213d427 100644 --- a/net-libs/td/metadata.xml +++ b/net-libs/td/metadata.xml @@ -10,6 +10,7 @@ <remote-id type="github">tdlib/td</remote-id> </upstream> <use> + <flag name="abseil">Build with <pkg>dev-cpp/abseil-cpp</pkg></flag> <flag name="benchmark">Enable benchmarking</flag> <flag name="dotnet">Add support for .NET</flag> <flag name="jumbo-build">Combine source files to speed up build process</flag> diff --git a/net-libs/td/td-9999.ebuild b/net-libs/td/td-9999.ebuild new file mode 100644 index 000000000..88d1aef53 --- /dev/null +++ b/net-libs/td/td-9999.ebuild @@ -0,0 +1,112 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DOCS_BUILDER="doxygen" +inherit check-reqs cmake docs edo git-r3 java-pkg-opt-2 + +DESCRIPTION="Cross-platform library for building Telegram clients" +HOMEPAGE=" + https://core.telegram.org/tdlib + https://github.com/tdlib/td +" +EGIT_REPO_URI="https://github.com/tdlib/${PN}.git" + +LICENSE="Boost-1.0" +SLOT="0" +KEYWORDS="" +IUSE="abseil dotnet +jumbo-build static-libs test" +RESTRICT="!test? ( test )" + +RDEPEND=" + dev-libs/openssl:= + sys-libs/zlib:= + abseil? ( dev-cpp/abseil-cpp:= ) + dotnet? ( virtual/dotnet-sdk:* ) + java? ( >=virtual/jdk-11:*[-headless-awt] ) +" +DEPEND="${RDEPEND}" +BDEPEND=" + dev-lang/php[cli] + dev-util/gperf +" + +DOCS=( CHANGELOG.md README.md ) + +CHECKREQS_MEMORY="2G" + +pkg_pretend() { + use test && check-reqs_pkg_pretend +} + +pkg_setup() { + java-pkg-opt-2_pkg_setup + + use test && check-reqs_pkg_setup +} + +src_prepare() { + sed "/find_program(CCACHE_FOUND ccache)/d" -i CMakeLists.txt || die + + cmake_comment_add_subdirectory benchmark + use test || \ + cmake_comment_add_subdirectory test + + cmake_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DTD_ENABLE_DOTNET=$(usex dotnet) + -DTD_ENABLE_JNI=$(usex java) + -DTD_WITH_ABSEIL=$(usex abseil) + -DTD_TEST_FOLLY=OFF + ) + + if use java; then + local JAVA_AWT_LIBRARY="${JAVA_HOME}/lib/libjawt.so" + local JAVA_JVM_LIBRARY="${JAVA_HOME}/lib/libjava.so" + + mycmakeargs+=( + -DJAVA_AWT_LIBRARY="${JAVA_AWT_LIBRARY}" + -DJAVA_JVM_LIBRARY="${JAVA_JVM_LIBRARY}" + -DJAVA_INCLUDE_PATH="${JAVA_HOME}/include" + -DJAVA_INCLUDE_PATH2="${JAVA_HOME}/include/linux" + -DJAVA_AWT_INCLUDE_PATH="${JAVA_HOME}/include" + ) + fi + + cmake_src_configure +} + +src_compile() { + einfo "Generating TL source files" + cmake_build tl_generate_common tl_generate_json + + if ! use jumbo-build; then + einfo "Splitting source files" + edo php SplitSource.php + fi + + # Let's build the library + einfo "Building TDLib" + cmake_src_compile + + if use doc; then + einfo "Generating docs" + docs_compile + fi +} + +src_install() { + cmake_src_install + + docompress -x /usr/share/doc/${PF}/example + dodoc -r example + + if ! use static-libs; then + einfo "Removing static libraries" + find "${D}" -type f -name '*.a' -delete || die + fi +} |