| 1 |
|
# Copyright 1999-2026 Gentoo Authors
|
|
1 |
# Copyright 1999-2025 Gentoo Authors
|
| 2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
3 |
|
| 4 |
4 |
EAPI=8
|
| 5 |
5 |
|
| 6 |
|
CODENAME="Omega"
|
|
6 |
CODENAME="Piers"
|
| 7 |
7 |
|
| 8 |
8 |
# libdvd{css,read,nav} are not unbundlable without patching the buildsystem.
|
| 9 |
9 |
|
| ... | ... | |
| 12 |
12 |
LIBDVDCSS_VERSION="1.4.3-Next-Nexus-Alpha2-2"
|
| 13 |
13 |
LIBDVDREAD_VERSION="6.1.3-Next-Nexus-Alpha2-2"
|
| 14 |
14 |
LIBDVDNAV_VERSION="6.1.1-Next-Nexus-Alpha2-2"
|
| 15 |
|
FFMPEG_VERSION="6.0.1"
|
|
15 |
FFMPEG_VERSION="8.0.1"
|
| 16 |
16 |
|
| 17 |
17 |
# Java bundles from xbmc/interfaces/swig/CMakeLists.txt
|
| 18 |
18 |
GROOVY_VERSION="4.0.26"
|
| ... | ... | |
| 26 |
26 |
JAVA_PKG_WANT_TARGET="21"
|
| 27 |
27 |
|
| 28 |
28 |
PYTHON_REQ_USE="sqlite,ssl"
|
| 29 |
|
PYTHON_COMPAT=( python3_{11..13} )
|
|
29 |
PYTHON_COMPAT=( python3_{11..14} )
|
| 30 |
30 |
|
| 31 |
31 |
# See cmake/scripts/common/ArchSetup.cmake for available options
|
| 32 |
32 |
CPU_FLAGS="cpu_flags_x86_sse cpu_flags_x86_sse2 cpu_flags_x86_sse3 cpu_flags_x86_sse4_1 cpu_flags_x86_sse4_2 cpu_flags_x86_avx cpu_flags_x86_avx2 cpu_flags_arm_neon"
|
| 33 |
33 |
|
| 34 |
|
inherit autotools cmake desktop ffmpeg-compat flag-o-matic java-pkg-2 libtool
|
| 35 |
|
inherit linux-info optfeature pax-utils python-single-r1 toolchain-funcs xdg
|
|
34 |
inherit autotools cmake desktop flag-o-matic java-pkg-2 libtool linux-info optfeature pax-utils python-single-r1 \
|
|
35 |
toolchain-funcs xdg
|
| 36 |
36 |
|
| 37 |
37 |
DESCRIPTION="A free and open source media-player and entertainment hub"
|
| 38 |
38 |
HOMEPAGE="https://kodi.tv/"
|
| ... | ... | |
| 45 |
45 |
https://mirrors.kodi.tv/build-deps/sources/apache-groovy-binary-${GROOVY_VERSION}.zip
|
| 46 |
46 |
https://mirrors.kodi.tv/build-deps/sources/commons-lang3-${APACHE_COMMON_LANG_VERSION}-bin.tar.gz
|
| 47 |
47 |
https://mirrors.kodi.tv/build-deps/sources/commons-text-${APACHE_COMMON_TEXT_VERSION}-bin.tar.gz
|
|
48 |
https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.xz
|
| 48 |
49 |
css? (
|
| 49 |
50 |
https://github.com/xbmc/libdvdcss/archive/${LIBDVDCSS_VERSION}.tar.gz
|
| 50 |
51 |
-> libdvdcss-${LIBDVDCSS_VERSION}.tar.gz
|
| 51 |
52 |
)
|
| 52 |
|
!system-ffmpeg? (
|
| 53 |
|
https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz
|
| 54 |
|
)
|
| 55 |
53 |
"
|
| 56 |
54 |
if [[ ${PV} == *9999 ]] ; then
|
| 57 |
55 |
EGIT_REPO_URI="https://github.com/xbmc/xbmc.git"
|
| ... | ... | |
| 67 |
65 |
MY_PV="${MY_PV}-${CODENAME}"
|
| 68 |
66 |
MY_P="${PN}-${MY_PV}"
|
| 69 |
67 |
SRC_URI+=" https://github.com/xbmc/xbmc/archive/${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
|
| 70 |
|
KEYWORDS="amd64 ~arm arm64 ~riscv ~x86"
|
|
68 |
# Dont keyword
|
|
69 |
if ! [[ ${PV} =~ _alpha ]] && ! [[ ${PV} =~ _beta ]] && ! [[ ${PV} =~ _rc ]]; then
|
|
70 |
KEYWORDS="~amd64 ~arm64 ~riscv ~x86"
|
|
71 |
fi
|
| 71 |
72 |
S=${WORKDIR}/xbmc-${MY_PV}
|
| 72 |
73 |
fi
|
| 73 |
74 |
|
| ... | ... | |
| 78 |
79 |
# libdvdnav, libdvdread and libdvdcss.
|
| 79 |
80 |
LICENSE+=" GPL-2+"
|
| 80 |
81 |
# ffmpeg built as USE="gpl"
|
| 81 |
|
LICENSE+=" !system-ffmpeg? ( GPL-2 )"
|
|
82 |
LICENSE+=" GPL-2"
|
| 82 |
83 |
|
| 83 |
84 |
SLOT="0"
|
| 84 |
85 |
# use flag is called libusb so that it doesn't fool people in thinking that
|
| 85 |
86 |
# it is _required_ for USB support. Otherwise they'll disable udev and
|
| 86 |
87 |
# that's going to be worse.
|
| 87 |
|
IUSE="airplay alsa bluetooth bluray caps cec +css dbus doc eventclients gbm gles lcms libusb lirc mariadb mysql nfs +optical pipewire pulseaudio samba soc +system-ffmpeg test udf udev upnp vaapi vdpau wayland webserver X +xslt zeroconf ${CPU_FLAGS}"
|
|
88 |
IUSE="airplay alsa bluetooth bluray caps cec +css dbus doc eventclients gbm gles lcms libusb lirc mariadb mysql nfs +optical pipewire pulseaudio samba +system-ffmpeg test udf udev upnp vaapi vdpau wayland webserver X +xslt zeroconf ${CPU_FLAGS}"
|
| 88 |
89 |
REQUIRED_USE="
|
| 89 |
90 |
${PYTHON_REQUIRED_USE}
|
| 90 |
91 |
|| ( gbm wayland X )
|
| 91 |
92 |
?? ( mariadb mysql )
|
| 92 |
93 |
bluray? ( udf )
|
| 93 |
94 |
gbm? ( udev )
|
| 94 |
|
soc? ( system-ffmpeg )
|
| 95 |
95 |
udev? ( !libusb )
|
| 96 |
96 |
vdpau? ( X !gles !gbm )
|
| 97 |
97 |
zeroconf? ( dbus )
|
| ... | ... | |
| 110 |
110 |
)
|
| 111 |
111 |
"
|
| 112 |
112 |
COMMON_TARGET_DEPEND="${PYTHON_DEPS}
|
|
113 |
app-arch/bzip2
|
|
114 |
app-arch/xz-utils
|
| 113 |
115 |
>=net-misc/curl-7.68.0[http2]
|
| 114 |
116 |
>=virtual/zlib-1.2.11:=
|
| 115 |
117 |
dev-db/sqlite:3
|
| 116 |
118 |
dev-libs/crossguid
|
| 117 |
119 |
>=dev-libs/fribidi-1.0.5
|
| 118 |
|
>=dev-libs/libcdio-2.1.0:=[cxx]
|
| 119 |
120 |
>=dev-libs/libfmt-6.1.2:=
|
| 120 |
121 |
dev-libs/libfstrcmp
|
| 121 |
|
dev-libs/libpcre[cxx]
|
|
122 |
dev-libs/libpcre2:=
|
| 122 |
123 |
>=dev-libs/openssl-1.1.1k:0=
|
| 123 |
124 |
>=dev-libs/spdlog-1.5.0:=
|
| 124 |
125 |
dev-libs/tinyxml[stl]
|
| 125 |
126 |
dev-libs/tinyxml2:=
|
| 126 |
127 |
media-fonts/roboto
|
|
128 |
media-gfx/exiv2:=
|
|
129 |
media-libs/dav1d:=
|
| 127 |
130 |
media-libs/libglvnd[X?]
|
| 128 |
131 |
>=media-libs/freetype-2.10.1
|
| 129 |
132 |
media-libs/harfbuzz:=
|
| 130 |
133 |
>=media-libs/libass-0.15.0:=
|
| 131 |
134 |
media-libs/mesa[opengl,wayland?,X?]
|
| 132 |
135 |
media-libs/taglib:=
|
| 133 |
|
sci-libs/kissfft
|
|
136 |
net-libs/gnutls:=
|
| 134 |
137 |
virtual/libiconv
|
| 135 |
138 |
virtual/ttf-fonts
|
| 136 |
139 |
x11-libs/libdrm
|
| ... | ... | |
| 184 |
187 |
dev-db/mysql-connector-c:=
|
| 185 |
188 |
)
|
| 186 |
189 |
nfs? (
|
| 187 |
|
>=net-fs/libnfs-2.0.0:=
|
|
190 |
>=net-fs/libnfs-3.0.0:=
|
|
191 |
)
|
|
192 |
optical? (
|
|
193 |
>=dev-libs/libcdio-2.1.0:=[cxx]
|
| 188 |
194 |
)
|
| 189 |
195 |
pipewire? (
|
| 190 |
196 |
>=media-video/pipewire-0.3.50:=
|
| 191 |
197 |
)
|
| 192 |
198 |
pulseaudio? (
|
| 193 |
|
media-libs/libpulse
|
|
199 |
>=media-libs/libpulse-11.0.0
|
| 194 |
200 |
)
|
| 195 |
201 |
samba? (
|
| 196 |
202 |
>=net-fs/samba-3.4.6[smbclient(+)]
|
| 197 |
203 |
)
|
| 198 |
|
system-ffmpeg? (
|
| 199 |
|
media-video/ffmpeg-compat:6=[encode(+),soc(-)?,postproc(-),vaapi?,vdpau?,X?]
|
| 200 |
|
)
|
| 201 |
|
!system-ffmpeg? (
|
| 202 |
|
app-arch/bzip2
|
| 203 |
|
app-arch/xz-utils
|
| 204 |
|
media-libs/dav1d:=
|
| 205 |
|
net-libs/gnutls:=
|
| 206 |
|
)
|
| 207 |
204 |
udf? (
|
| 208 |
205 |
>=dev-libs/libudfread-1.0.0
|
| 209 |
206 |
)
|
| ... | ... | |
| 245 |
242 |
DEPEND="
|
| 246 |
243 |
${COMMON_DEPEND}
|
| 247 |
244 |
${COMMON_TARGET_DEPEND}
|
| 248 |
|
>=dev-libs/rapidjson-1.0.2
|
|
245 |
>=dev-cpp/nlohmann_json-3.2.0
|
| 249 |
246 |
test? (
|
| 250 |
247 |
>=dev-cpp/gtest-1.10.0
|
| 251 |
248 |
)
|
| ... | ... | |
| 271 |
268 |
|
| 272 |
269 |
PATCHES=(
|
| 273 |
270 |
"${FILESDIR}"/kodi-21-optional-ffmpeg-libx11.patch
|
| 274 |
|
"${FILESDIR}"/kodi-21.1-silence-libdvdread-git.patch
|
|
271 |
"${FILESDIR}"/kodi-22-silence-libdvdread-git.patch
|
| 275 |
272 |
)
|
| 276 |
273 |
|
| 277 |
274 |
# bug #544020
|
| ... | ... | |
| 307 |
304 |
-e '/dbus_connection_send_with_reply_and_block/s:-1:3000:' \
|
| 308 |
305 |
xbmc/platform/linux/*.cpp || die
|
| 309 |
306 |
|
| 310 |
|
# Add all possible names for kissfft libraries
|
| 311 |
|
for datatype in {float,int16,int32,simd}; do
|
| 312 |
|
sed -i \
|
| 313 |
|
-e "s/\(find_library(KISSFFT_LIBRARY NAMES .*\)/\1 kissfft-${datatype} kissfft-${datatype}-openmp/" \
|
| 314 |
|
cmake/modules/FindKissFFT.cmake || die
|
| 315 |
|
done
|
| 316 |
|
|
| 317 |
307 |
if tc-is-cross-compiler; then
|
| 318 |
308 |
# These tools are automatically built with CMake during a native build
|
| 319 |
309 |
# but need to be built in advance using Autotools for a cross build.
|
| ... | ... | |
| 362 |
352 |
-DENABLE_GOLD=OFF
|
| 363 |
353 |
-DENABLE_LLD=OFF
|
| 364 |
354 |
-DENABLE_MOLD=OFF
|
| 365 |
|
-DUSE_LTO=OFF
|
| 366 |
355 |
|
| 367 |
356 |
# Features
|
| 368 |
357 |
-DENABLE_AIRTUNES=$(usex airplay)
|
| ... | ... | |
| 398 |
387 |
-DENABLE_VDPAU=$(usex vdpau)
|
| 399 |
388 |
-DENABLE_XSLT=$(usex xslt)
|
| 400 |
389 |
|
| 401 |
|
-DWITH_FFMPEG=$(usex system-ffmpeg)
|
|
390 |
# ffmpeg hasn't decided on if postproc is removed or not and kodi has chosen to patch it back
|
|
391 |
-DWITH_FFMPEG=OFF
|
| 402 |
392 |
|
| 403 |
393 |
#To bundle or not
|
|
394 |
-DENABLE_INTERNAL_ASS=OFF
|
|
395 |
-DENABLE_INTERNAL_CURL=OFF
|
| 404 |
396 |
-DENABLE_INTERNAL_CROSSGUID=OFF
|
| 405 |
397 |
-DENABLE_INTERNAL_DAV1D=OFF
|
| 406 |
|
-DENABLE_INTERNAL_FFMPEG="$(usex !system-ffmpeg)"
|
|
398 |
-DENABLE_INTERNAL_EXIV2=OFF
|
|
399 |
-DENABLE_INTERNAL_FFMPEG=ON
|
| 407 |
400 |
-DENABLE_INTERNAL_FLATBUFFERS=OFF
|
| 408 |
401 |
-DENABLE_INTERNAL_FMT=OFF
|
| 409 |
402 |
-DENABLE_INTERNAL_FSTRCMP=OFF
|
| 410 |
403 |
-DENABLE_INTERNAL_GTEST=OFF
|
| 411 |
|
-DENABLE_INTERNAL_KISSFFT=OFF
|
| 412 |
|
-DENABLE_INTERNAL_PCRE=OFF
|
| 413 |
|
-DENABLE_INTERNAL_RapidJSON=OFF
|
|
404 |
-DENABLE_INTERNAL_PCRE2=OFF
|
|
405 |
-DENABLE_INTERNAL_NLOHMANNJSON=OFF
|
| 414 |
406 |
-DENABLE_INTERNAL_SPDLOG=OFF
|
| 415 |
407 |
-DENABLE_INTERNAL_TAGLIB=OFF
|
| 416 |
|
-DENABLE_INTERNAL_UDFREAD=OFF
|
| 417 |
408 |
|
| 418 |
409 |
-DTARBALL_DIR="${DISTDIR}"
|
| 419 |
410 |
-Dlibdvdnav_URL="${DISTDIR}/libdvdnav-${LIBDVDNAV_VERSION}.tar.gz"
|
| ... | ... | |
| 421 |
412 |
-Dgroovy_SOURCE_DIR="${WORKDIR}/groovy-${GROOVY_VERSION}"
|
| 422 |
413 |
-Dapache-commons-lang_SOURCE_DIR="${WORKDIR}/commons-lang3-${APACHE_COMMON_LANG_VERSION}"
|
| 423 |
414 |
-Dapache-commons-text_SOURCE_DIR="${WORKDIR}/commons-text-${APACHE_COMMON_TEXT_VERSION}"
|
|
415 |
-DFFMPEG_URL="${DISTDIR}/ffmpeg-${FFMPEG_VERSION}.tar.xz"
|
| 424 |
416 |
)
|
| 425 |
417 |
|
| 426 |
418 |
# Separated to avoid "Manually-specified variables were not used by the project:"
|
| 427 |
419 |
use cec && mycmakeargs+=( -DENABLE_INTERNAL_CEC=OFF )
|
| 428 |
420 |
use css && mycmakeargs+=( -Dlibdvdcss_URL="${DISTDIR}/libdvdcss-${LIBDVDCSS_VERSION}.tar.gz" )
|
| 429 |
421 |
use nfs && mycmakeargs+=( -DENABLE_INTERNAL_NFS=OFF )
|
| 430 |
|
use !system-ffmpeg && mycmakeargs+=(
|
| 431 |
|
-DFFMPEG_URL="${DISTDIR}/ffmpeg-${FFMPEG_VERSION}.tar.gz"
|
| 432 |
|
)
|
| 433 |
422 |
use !udev && mycmakeargs+=( -DENABLE_LIBUSB=$(usex libusb) )
|
| 434 |
423 |
use X && use !gles && mycmakeargs+=( -DENABLE_GLX=ON )
|
| 435 |
424 |
|
| ... | ... | |
| 438 |
427 |
mycmakeargs+=( -DENABLE_${name^^}=$(usex ${flag}) )
|
| 439 |
428 |
done
|
| 440 |
429 |
|
| 441 |
|
if use system-ffmpeg; then
|
| 442 |
|
# TODO: drop compat and allow using >=media-video/ffmpeg-7
|
| 443 |
|
ffmpeg_compat_setup 6
|
| 444 |
|
ffmpeg_compat_add_flags
|
| 445 |
|
mycmakeargs+=( -DFFMPEG_INCLUDE_DIRS="${SYSROOT}$(ffmpeg_compat_get_prefix 6)" )
|
| 446 |
|
fi
|
| 447 |
|
|
| 448 |
430 |
if ! is-flag -DNDEBUG && ! is-flag -D_DEBUG ; then
|
| 449 |
431 |
# Kodi requires one of the 'NDEBUG' or '_DEBUG' defines
|
| 450 |
432 |
append-cflags -DNDEBUG
|
| 451 |
433 |
append-cxxflags -DNDEBUG
|
| 452 |
434 |
fi
|
| 453 |
435 |
|
| 454 |
|
# Violates ODR (bug #860984) and USE_LTO does spooky stuff
|
| 455 |
|
# https://github.com/xbmc/xbmc/commit/cb72a22d54a91845b1092c295f84eeb48328921e
|
| 456 |
|
filter-lto
|
|
436 |
if tc-is-lto ; then
|
|
437 |
mycmakeargs+=( -DUSE_LTO=ON )
|
|
438 |
else
|
|
439 |
mycmakeargs+=( -DUSE_LTO=OFF )
|
|
440 |
fi
|
| 457 |
441 |
|
| 458 |
442 |
# bug #926076
|
| 459 |
443 |
append-flags -fPIC
|
| ... | ... | |
| 491 |
475 |
# Known failing, unreliable test
|
| 492 |
476 |
# bug #743938
|
| 493 |
477 |
TestCPUInfo.GetCPUFrequency
|
| 494 |
|
# Test failure stemming from sci-libs/kissfft
|
| 495 |
|
# The difference between output[2i] and (i==freq1?1.0:0.0) is inf, which exceeds 1e-7, where output[2i]
|
| 496 |
|
# evaluates to inf,(i==freq1?1.0:0.0) evaluates to 0, and 1e-7 evaluates to 9.9999999999999995e-08.
|
| 497 |
|
TestRFFT.SimpleSignal
|
| 498 |
478 |
# Tries to ping localhost, naturally breaking network-sandbox
|
| 499 |
479 |
TestNetwork.PingHost
|
| 500 |
480 |
)
|
| 501 |
481 |
|
|
482 |
# Tests assumes bluray support is enabled
|
|
483 |
use !bluray && CMAKE_SKIP_TESTS+=( TestURIUtils.GetBasePath )
|
|
484 |
|
| 502 |
485 |
if use arm || use x86; then
|
| 503 |
486 |
# bug #779184
|
| 504 |
487 |
# https://github.com/xbmc/xbmc/issues/18594
|