1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 # Does not work with py3 here
8 # It might work with py:2.5 but I didn't test that
9 PYTHON_COMPAT=( python2_7 )
10 PYTHON_REQ_USE="sqlite"
12 inherit eutils linux-info python-single-r1 multiprocessing autotools toolchain-funcs
17 EGIT_REPO_URI="git://github.com/xbmc/xbmc.git"
23 SRC_URI="http://mirrors.kodi.tv/releases/source/${MY_PV}-${CODENAME}.tar.gz -> ${P}.tar.gz
24 https://github.com/xbmc/xbmc/archive/${PV}-${CODENAME}.tar.gz -> ${P}.tar.gz
25 !java? ( http://mirrors.kodi.tv/releases/source/${MY_P}-generated-addons.tar.xz )"
26 KEYWORDS="~amd64 ~x86"
28 S=${WORKDIR}/xbmc-${PV}-${CODENAME}
32 DESCRIPTION="Kodi is a free and open source media-player and entertainment hub"
33 HOMEPAGE="http://kodi.tv/ http://kodi.wiki/"
37 IUSE="airplay alsa avahi bluetooth bluray caps cec css dbus debug +fishbmc gles goom java joystick midi mysql nfs +opengl profile +projectm pulseaudio +rsxs rtmp +samba sftp +spectrum test +texturepacker udisks upnp upower +usb vaapi vdpau +waveform webserver +X"
44 COMMON_DEPEND="${PYTHON_DEPS}
49 airplay? ( app-pda/libplist )
53 dev-libs/libcdio[-minimal]
54 cec? ( >=dev-libs/libcec-3.0 )
61 dev-python/simplejson[${PYTHON_USEDEP}]
64 alsa? ( media-libs/alsa-lib )
70 >=media-libs/libass-0.9.7
71 bluray? ( media-libs/libbluray )
72 css? ( media-libs/libdvdcss )
78 projectm? ( media-libs/libprojectm )
79 media-libs/libsamplerate
80 joystick? ( media-libs/libsdl2 )
81 >=media-libs/taglib-1.8
84 pulseaudio? ( media-sound/pulseaudio )
86 >=media-video/ffmpeg-2.6:=[encode]
87 rtmp? ( media-video/rtmpdump )
88 avahi? ( net-dns/avahi )
89 nfs? ( net-fs/libnfs:= )
90 webserver? ( net-libs/libmicrohttpd[messages] )
91 sftp? ( net-libs/libssh[sftp] )
93 samba? ( >=net-fs/samba-3.4.6[smbclient(+)] )
94 bluetooth? ( net-wireless/bluez )
95 dbus? ( sys-apps/dbus )
96 caps? ( sys-libs/libcap )
99 usb? ( virtual/libusb:1 )
100 mysql? ( virtual/mysql )
104 >=media-libs/glew-1.5.6
107 media-libs/mesa[gles2]
109 vaapi? ( x11-libs/libva[opengl] )
111 || ( x11-libs/libvdpau >=x11-drivers/nvidia-drivers-180.51 )
112 media-video/ffmpeg[vdpau]
121 RDEPEND="${COMMON_DEPEND}
123 udisks? ( sys-fs/udisks:0 )
124 upower? ( || ( sys-power/upower sys-power/upower-pm-utils ) )"
125 DEPEND="${COMMON_DEPEND}
129 texturepacker? ( media-libs/giflib )
130 X? ( x11-proto/xineramaproto )
132 x86? ( dev-lang/nasm )
133 java? ( virtual/jre )
134 test? ( dev-cpp/gtest )"
135 # Force java for latest git version to avoid having to hand maintain the
136 # generated addons package. #488118
137 [[ ${PV} == "9999" ]] && DEPEND+=" virtual/jre"
139 CONFIG_CHECK="~IP_MULTICAST"
141 In some cases Kodi needs to access multicast addresses.
142 Please consider enabling IP_MULTICAST under Networking options.
147 python-single-r1_pkg_setup
151 [[ ${PV} == "9999" ]] && git-r3_src_unpack || default
155 epatch "${FILESDIR}"/${PN}-9999-no-arm-flags.patch #400617
156 epatch "${FILESDIR}"/${PN}-15.1-texturepacker.patch
159 # some dirs ship generated autotools, some dont
162 tools/depends/native/TexturePacker/src/configure
163 $(printf 'f:\n\t@echo $(BOOTSTRAP_TARGETS)\ninclude bootstrap.mk\n' | emake -f - f)
165 for d in "${dirs[@]}" ; do
166 [[ -e ${d} ]] && continue
167 pushd ${d/%configure/.} >/dev/null || die
168 AT_NOELIBTOOLIZE="yes" AT_TOPLEVEL_EAUTORECONF="yes" \
169 multijob_child_init eautoreconf
175 if [[ ${PV} == "9999" ]] || use java ; then #558798
176 tc-env_build emake -f codegenerator.mk
179 # Disable internal func checks as our USE/DEPEND
180 # stuff handles this just fine already #408395
181 export ac_cv_lib_avcodec_ff_vdpau_vc1_decode_picture=yes
183 # Fix the final version string showing as "exported"
184 # instead of the SVN revision number.
185 export HAVE_GIT=no GIT_REV=${EGIT_VERSION:-exported}
187 # avoid long delays when powerkit isn't running #348580
189 -e '/dbus_connection_send_with_reply_and_block/s:-1:3000:' \
190 xbmc/linux/*.cpp || die
192 # Tweak autotool timestamps to avoid regeneration
193 find . -type f -exec touch -r configure {} +
197 # Disable documentation generation
198 export ac_cv_path_LATEX=no
200 export HELP2MAN=$(type -P help2man || echo true)
201 # No configure flage for this #403561
202 export ac_cv_lib_bluetooth_hci_devid=$(usex bluetooth)
203 # Requiring java is asine #434662
204 [[ ${PV} != "9999" ]] && export ac_cv_path_JAVA_EXE=$(which $(usex java java true))
207 --docdir=/usr/share/doc/${PF} \
209 --disable-optimizations \
210 --with-ffmpeg=shared \
212 $(use_enable airplay) \
213 $(use_enable avahi) \
214 $(use_enable bluray libbluray) \
215 $(use_enable caps libcap) \
216 $(use_enable cec libcec) \
217 $(use_enable css dvdcss) \
219 $(use_enable debug) \
220 $(use_enable fishbmc) \
223 $(use_enable joystick) \
224 $(use_enable midi mid) \
225 $(use_enable mysql) \
227 $(use_enable opengl gl) \
228 $(use_enable profile profiling) \
229 $(use_enable projectm) \
230 $(use_enable pulseaudio pulse) \
233 $(use_enable samba) \
234 $(use_enable sftp ssh) \
235 $(use_enable spectrum) \
236 $(use_enable usb libusb) \
237 $(use_enable test gtest) \
238 $(use_enable texturepacker) \
240 $(use_enable vaapi) \
241 $(use_enable vdpau) \
242 $(use_enable waveform) \
243 $(use_enable webserver) \
253 rm "${ED}"/usr/share/doc/*/{LICENSE.GPL,copying.txt}*
255 domenu tools/Linux/kodi.desktop
256 newicon media/icon48x48.png kodi.png
258 # Remove optional addons (platform specific).
259 local disabled_addons=(
260 repository.pvr-{android,ios,osx{32,64},win32}.xbmc.org
261 visualization.dxspectrum
264 rm -rf "${disabled_addons[@]/#/${ED}/usr/share/kodi/addons/}"
266 # Remove fonconfig settings that are used only on MacOSX.
267 # Can't be patched upstream because they just find all files and install
268 # them into same structure like they have in git.
269 rm -rf "${ED}"/usr/share/kodi/system/players/dvdplayer/etc
271 # Replace bundled fonts with system ones
272 # teletext.ttf: unknown
273 # bold-caps.ttf: unknown
274 # roboto: roboto-bold, roboto-regular
275 # arial.ttf: font mashed from droid/roboto, not removed wrt bug#460514
276 rm -rf "${ED}"/usr/share/kodi/addons/skin.confluence/fonts/Roboto-*
277 dosym /usr/share/fonts/roboto/Roboto-Regular.ttf \
278 /usr/share/kodi/addons/skin.confluence/fonts/Roboto-Regular.ttf
279 dosym /usr/share/fonts/roboto/Roboto-Bold.ttf \
280 /usr/share/kodi/addons/skin.confluence/fonts/Roboto-Bold.ttf
282 python_domodule tools/EventClients/lib/python/xbmcclient.py
283 python_newscript "tools/EventClients/Clients/Kodi Send/kodi-send.py" kodi-send