Diff kodi-21.3 with a kodi-9999

/usr/portage/media-tv/kodi/kodi-9999.ebuild 2026-04-10 12:17:39.720735263 +0300
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.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/"
......
50 50
			-> libdvdcss-${LIBDVDCSS_VERSION}.tar.gz
51 51
	)
52 52
	!system-ffmpeg? (
53
		https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz
53
		https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.xz
54 54
	)
55 55
"
56 56
if [[ ${PV} == *9999 ]] ; then
......
67 67
	MY_PV="${MY_PV}-${CODENAME}"
68 68
	MY_P="${PN}-${MY_PV}"
69 69
	SRC_URI+=" https://github.com/xbmc/xbmc/archive/${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
70
	KEYWORDS="amd64 ~arm arm64 ~riscv ~x86"
70
	# Dont keyword
71
	if ! [[ ${PV} =~ _alpha ]] && ! [[ ${PV} =~ _beta ]] && ! [[ ${PV} =~ _rc ]]; then
72
		KEYWORDS="~amd64 ~arm64 ~riscv ~x86"
73
	fi
71 74
	S=${WORKDIR}/xbmc-${MY_PV}
72 75
fi
73 76

  
......
84 87
# use flag is called libusb so that it doesn't fool people in thinking that
85 88
# it is _required_ for USB support. Otherwise they'll disable udev and
86 89
# 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}"
90
IUSE="airplay alsa bluetooth bluray caps cec +css dbus doc eventclients gbm gles lcms libusb lirc mariadb mysql nfs +optical pipewire postproc pulseaudio samba soc +system-ffmpeg test udf udev upnp vaapi vdpau wayland webserver X +xslt zeroconf ${CPU_FLAGS}"
88 91
REQUIRED_USE="
89 92
	${PYTHON_REQUIRED_USE}
90 93
	|| ( gbm wayland X )
91 94
	?? ( mariadb mysql )
92 95
	bluray? ( udf )
93 96
	gbm? ( udev )
97
	postproc? ( !system-ffmpeg )
94 98
	soc? ( system-ffmpeg )
95 99
	udev? ( !libusb )
96 100
	vdpau? ( X !gles !gbm )
......
115 119
	dev-db/sqlite:3
116 120
	dev-libs/crossguid
117 121
	>=dev-libs/fribidi-1.0.5
118
	>=dev-libs/libcdio-2.1.0:=[cxx]
119 122
	>=dev-libs/libfmt-6.1.2:=
120 123
	dev-libs/libfstrcmp
121
	dev-libs/libpcre[cxx]
124
	dev-libs/libpcre2:=
122 125
	>=dev-libs/openssl-1.1.1k:0=
123 126
	>=dev-libs/spdlog-1.5.0:=
124 127
	dev-libs/tinyxml[stl]
125 128
	dev-libs/tinyxml2:=
126 129
	media-fonts/roboto
130
	media-gfx/exiv2:=
127 131
	media-libs/libglvnd[X?]
128 132
	>=media-libs/freetype-2.10.1
129 133
	media-libs/harfbuzz:=
130 134
	>=media-libs/libass-0.15.0:=
131 135
	media-libs/mesa[opengl,wayland?,X?]
132 136
	media-libs/taglib:=
133
	sci-libs/kissfft
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 204
	system-ffmpeg? (
199
		media-video/ffmpeg-compat:6=[encode(+),soc(-)?,postproc(-),vaapi?,vdpau?,X?]
205
		>=media-video/ffmpeg-7:=[encode(+),soc(-)?,vaapi?,vdpau?,X?]
200 206
	)
201 207
	!system-ffmpeg? (
202 208
		app-arch/bzip2
......
245 251
DEPEND="
246 252
	${COMMON_DEPEND}
247 253
	${COMMON_TARGET_DEPEND}
248
	>=dev-libs/rapidjson-1.0.2
254
	>=dev-cpp/nlohmann_json-3.2.0
249 255
	test? (
250 256
		>=dev-cpp/gtest-1.10.0
251 257
	)
......
271 277

  
272 278
PATCHES=(
273 279
	"${FILESDIR}"/kodi-21-optional-ffmpeg-libx11.patch
274
	"${FILESDIR}"/kodi-21.1-silence-libdvdread-git.patch
280
	"${FILESDIR}"/kodi-22-silence-libdvdread-git.patch
275 281
)
276 282

  
277 283
# bug #544020
......
283 289

  
284 290
pkg_setup() {
285 291
	check_extra_config
286
	java-pkg-2_pkg_setup
292
	ROOT= java-pkg-2_pkg_setup
287 293
	python-single-r1_pkg_setup
288 294
}
289 295

  
......
307 313
		-e '/dbus_connection_send_with_reply_and_block/s:-1:3000:' \
308 314
		xbmc/platform/linux/*.cpp || die
309 315

  
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 316
	if tc-is-cross-compiler; then
318 317
		# These tools are automatically built with CMake during a native build
319 318
		# but need to be built in advance using Autotools for a cross build.
......
333 332
}
334 333

  
335 334
src_configure() {
335
	# used below and by vendored libdvdread
336
	tc-export PKG_CONFIG
337

  
336 338
	local core_platform=(
337 339
		$(usev gbm)
338 340
		$(usev wayland)
......
362 364
		-DENABLE_GOLD=OFF
363 365
		-DENABLE_LLD=OFF
364 366
		-DENABLE_MOLD=OFF
365
		-DUSE_LTO=OFF
367

  
368
		# This isn't normally necessary with CMake, but Kodi includes its own
369
		# FindPkgConfig module that doesn't respect PKG_CONFIG. :(
370
		-DPKG_CONFIG_EXECUTABLE=$(type -P "${PKG_CONFIG}")
366 371

  
367 372
		# Features
368 373
		-DENABLE_AIRTUNES=$(usex airplay)
......
398 403
		-DENABLE_VDPAU=$(usex vdpau)
399 404
		-DENABLE_XSLT=$(usex xslt)
400 405

  
401
		-DWITH_FFMPEG=$(usex system-ffmpeg)
406
		-DWITH_FFMPEG=OFF
407
		-DDISABLE_FFMPEG_SOURCE_PLUGINS=$(usex !postproc)
402 408

  
403 409
		#To bundle or not
410
		-DENABLE_INTERNAL_ASS=OFF
411
		-DENABLE_INTERNAL_CURL=OFF
404 412
		-DENABLE_INTERNAL_CROSSGUID=OFF
405 413
		-DENABLE_INTERNAL_DAV1D=OFF
414
		-DENABLE_INTERNAL_EXIV2=OFF
406 415
		-DENABLE_INTERNAL_FFMPEG="$(usex !system-ffmpeg)"
407 416
		-DENABLE_INTERNAL_FLATBUFFERS=OFF
408 417
		-DENABLE_INTERNAL_FMT=OFF
409 418
		-DENABLE_INTERNAL_FSTRCMP=OFF
410 419
		-DENABLE_INTERNAL_GTEST=OFF
411
		-DENABLE_INTERNAL_KISSFFT=OFF
412
		-DENABLE_INTERNAL_PCRE=OFF
413
		-DENABLE_INTERNAL_RapidJSON=OFF
420
		-DENABLE_INTERNAL_PCRE2=OFF
421
		-DENABLE_INTERNAL_NLOHMANNJSON=OFF
414 422
		-DENABLE_INTERNAL_SPDLOG=OFF
415 423
		-DENABLE_INTERNAL_TAGLIB=OFF
416
		-DENABLE_INTERNAL_UDFREAD=OFF
417 424

  
418 425
		-DTARBALL_DIR="${DISTDIR}"
419 426
		-Dlibdvdnav_URL="${DISTDIR}/libdvdnav-${LIBDVDNAV_VERSION}.tar.gz"
......
426 433
	# Separated to avoid "Manually-specified variables were not used by the project:"
427 434
	use cec && mycmakeargs+=( -DENABLE_INTERNAL_CEC=OFF )
428 435
	use css && mycmakeargs+=( -Dlibdvdcss_URL="${DISTDIR}/libdvdcss-${LIBDVDCSS_VERSION}.tar.gz" )
429
	use nfs && mycmakeargs+=( -DENABLE_INTERNAL_NFS=OFF )
430 436
	use !system-ffmpeg && mycmakeargs+=(
431
		-DFFMPEG_URL="${DISTDIR}/ffmpeg-${FFMPEG_VERSION}.tar.gz"
437
		-DFFMPEG_URL="${DISTDIR}/ffmpeg-${FFMPEG_VERSION}.tar.xz"
432 438
	)
439
	use nfs && mycmakeargs+=( -DENABLE_INTERNAL_NFS=OFF )
433 440
	use !udev && mycmakeargs+=( -DENABLE_LIBUSB=$(usex libusb) )
434 441
	use X && use !gles && mycmakeargs+=( -DENABLE_GLX=ON )
435 442

  
......
438 445
		mycmakeargs+=( -DENABLE_${name^^}=$(usex ${flag}) )
439 446
	done
440 447

  
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 448
	if ! is-flag -DNDEBUG && ! is-flag -D_DEBUG ; then
449 449
		# Kodi requires one of the 'NDEBUG' or '_DEBUG' defines
450 450
		append-cflags -DNDEBUG
451 451
		append-cxxflags -DNDEBUG
452 452
	fi
453 453

  
454
	# Violates ODR (bug #860984) and USE_LTO does spooky stuff
455
	# https://github.com/xbmc/xbmc/commit/cb72a22d54a91845b1092c295f84eeb48328921e
456
	filter-lto
454
	if tc-is-lto ; then
455
		mycmakeargs+=( -DUSE_LTO=ON )
456
	else
457
		mycmakeargs+=( -DUSE_LTO=OFF )
458
	fi
457 459

  
458 460
	# bug #926076
459 461
	append-flags -fPIC
460 462

  
461
	# used by vendored libdvdread
462
	tc-export PKG_CONFIG
463

  
464 463
	if tc-is-cross-compiler; then
465 464
		for t in "${NATIVE_TOOLS[@]}" ; do
466 465
			pushd "${S}/tools/depends/native/$t/src" >/dev/null || die
......
491 490
		# Known failing, unreliable test
492 491
		# bug #743938
493 492
		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 493
		# Tries to ping localhost, naturally breaking network-sandbox
499 494
		TestNetwork.PingHost
500 495
	)
501 496

  
497
	# Tests assumes bluray support is enabled
498
	use !bluray && CMAKE_SKIP_TESTS+=( TestURIUtils.GetBasePath )
499

  
502 500
	if use arm || use x86; then
503 501
		# bug #779184
504 502
		# https://github.com/xbmc/xbmc/issues/18594
Thank you!