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 python-single-r1 multiprocessing autotools
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 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 avahi bluetooth bluray caps cec css debug +fishbmc gles goom java joystick midi mysql nfs +opengl profile +projectm pulseaudio pvr +rsxs rtmp +samba sdl sftp test +texturepacker udisks upnp upower +usb vaapi vdpau webserver +X +xrandr"
44 COMMON_DEPEND="${PYTHON_DEPS}
49 airplay? ( app-pda/libplist )
53 dev-libs/libcdio[-minimal]
54 cec? ( >=dev-libs/libcec-2.2 )
61 dev-python/simplejson[${PYTHON_USEDEP}]
68 >=media-libs/glew-1.5.6
71 >=media-libs/libass-0.9.7
72 bluray? ( media-libs/libbluray )
73 css? ( media-libs/libdvdcss )
79 projectm? ( media-libs/libprojectm )
80 media-libs/libsamplerate
81 sdl? ( media-libs/libsdl2 )
82 >=media-libs/taglib-1.8
85 pulseaudio? ( media-sound/pulseaudio )
87 >=media-video/ffmpeg-2.4:=[encode]
88 rtmp? ( media-video/rtmpdump )
89 avahi? ( net-dns/avahi )
90 nfs? ( net-fs/libnfs )
91 net-libs/libmicrohttpd[messages]
92 sftp? ( net-libs/libssh[sftp] )
94 samba? ( >=net-fs/samba-3.4.6[smbclient(+)] )
95 bluetooth? ( net-wireless/bluez )
97 caps? ( sys-libs/libcap )
100 usb? ( virtual/libusb )
101 mysql? ( virtual/mysql )
108 media-libs/mesa[gles2]
110 vaapi? ( x11-libs/libva[opengl] )
112 || ( x11-libs/libvdpau >=x11-drivers/nvidia-drivers-180.51 )
113 media-video/ffmpeg[vdpau]
119 xrandr? ( x11-libs/libXrandr )
122 RDEPEND="${COMMON_DEPEND}
124 udisks? ( sys-fs/udisks:0 )
125 upower? ( || ( sys-power/upower sys-power/upower-pm-utils ) )"
126 DEPEND="${COMMON_DEPEND}
134 sdl? ( media-libs/sdl-image )
135 X? ( x11-proto/xineramaproto )
137 x86? ( dev-lang/nasm )
138 java? ( virtual/jre )
139 test? ( dev-cpp/gtest )"
140 # Force java for latest git version to avoid having to hand maintain the
141 # generated addons package. #488118
142 [[ ${PV} == "9999" ]] && DEPEND+=" virtual/jre"
145 python-single-r1_pkg_setup
149 [[ ${PV} == "9999" ]] && git-2_src_unpack || default
153 epatch "${FILESDIR}"/${PN}-9999-nomythtv.patch
154 epatch "${FILESDIR}"/${P}-no-arm-flags.patch #400617
155 epatch "${FILESDIR}"/${PN}-14.0-dvddemux-ffmpeg.patch #526992#36
156 epatch "${FILESDIR}"/${P}-gcc-5.patch #557300
159 # The mythtv patch touches configure.ac, so force a regen
162 # some dirs ship generated autotools, some dont
165 for d in $(printf 'f:\n\t@echo $(BOOTSTRAP_TARGETS)\ninclude bootstrap.mk\n' | emake -f - f) ; 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 [[ ${PV} == "9999" ]] && emake -f codegenerator.mk
177 # Disable internal func checks as our USE/DEPEND
178 # stuff handles this just fine already #408395
179 export ac_cv_lib_avcodec_ff_vdpau_vc1_decode_picture=yes
181 # Fix the final version string showing as "exported"
182 # instead of the SVN revision number.
183 export HAVE_GIT=no GIT_REV=${EGIT_VERSION:-exported}
185 # avoid long delays when powerkit isn't running #348580
187 -e '/dbus_connection_send_with_reply_and_block/s:-1:3000:' \
188 xbmc/linux/*.cpp || die
190 # Tweak autotool timestamps to avoid regeneration
191 find . -type f -exec touch -r configure {} +
195 # Disable documentation generation
196 export ac_cv_path_LATEX=no
198 export HELP2MAN=$(type -P help2man || echo true)
199 # No configure flage for this #403561
200 export ac_cv_lib_bluetooth_hci_devid=$(usex bluetooth)
201 # Requiring java is asine #434662
202 [[ ${PV} != "9999" ]] && export ac_cv_path_JAVA_EXE=$(which $(usex java java true))
205 --docdir=/usr/share/doc/${PF} \
207 --disable-optimizations \
208 --with-ffmpeg=shared \
209 $(use_enable airplay) \
210 $(use_enable avahi) \
211 $(use_enable bluray libbluray) \
212 $(use_enable caps libcap) \
213 $(use_enable cec libcec) \
214 $(use_enable css dvdcss) \
215 $(use_enable debug) \
216 $(use_enable fishbmc) \
219 $(use_enable joystick) \
220 $(use_enable midi mid) \
221 $(use_enable mysql) \
223 $(use_enable opengl gl) \
224 $(use_enable profile profiling) \
225 $(use_enable projectm) \
226 $(use_enable pulseaudio pulse) \
227 $(use_enable pvr mythtv) \
230 $(use_enable samba) \
232 $(use_enable sftp ssh) \
233 $(use_enable usb libusb) \
234 $(use_enable test gtest) \
235 $(use_enable texturepacker) \
237 $(use_enable vaapi) \
238 $(use_enable vdpau) \
239 $(use_enable webserver) \
240 $(use_enable X x11) \
246 rm "${ED}"/usr/share/doc/*/{LICENSE.GPL,copying.txt}*
248 domenu tools/Linux/kodi.desktop
249 newicon media/icon48x48.png kodi.png
251 # Remove optional addons (platform specific and disabled by USE flag).
252 local disabled_addons=(
253 repository.pvr-{android,ios,osx{32,64},win32}.xbmc.org
254 visualization.dxspectrum
256 use fishbmc || disabled_addons+=( visualization.fishbmc )
257 use projectm || disabled_addons+=( visualization.{milkdrop,projectm} )
258 use rsxs || disabled_addons+=( screensaver.rsxs.{euphoria,plasma,solarwinds} )
259 rm -rf "${disabled_addons[@]/#/${ED}/usr/share/kodi/addons/}"
261 # Remove fonconfig settings that are used only on MacOSX.
262 # Can't be patched upstream because they just find all files and install
263 # them into same structure like they have in git.
264 rm -rf "${ED}"/usr/share/kodi/system/players/dvdplayer/etc
266 # Replace bundled fonts with system ones
267 # teletext.ttf: unknown
268 # bold-caps.ttf: unknown
269 # roboto: roboto-bold, roboto-regular
270 # arial.ttf: font mashed from droid/roboto, not removed wrt bug#460514
271 rm -rf "${ED}"/usr/share/kodi/addons/skin.confluence/fonts/Roboto-*
272 dosym /usr/share/fonts/roboto/Roboto-Regular.ttf \
273 /usr/share/kodi/addons/skin.confluence/fonts/Roboto-Regular.ttf
274 dosym /usr/share/fonts/roboto/Roboto-Bold.ttf \
275 /usr/share/kodi/addons/skin.confluence/fonts/Roboto-Bold.ttf
277 python_domodule tools/EventClients/lib/python/xbmcclient.py
278 python_newscript "tools/EventClients/Clients/Kodi Send/kodi-send.py" kodi-send