1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_REQ_USE="libressl?,sqlite,ssl"
7 LIBDVDCSS_VERSION="1.4.2-Leia-Beta-5"
8 LIBDVDREAD_VERSION="6.0.0-Leia-Alpha-3"
9 LIBDVDNAV_VERSION="6.0.0-Leia-Alpha-3"
10 FFMPEG_VERSION="4.0.4"
12 FFMPEG_KODI_VERSION="18.4"
13 SRC_URI="https://github.com/xbmc/libdvdcss/archive/${LIBDVDCSS_VERSION}.tar.gz -> libdvdcss-${LIBDVDCSS_VERSION}.tar.gz
14 https://github.com/xbmc/libdvdread/archive/${LIBDVDREAD_VERSION}.tar.gz -> libdvdread-${LIBDVDREAD_VERSION}.tar.gz
15 https://github.com/xbmc/libdvdnav/archive/${LIBDVDNAV_VERSION}.tar.gz -> libdvdnav-${LIBDVDNAV_VERSION}.tar.gz
16 !system-ffmpeg? ( https://github.com/xbmc/FFmpeg/archive/${FFMPEG_VERSION}-${CODENAME}-${FFMPEG_KODI_VERSION}.tar.gz -> ffmpeg-${PN}-${FFMPEG_VERSION}-${CODENAME}-${FFMPEG_KODI_VERSION}.tar.gz )"
18 "${FILESDIR}/${P}-cassert.patch"
21 if [[ ${PV} == *9999 ]] ; then
22 PYTHON_COMPAT=( python2_7 python3_{6,7} )
23 EGIT_REPO_URI="https://github.com/xbmc/xbmc.git"
26 PYTHON_COMPAT=( python2_7 )
28 MY_PV=${MY_PV/_alpha/a}
29 MY_PV=${MY_PV/_beta/b}
32 SRC_URI+=" https://github.com/xbmc/xbmc/archive/${MY_PV}-${CODENAME}.tar.gz -> ${MY_P}.tar.gz"
33 KEYWORDS="~amd64 ~x86"
34 S=${WORKDIR}/xbmc-${MY_PV}-${CODENAME}
37 inherit autotools cmake desktop linux-info pax-utils python-single-r1 xdg
39 DESCRIPTION="A free and open source media-player and entertainment hub"
40 HOMEPAGE="https://kodi.tv/ https://kodi.wiki/"
44 # use flag is called libusb so that it doesn't fool people in thinking that
45 # it is _required_ for USB support. Otherwise they'll disable udev and
46 # that's going to be worse.
47 IUSE="airplay alsa bluetooth bluray caps cec +css dbus dvd gbm gles lcms libressl libusb lirc mariadb mysql nfs +opengl pulseaudio raspberry-pi samba systemd +system-ffmpeg test +udev udisks upnp upower vaapi vdpau wayland webserver +X +xslt zeroconf"
49 ${PYTHON_REQUIRED_USE}
51 ^^ ( gbm raspberry-pi wayland X )
57 RESTRICT="!test? ( test )"
59 COMMON_DEPEND="${PYTHON_DEPS}
61 >=app-pda/libplist-2.0.0
64 alsa? ( >=media-libs/alsa-lib-1.1.4.1 )
65 bluetooth? ( net-wireless/bluez )
66 bluray? ( >=media-libs/libbluray-1.0.2 )
67 caps? ( sys-libs/libcap )
68 dbus? ( sys-apps/dbus )
72 >=dev-libs/fribidi-0.19.7
73 cec? ( >=dev-libs/libcec-4.0[raspberry-pi?] )
75 >=dev-libs/libinput-1.10.5
76 >=dev-libs/libxml2-2.9.4
79 $(python_gen_cond_dep 'dev-python/pillow[${PYTHON_MULTI_USEDEP}]')
80 $(python_gen_cond_dep 'dev-python/pycryptodome[${PYTHON_MULTI_USEDEP}]' 'python3*')
81 >=dev-libs/libcdio-0.94
82 >=dev-libs/libfmt-3.0.1
84 gbm? ( media-libs/mesa[gbm] )
86 !raspberry-pi? ( media-libs/mesa[gles2] )
88 lcms? ( media-libs/lcms:2 )
89 libusb? ( virtual/libusb:1 )
92 >=media-libs/fontconfig-2.12.4
93 >=media-libs/freetype-2.8
94 >=media-libs/libass-0.13.4
95 !raspberry-pi? ( media-libs/mesa[egl,X(+)] )
96 >=media-libs/taglib-1.11.1
98 >=media-video/ffmpeg-${FFMPEG_VERSION}:=[encode,postproc]
99 libressl? ( media-video/ffmpeg[libressl,-openssl] )
100 !libressl? ( media-video/ffmpeg[-libressl,openssl] )
102 mysql? ( dev-db/mysql-connector-c:= )
103 mariadb? ( dev-db/mariadb-connector-c:= )
104 >=net-misc/curl-7.56.1[http2]
105 nfs? ( >=net-fs/libnfs-2.0.0:= )
106 opengl? ( media-libs/glu )
107 !libressl? ( >=dev-libs/openssl-1.0.2l:0= )
108 libressl? ( dev-libs/libressl:0= )
110 || ( media-libs/raspberrypi-userland media-libs/raspberrypi-userland-bin media-libs/mesa[egl,gles2,video_cards_vc4] )
112 pulseaudio? ( media-sound/pulseaudio )
113 samba? ( >=net-fs/samba-3.4.6[smbclient(+)] )
114 >=sys-libs/zlib-1.2.11
115 udev? ( virtual/udev )
118 opengl? ( x11-libs/libva[opengl] )
119 system-ffmpeg? ( media-video/ffmpeg[vaapi] )
120 vdpau? ( x11-libs/libva[vdpau] )
121 wayland? ( x11-libs/libva[wayland] )
122 X? ( x11-libs/libva[X] )
126 || ( >=x11-libs/libvdpau-1.1 >=x11-drivers/nvidia-drivers-180.51 )
127 system-ffmpeg? ( media-video/ffmpeg[vdpau] )
130 >=dev-cpp/waylandpp-0.2.3:=
131 media-libs/mesa[wayland]
132 >=dev-libs/wayland-protocols-1.7
134 webserver? ( >=net-libs/libmicrohttpd-0.9.55[messages(+)] )
139 system-ffmpeg? ( media-video/ffmpeg[X] )
142 >=x11-libs/libxkbcommon-0.4.1
143 xslt? ( dev-libs/libxslt )
144 zeroconf? ( net-dns/avahi[dbus] )
146 RDEPEND="${COMMON_DEPEND}
147 lirc? ( app-misc/lirc )
149 udisks? ( sys-fs/udisks:2 )
150 upower? ( sys-power/upower )
152 DEPEND="${COMMON_DEPEND}
161 >=media-libs/libjpeg-turbo-1.5.1:=
162 >=media-libs/libpng-1.6.26:0=
163 test? ( dev-cpp/gtest )
166 x86? ( dev-lang/nasm )
169 CONFIG_CHECK="~IP_MULTICAST"
171 In some cases Kodi needs to access multicast addresses.
172 Please consider enabling IP_MULTICAST under Networking options.
177 python-single-r1_pkg_setup
181 if [[ ${PV} == *9999 ]] ; then
182 if python_is_python3; then
183 EGIT_BRANCH="feature_python3"
184 ewarn "Using the experimental Python 3 branch!"
185 ewarn "See https://kodi.wiki/view/Migration_to_Python_3 for more information."
186 ewarn "To use the non-experimental Python 2 version:"
187 ewarn "echo '~${CATEGORY}/${P} PYTHON_TARGETS: -* python2_7 PYTHON_SINGLE_TARGET: -* python2_7' >> /etc/portage/package.use"
188 ewarn "then re-merge using: emerge -a =${CATEGORY}/${PF}"
199 # avoid long delays when powerkit isn't running #348580
201 -e '/dbus_connection_send_with_reply_and_block/s:-1:3000:' \
202 xbmc/platform/linux/*.cpp || die
204 # Prepare tools and libs witch are configured with autotools during compile time
207 "${S}"/tools/depends/native/TexturePacker/src
208 "${S}"/tools/depends/native/JsonSchemaBuilder/src
212 for d in "${AUTOTOOLS_DIRS[@]}" ; do
213 pushd ${d} >/dev/null || die
214 AT_NOELIBTOOLIZE="yes" AT_TOPLEVEL_EAUTORECONF="yes" eautoreconf
215 popd >/dev/null || die
219 # Prevent autoreconf rerun
220 sed -e 's/autoreconf -vif/echo "autoreconf already done in src_prepare()"/' -i \
221 "${S}"/cmake/modules/FindCpluff.cmake \
222 "${S}"/tools/depends/native/TexturePacker/src/autogen.sh \
223 "${S}"/tools/depends/native/JsonSchemaBuilder/src/autogen.sh \
229 -Ddocdir="${EPREFIX}/usr/share/doc/${PF}"
230 -DENABLE_LDGOLD=OFF # https://bugs.gentoo.org/show_bug.cgi?id=606124
231 -DENABLE_ALSA=$(usex alsa)
232 -DENABLE_AIRTUNES=$(usex airplay)
233 -DENABLE_AVAHI=$(usex zeroconf)
234 -DENABLE_BLUETOOTH=$(usex bluetooth)
235 -DENABLE_BLURAY=$(usex bluray)
237 -DENABLE_CEC=$(usex cec)
238 -DENABLE_DBUS=$(usex dbus)
239 -DENABLE_DVDCSS=$(usex css)
240 -DENABLE_INTERNAL_CROSSGUID=OFF
241 -DENABLE_INTERNAL_FFMPEG="$(usex !system-ffmpeg)"
242 -DENABLE_INTERNAL_FSTRCMP=OFF
243 -DENABLE_CAP=$(usex caps)
244 -DENABLE_LCMS2=$(usex lcms)
245 -DENABLE_LIRCCLIENT=$(usex lirc)
246 -DENABLE_MARIADBCLIENT=$(usex mariadb)
247 -DENABLE_MICROHTTPD=$(usex webserver)
248 -DENABLE_MYSQLCLIENT=$(usex mysql)
249 -DENABLE_NFS=$(usex nfs)
250 -DENABLE_OPENGLES=$(usex gles)
251 -DENABLE_OPENGL=$(usex opengl)
252 -DENABLE_OPTICAL=$(usex dvd)
253 -DENABLE_PLIST=$(usex airplay)
254 -DENABLE_PULSEAUDIO=$(usex pulseaudio)
255 -DENABLE_SMBCLIENT=$(usex samba)
256 -DENABLE_UDEV=$(usex udev)
257 -DENABLE_UPNP=$(usex upnp)
258 -DENABLE_VAAPI=$(usex vaapi)
259 -DENABLE_VDPAU=$(usex vdpau)
260 -DENABLE_XSLT=$(usex xslt)
261 -Dlibdvdread_URL="${DISTDIR}/libdvdread-${LIBDVDREAD_VERSION}.tar.gz"
262 -Dlibdvdnav_URL="${DISTDIR}/libdvdnav-${LIBDVDNAV_VERSION}.tar.gz"
263 -Dlibdvdcss_URL="${DISTDIR}/libdvdcss-${LIBDVDCSS_VERSION}.tar.gz"
266 use libusb && mycmakeargs+=( -DENABLE_LIBUSB=$(usex libusb) )
268 if use system-ffmpeg; then
269 mycmakeargs+=( -DWITH_FFMPEG="yes" )
271 mycmakeargs+=( -DFFMPEG_URL="${DISTDIR}/ffmpeg-${PN}-${FFMPEG_VERSION}-${CODENAME}-${FFMPEG_KODI_VERSION}.tar.gz" )
276 -DCORE_PLATFORM_NAME="gbm"
277 -DGBM_RENDER_SYSTEM="$(usex opengl gl gles)"
283 -DCORE_PLATFORM_NAME="wayland"
284 -DWAYLAND_RENDER_SYSTEM="$(usex opengl gl gles)"
288 if use raspberry-pi; then
289 mycmakeargs+=( -DCORE_PLATFORM_NAME="rbpi" )
293 mycmakeargs+=( -DCORE_PLATFORM_NAME="x11" )
300 cmake_src_compile all
310 pax-mark Em "${ED}"/usr/$(get_libdir)/${PN}/${PN}.bin
312 newicon media/icon48x48.png kodi.png
314 rm "${ED}"/usr/share/kodi/addons/skin.estuary/fonts/Roboto-Thin.ttf || die
315 dosym ../../../../fonts/roboto/Roboto-Thin.ttf \
316 usr/share/kodi/addons/skin.estuary/fonts/Roboto-Thin.ttf
318 python_domodule tools/EventClients/lib/python/xbmcclient.py
319 python_newscript "tools/EventClients/Clients/KodiSend/kodi-send.py" kodi-send