1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 # Does not work with py3 here
8 PYTHON_COMPAT=( python2_7 )
9 PYTHON_REQ_USE="sqlite"
11 inherit eutils linux-info python-single-r1 multiprocessing autotools toolchain-funcs
16 EGIT_REPO_URI="git://github.com/xbmc/xbmc.git"
22 SRC_URI="http://mirrors.kodi.tv/releases/source/${MY_PV}-${CODENAME}.tar.gz -> ${P}.tar.gz
23 https://github.com/xbmc/xbmc/archive/${PV}-${CODENAME}.tar.gz -> ${P}.tar.gz
24 !java? ( http://mirrors.kodi.tv/releases/source/${MY_P}-generated-addons.tar.xz )"
25 KEYWORDS="~amd64 ~x86"
27 S=${WORKDIR}/xbmc-${PV}-${CODENAME}
31 DESCRIPTION="Kodi is a free and open source media-player and entertainment hub"
32 HOMEPAGE="http://kodi.tv/ http://kodi.wiki/"
36 IUSE="airplay alsa avahi bluetooth bluray caps cec css dbus debug gles java joystick midi mysql nfs +opengl profile pulseaudio rtmp +samba sftp test +texturepacker udisks upnp upower +usb vaapi vdpau webserver +X"
37 # gles/vaapi: http://trac.kodi.tv/ticket/10552
45 COMMON_DEPEND="${PYTHON_DEPS}
50 airplay? ( app-pda/libplist )
54 dev-libs/libcdio[-minimal]
55 cec? ( >=dev-libs/libcec-3.0 )
62 dev-python/simplejson[${PYTHON_USEDEP}]
65 alsa? ( media-libs/alsa-lib )
71 >=media-libs/libass-0.9.7
72 bluray? ( >=media-libs/libbluray-0.7.0 )
73 css? ( media-libs/libdvdcss )
79 media-libs/libsamplerate
80 joystick? ( media-libs/libsdl2 )
81 >=media-libs/taglib-1.8
85 pulseaudio? ( media-sound/pulseaudio )
87 >=media-video/ffmpeg-2.6:=[encode]
88 rtmp? ( media-video/rtmpdump )
89 avahi? ( net-dns/avahi )
90 nfs? ( net-fs/libnfs:= )
91 webserver? ( net-libs/libmicrohttpd[messages] )
92 sftp? ( net-libs/libssh[sftp] )
94 samba? ( >=net-fs/samba-3.4.6[smbclient(+)] )
95 bluetooth? ( net-wireless/bluez )
96 dbus? ( sys-apps/dbus )
97 caps? ( sys-libs/libcap )
100 usb? ( virtual/libusb:1 )
101 mysql? ( virtual/mysql )
105 >=media-libs/glew-1.5.6
108 media-libs/mesa[gles2]
110 vaapi? ( x11-libs/libva[opengl] )
112 || ( >=x11-libs/libvdpau-1.1 >=x11-drivers/nvidia-drivers-180.51 )
113 media-video/ffmpeg[vdpau]
122 RDEPEND="${COMMON_DEPEND}
124 udisks? ( sys-fs/udisks:0 )
125 upower? ( || ( sys-power/upower sys-power/upower-pm-utils ) )"
126 DEPEND="${COMMON_DEPEND}
131 texturepacker? ( media-libs/giflib )
132 X? ( x11-proto/xineramaproto )
134 x86? ( dev-lang/nasm )
135 java? ( virtual/jre )
136 test? ( dev-cpp/gtest )
138 # Force java for latest git version to avoid having to hand maintain the
139 # generated addons package. #488118
140 [[ ${PV} == "9999" ]] && DEPEND+=" virtual/jre"
142 CONFIG_CHECK="~IP_MULTICAST"
144 In some cases Kodi needs to access multicast addresses.
145 Please consider enabling IP_MULTICAST under Networking options.
150 python-single-r1_pkg_setup
154 [[ ${PV} == "9999" ]] && git-r3_src_unpack || default
158 epatch "${FILESDIR}"/${PN}-9999-no-arm-flags.patch #400617
159 epatch "${FILESDIR}"/${PN}-9999-texturepacker.patch
162 # some dirs ship generated autotools, some dont
165 tools/depends/native/TexturePacker/src/configure
166 $(printf 'f:\n\t@echo $(BOOTSTRAP_TARGETS)\ninclude bootstrap.mk\n' | emake -f - f)
168 for d in "${dirs[@]}" ; do
169 [[ -e ${d} ]] && continue
170 pushd ${d/%configure/.} >/dev/null || die
171 AT_NOELIBTOOLIZE="yes" AT_TOPLEVEL_EAUTORECONF="yes" \
172 multijob_child_init eautoreconf
178 if [[ ${PV} == "9999" ]] || use java ; then #558798
179 tc-env_build emake -f codegenerator.mk
182 # Disable internal func checks as our USE/DEPEND
183 # stuff handles this just fine already #408395
184 export ac_cv_lib_avcodec_ff_vdpau_vc1_decode_picture=yes
186 # Fix the final version string showing as "exported"
187 # instead of the SVN revision number.
188 export HAVE_GIT=no GIT_REV=${EGIT_VERSION:-exported}
190 # avoid long delays when powerkit isn't running #348580
192 -e '/dbus_connection_send_with_reply_and_block/s:-1:3000:' \
193 xbmc/linux/*.cpp || die
195 # Tweak autotool timestamps to avoid regeneration
196 find . -type f -exec touch -r configure {} +
200 # Disable documentation generation
201 export ac_cv_path_LATEX=no
203 export HELP2MAN=$(type -P help2man || echo true)
204 # No configure flage for this #403561
205 export ac_cv_lib_bluetooth_hci_devid=$(usex bluetooth)
206 # Requiring java is asine #434662
207 [[ ${PV} != "9999" ]] && export ac_cv_path_JAVA_EXE=$(which $(usex java java true))
210 --docdir=/usr/share/doc/${PF} \
212 --disable-optimizations \
213 --with-ffmpeg=shared \
215 $(use_enable airplay) \
216 $(use_enable avahi) \
217 $(use_enable bluray libbluray) \
218 $(use_enable caps libcap) \
219 $(use_enable cec libcec) \
220 $(use_enable css dvdcss) \
222 $(use_enable debug) \
224 $(use_enable joystick) \
225 $(use_enable midi mid) \
226 $(use_enable mysql) \
228 $(use_enable opengl gl) \
229 $(use_enable profile profiling) \
230 $(use_enable pulseaudio pulse) \
232 $(use_enable samba) \
233 $(use_enable sftp ssh) \
234 $(use_enable usb libusb) \
235 $(use_enable test gtest) \
236 $(use_enable texturepacker) \
238 $(use_enable vaapi) \
239 $(use_enable vdpau) \
240 $(use_enable webserver) \
250 rm "${ED}"/usr/share/doc/*/{LICENSE.GPL,copying.txt}* || die
252 domenu tools/Linux/kodi.desktop
253 newicon media/icon48x48.png kodi.png
255 # Remove fonconfig settings that are used only on MacOSX.
256 # Can't be patched upstream because they just find all files and install
257 # them into same structure like they have in git.
258 rm -rf "${ED}"/usr/share/kodi/system/players/dvdplayer/etc
260 # Replace bundled fonts with system ones.
261 rm "${ED}"/usr/share/kodi/addons/skin.confluence/fonts/Roboto-* || die
262 dosym /usr/share/fonts/roboto/Roboto-Regular.ttf \
263 /usr/share/kodi/addons/skin.confluence/fonts/Roboto-Regular.ttf
264 dosym /usr/share/fonts/roboto/Roboto-Bold.ttf \
265 /usr/share/kodi/addons/skin.confluence/fonts/Roboto-Bold.ttf
267 python_domodule tools/EventClients/lib/python/xbmcclient.py
268 python_newscript "tools/EventClients/Clients/Kodi Send/kodi-send.py" kodi-send