Skip to content

Commit 5c0ebdc

Browse files
committed
net-libs/tdlib: fix USE=java, fixes #200
1 parent a240477 commit 5c0ebdc

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

net-libs/tdlib/tdlib-1.8.1_pre20251023.ebuild

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
EAPI=8
55

6-
inherit cmake git-r3
6+
inherit cmake git-r3 java-pkg-opt-2
77

88
DESCRIPTION="Cross-platform library for building Telegram clients"
99
HOMEPAGE="https://github.com/tdlib/td"
@@ -67,6 +67,7 @@ src_prepare() {
6767
# fi
6868
# # user reported that for now, tests segfaults on glibc and musl
6969

70+
java-pkg-opt-2_src_prepare
7071
cmake_src_prepare
7172
}
7273

@@ -86,6 +87,12 @@ src_configure() {
8687
# -DEMSCRIPTEN=$(usex javascript ON OFF) # Somehow makes GCC to stop seeing pthreads.h
8788
)
8889

90+
if use java; then
91+
export JAVA_HOME="$(java-config -g JAVA_HOME)"
92+
export JAVA_AWT_INCLUDE_PATH="${JAVA_HOME}/include"
93+
export JAVA_JVM_LIBRARY="${JAVA_HOME}/lib/server/libjvm.so"
94+
fi
95+
8996
cmake_src_configure
9097

9198
if use low-ram; then

net-libs/tdlib/tdlib-9999.ebuild

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
EAPI=8
55

6-
inherit cmake git-r3
6+
inherit cmake git-r3 java-pkg-opt-2
77

88
DESCRIPTION="Cross-platform library for building Telegram clients"
99
HOMEPAGE="https://github.com/tdlib/td"
@@ -67,6 +67,7 @@ src_prepare() {
6767
# fi
6868
# # user reported that for now, tests segfaults on glibc and musl
6969

70+
java-pkg-opt-2_src_prepare
7071
cmake_src_prepare
7172
}
7273

@@ -86,6 +87,12 @@ src_configure() {
8687
# -DEMSCRIPTEN=$(usex javascript ON OFF) # Somehow makes GCC to stop seeing pthreads.h
8788
)
8889

90+
if use java; then
91+
export JAVA_HOME="$(java-config -g JAVA_HOME)"
92+
export JAVA_AWT_INCLUDE_PATH="${JAVA_HOME}/include"
93+
export JAVA_JVM_LIBRARY="${JAVA_HOME}/lib/server/libjvm.so"
94+
fi
95+
8996
cmake_src_configure
9097

9198
if use low-ram; then

0 commit comments

Comments
 (0)