Commit a85c452a authored by Maxime Hadjinlian's avatar Maxime Hadjinlian Committed by Peter Korsgaard
Browse files

xbmc: new package

XBMC is an award-winning free and open source (GPL) software media
player and entertainment hub for digital media.

We do provide a sub-option for each major feature we support, to avoid
letting the user hunt-down required libraries, since the dependency is
not always obvious and straightforward.

We also provide our own wrapper script, because the ones bundled in
XBMC are not suitable to all platforms. We need such a wrapper script
because XBMC exits with different exit codes, depending on how the user
quit XBMC: 0 is normal exit, 64 is for halt, and 66 is for reboot. So
we can't simply call the real XBMC binary from the startup script, or
we would lose this information. So, we provide a wrapper script that
takes appropriate action according to the above exit codes.

When run as root from a startup script, there is no HOME set, so XBMC
defaults to saving its configuration in /.xbmc (yes, at the root of the
rootfs). Since this does not play well with read-only filesystems (and
is inherently ugly anyway), and sicne there is no real clean way to tell
XBMC where to store its configuration, just provide a symlink to a better
place: /.xbmc -> /var/xbmc  (note: the only location _guaranteed_ to be
writable is /tmp, but we want the configuration to survive a reboot. So,
/var/xbmc looks a better place than /var/run/xbmc. and the user will
have to take action to ensure /var/xbmc be writable.) (note: for this
reason, we do not want to set $HOME to /root either, even if it is root
running XBMC.)

Some of XBMC sub-options select libraries that depend on toolchain options,
such as IPv6. But those are already covered, being also implicit
dependencies of XBMC, as XBMC can only be used on an (e)glibc toolchain
anyway. When^WIf XBMC is one day buildable under uClibc/musl, this will be
time to revisit those dependencies.

This package was originally found at : https://github.com/huceke/buildroot-rbp


By gimli <ebsi4711@gmail.com>

Signed-off-by: default avatarMaxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: default avatar"Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: gimli <ebsi4711@gmail.com>
Cc: Martin Bark <martin@barkynet.com>
Signed-off-by: default avatarPeter Korsgaard <peter@korsgaard.com>
parent 6b925f1e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ source "package/tstools/Config.in"
source "package/vlc/Config.in"
source "package/vorbis-tools/Config.in"
source "package/wavpack/Config.in"
source "package/xbmc/Config.in"
source "package/yavta/Config.in"
endmenu

package/xbmc/Config.in

0 → 100644
+161 −0
Original line number Diff line number Diff line
comment "xbmc needs an (e)glibc toolchain w/ C++, threads"
	depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS

comment "xbmc requires an OpenGL ES and EGL backend"
	depends on !BR2_PACKAGE_HAS_OPENGL_EGL || !BR2_PACKAGE_HAS_OPENGL_ES
	depends on BR2_TOOLCHAIN_USES_GLIBC
	depends on BR2_INSTALL_LIBSTDCPP
	depends on BR2_TOOLCHAIN_HAS_THREADS

menuconfig BR2_PACKAGE_XBMC
	bool "xbmc"
	select BR2_HOST_NEEDS_JAVA
	select BR2_PACKAGE_BOOST
	select BR2_PACKAGE_BOOST_THREAD
	select BR2_PACKAGE_BZIP2
	select BR2_PACKAGE_EXPAT
	select BR2_PACKAGE_FLAC
	select BR2_PACKAGE_FONTCONFIG
	select BR2_PACKAGE_FREETYPE
	select BR2_PACKAGE_JASPER
	select BR2_PACKAGE_JPEG
	select BR2_PACKAGE_LIBASS
	select BR2_PACKAGE_LIBCDIO
	select BR2_PACKAGE_LIBCURL
	select BR2_PACKAGE_LIBFRIBIDI
	select BR2_PACKAGE_LIBGCRYPT
	select BR2_PACKAGE_LIBID3TAG
	select BR2_PACKAGE_LIBMAD
	select BR2_PACKAGE_LIBMODPLUG
	select BR2_PACKAGE_LIBMPEG2
	select BR2_PACKAGE_LIBOGG
	select BR2_PACKAGE_LIBPLIST
	select BR2_PACKAGE_LIBPNG
	select BR2_PACKAGE_LIBSAMPLERATE
	select BR2_PACKAGE_LIBUNGIF
	select BR2_PACKAGE_LIBVORBIS
	select BR2_PACKAGE_LIBXML2
	select BR2_PACKAGE_LZO
	select BR2_PACKAGE_NCURSES
	select BR2_PACKAGE_OPENSSL
	select BR2_PACKAGE_PCRE
	select BR2_PACKAGE_PYTHON
	select BR2_PACKAGE_PYTHON_BSDDB
	select BR2_PACKAGE_PYTHON_BZIP2
	select BR2_PACKAGE_PYTHON_CURSES
	select BR2_PACKAGE_PYTHON_PYEXPAT
	select BR2_PACKAGE_PYTHON_READLINE
	select BR2_PACKAGE_PYTHON_SQLITE
	select BR2_PACKAGE_PYTHON_SSL
	select BR2_PACKAGE_PYTHON_UNICODEDATA
	select BR2_PACKAGE_PYTHON_ZLIB
	select BR2_PACKAGE_READLINE
	select BR2_PACKAGE_SQLITE
	select BR2_PACKAGE_TAGLIB
	select BR2_PACKAGE_TIFF
	select BR2_PACKAGE_TINYXML
	select BR2_PACKAGE_YAJL
	select BR2_PACKAGE_ZLIB
	depends on BR2_TOOLCHAIN_USES_GLIBC
	depends on BR2_INSTALL_LIBSTDCPP
	depends on BR2_TOOLCHAIN_HAS_THREADS
	depends on BR2_PACKAGE_HAS_OPENGL_EGL && BR2_PACKAGE_HAS_OPENGL_ES
	help
	  XBMC is an award-winning free and open source (GPL) software
	  media player and entertainment hub for digital media.

	  http://xbmc.org

if BR2_PACKAGE_XBMC

config BR2_PACKAGE_XBMC_AVAHI
	bool "avahi"
	select BR2_PACKAGE_AVAHI
	select BR2_PACKAGE_AVAHI_DAEMON
	help
	  Enable Avahi support.
	  Select this if you want XBMC to support Bonjour protocol.

config BR2_PACKAGE_XBMC_DBUS
	bool "dbus"
	select BR2_PACKAGE_DBUS
	help
	  Enable D-Bus support

config BR2_PACKAGE_XBMC_LIBBLURAY
	bool "blu-ray"
	select BR2_PACKAGE_LIBBLURAY
	help
	  Enable Blu-ray input support.
	  Select this if you want to play back Blu-ray content.

config BR2_PACKAGE_XBMC_LIBCEC
	bool "hdmi cec"
	depends on !BR2_PREFER_STATIC_LIB # libcec
	select BR2_PACKAGE_LIBCEC
	help
	  Enable CEC (Consumer Electronics Control) support.
	  Select this if you want XBMC to support HDMI CEC.

comment "hdmi cec support needs a toolchain w/ dynamic library"
	depends on BR2_PREFER_STATIC_LIB

config BR2_PACKAGE_XBMC_LIBMICROHTTPD
	bool "web server"
	select BR2_PACKAGE_LIBMICROHTTPD
	help
	  Enable webserver feature

config BR2_PACKAGE_XBMC_LIBNFS
	bool "nfs"
	depends on BR2_TOOLCHAIN_HAS_NATIVE_RPC
	select BR2_PACKAGE_LIBNFS
	help
	  Enable NFS server support.

comment "nfs support needs a toolchain w/ RPC support"
	depends on !BR2_TOOLCHAIN_HAS_NATIVE_RPC

config BR2_PACKAGE_XBMC_RTMPDUMP
	bool "rtmp"
	select BR2_PACKAGE_RTMPDUMP
	help
	  Enable RTMP input support.
	  Select this if you want to play back rtmp stream.

config BR2_PACKAGE_XBMC_LIBSHAIRPLAY
	bool "shairport"
	select BR2_PACKAGE_LIBSHAIRPLAY
	help
	  Enable Shairport support.
	  Select this if you want to stream content from an Apple device.

config BR2_PACKAGE_XBMC_LIBSMBCLIENT
	bool "samba"
	select BR2_PACKAGE_SAMBA
	select BR2_PACKAGE_SAMBA_LIBSMBCLIENT
	help
	  Enable Samba support

config BR2_PACKAGE_XBMC_LIBTHEORA
	bool "theora"
	select BR2_PACKAGE_LIBTHEORA
	help
	  Enable Theora input support.
	  Select this if you want to play back OGG/OGV files (Video).

config BR2_PACKAGE_XBMC_LIBUSB
	bool "usb"
	select BR2_PACKAGE_LIBUSB
	select BR2_PACKAGE_LIBUSB_COMPAT
	help
	  Enable libusb support.

config BR2_PACKAGE_XBMC_WAVPACK
	bool "wavpack"
	select BR2_PACKAGE_WAVPACK
	help
	  Enable WAV input support.
	  Select this if you want to play back WV files.

endif

package/xbmc/S50xbmc

0 → 100755
+39 −0
Original line number Diff line number Diff line
#!/bin/sh
#
# Starts XBMC.
#

BIN=/usr/bin/br-xbmc
XBMC=/usr/lib/xbmc/xbmc.bin
XBMC_ARGS="--standalone -fs -n"
PIDFILE=/var/run/xbmc.pid

start() {
	echo -n "Starting XBMC: "
	start-stop-daemon -S -q -b -m -p $PIDFILE --exec $BIN -- $XBMC $XBMC_ARGS
	[ $? == 0 ] && echo "OK" || echo "FAIL"
}
stop() {
	echo -n "Stopping XBMC: "
	start-stop-daemon -K -q -p $PIDFILE
	[ $? == 0 ] && echo "OK" || echo "FAIL"
}
restart() {
	stop
	start
}

case "$1" in
	start)
		start
	;;
	stop)
		stop
	;;
	restart|reload)
		restart
	;;
	*)
		echo "Usage: $0 {start|stop|restart}"
	exit 1
esac

package/xbmc/br-xbmc

0 → 100755
+36 −0
Original line number Diff line number Diff line
#!/bin/sh

# We're called with the real XBMC executable as
# first argument, followed by any XBMC extra args
XBMC="${1}"
shift

# In case someone asked we terminate, just kill
# the XBMC process
trap_kill() {
    LOOP=0
    killall "${XBMC##*/}"
}
trap trap_kill INT QUIT TERM

LOOP=1
while [ ${LOOP} -eq 1 ]; do
    # Hack: Busybox ash does not catch signals while a non-builtin
    # is running, and only catches the signal when the non-builtin
    # command ends. So, we just background the XBMC binary, and wait
    # for it. But Busybox' ash's wait builtin does not return the
    # exit code even if there was only one job (which is correct
    # for POSIX). So we explicitly wait for the XBMC job
    "${XBMC}" "${@}" &
    wait %1
    ret=$?
    case "${ret}" in
        0)  ;;
        64) halt;   LOOP=0;;
        66) reboot; LOOP=0;;
        *)  # Crash
            sleep 1
            ;;
    esac
done
exit ${ret}
+81 −0
Original line number Diff line number Diff line
From 63c255f1f5d68363f49193aceed343e602dc8bdf Mon Sep 17 00:00:00 2001
From: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Date: Thu, 26 Dec 2013 21:17:10 +0100
Subject: [PATCH] Fixup include path

Patch originally taken from :
http://repository.timesys.com/buildsources/x/xbmc/xbmc-11.0/xbmc-11.0-fixups.patch

Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
---
 lib/enca/configure                           | 3 ---
 lib/enca/configure.ac                        | 3 ---
 lib/libdvd/libdvdread/misc/dvdread-config.sh | 6 +++---
 lib/timidity/configure.in                    | 6 +++---
 4 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/lib/enca/configure b/lib/enca/configure
index c839a51..7af5a09 100644
--- a/lib/enca/configure
+++ b/lib/enca/configure
@@ -12011,9 +12011,6 @@ fi
 if test "$prefix" = "NONE"; then
   LDFLAGS="$LDFLAGS -L$ac_default_prefix/lib"
   CPPFLAGS="$CPPFLAGS -I$ac_default_prefix/include"
-else
-  LDFLAGS="$LDFLAGS -L$prefix/lib"
-  CPPFLAGS="$CPPFLAGS -I$prefix/include"
 fi
 
 
diff --git a/lib/enca/configure.ac b/lib/enca/configure.ac
index 41434df..47d5367 100644
--- a/lib/enca/configure.ac
+++ b/lib/enca/configure.ac
@@ -100,9 +100,6 @@ dnl Dirty path hack.  Helps some people with badly set up search paths.
 if test "$prefix" = "NONE"; then
   LDFLAGS="$LDFLAGS -L$ac_default_prefix/lib"
   CPPFLAGS="$CPPFLAGS -I$ac_default_prefix/include"
-else
-  LDFLAGS="$LDFLAGS -L$prefix/lib"
-  CPPFLAGS="$CPPFLAGS -I$prefix/include"
 fi
 
 dnl Checks for libraries.
diff --git a/lib/libdvd/libdvdread/misc/dvdread-config.sh b/lib/libdvd/libdvdread/misc/dvdread-config.sh
index e170c7e..25ee893 100644
--- a/lib/libdvd/libdvdread/misc/dvdread-config.sh
+++ b/lib/libdvd/libdvdread/misc/dvdread-config.sh
@@ -48,9 +48,9 @@ if test "$echo_prefix" = "yes"; then
 fi
 
 if test "$echo_cflags" = "yes"; then
-      echo -I$prefix/include $extracflags
+      echo $extracflags
 fi
 
 if test "$echo_libs" = "yes"; then
-      echo -L$libdir $dvdreadlib
-fi      
+      echo $dvdreadlib
+fi
diff --git a/lib/timidity/configure.in b/lib/timidity/configure.in
index 9f2835b..733470a 100644
--- a/lib/timidity/configure.in
+++ b/lib/timidity/configure.in
@@ -100,9 +100,9 @@ done
 
 # add $prefix if specified.
 if test "x$prefix" != xNONE -a "x$prefix" != "x$ac_default_prefix" -a "x$prefix" != "x/usr"; then
-  LDFLAGS="-L$prefix/lib $LDFLAGS"
-  SHLDFLAGS="-L$prefix/lib $SHLDFLAGS"
-  CPPFLAGS="-I$prefix/include $CPPFLAGS"
+  LDFLAGS="$LDFLAGS"
+  SHLDFLAGS="$SHLDFLAGS"
+  CPPFLAGS="$CPPFLAGS"
 fi
 
 dnl add --with-includes, --with-libraries
-- 
1.8.5.2
Loading