Friday, December 26, 2008

XBMC on Gentoo

Lately I have been a little obsessed with multimedia software. I have been trying out several different media center packages to see what each has to offer, and whats good/bad/ugly about each.

The most recent package I am trying out now is XBMC (xbox media center). I think this was originally developed for the 1st gen xbox console to turn it into a powerful media center. It has since been modified and adapted for multi platform (Linux, Win, OS X, Xbox etc). It has a lot to offer, but this write up is concerned mainly with getting it running on Gentoo, and not a review of the software itself.

The linux ports are geared toward ubuntu, but there is now an ebuild for gentoo, and (of course), the source is also readily available for anyone to check out and build on their own. One of the nice things about gentoo is its ability to track and emerge dependencies automatically, so I decided to give the ebuild a shot. Here's what I did (your system and experience may vary)

1. If you do not already have a portage overlay dir, you will need to create one. This is where you will store the ebuild file and patches for your system to use and keep separate from its "proper" portage dirs:

# mkdir -p /usr/local/overlay # make this dir as your primary overlay. You can place other packages here for testing.
# mkdir -p /usr/local/overlay/media-tv/xbmc/files # I chose to use media-tv, but you could use another approved component type.

2. Next, grab the latest ebuild file and patches. They are listed and available from the gentoo bugzilla page for the ebuild request (http://bugs.gentoo.org/198849).

# wget -O /usr/local/overlay/media-tv/xbmc/xbmc-8.10-r4.ebuild http://bugs.gentoo.org/attachment.cgi?id=176341
# wget -O /usr/local/overlay/media-tv/xbmc/files/xbmc.readsector.patch http://bugs.gentoo.org/attachment.cgi?id=176344

3. Make sure you have the PORTDIR_OVERLAY environment variable set in your make.conf:

# echo 'PORTDIR_OVERLAY="/usr/local/overlay"' >> /etc/make.conf

4. Next, update your ebuild manifest:

# ebuild /usr/local/overlay/media-tv/xbmc/xbmc-8.10-r4.ebuild digest
>>> Downloading 'http://ufpr.dl.sourceforge.net/sourceforge/xbmc/XBMC-8.10.src.tar.gz'
--2008-12-26 20:51:00-- http://ufpr.dl.sourceforge.net/sourceforge/xbmc/XBMC-8.10.src.tar.gz
Resolving ufpr.dl.sourceforge.net... 200.17.202.1, 200.236.31.1
Connecting to ufpr.dl.sourceforge.net|200.17.202.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 121992403 (116M) [application/x-gzip]
Saving to: `/usr/portage/distfiles/XBMC-8.10.src.tar.gz'

100%[==================================================================>] 121,992,403 710K/s in 2m 51s

2008-12-26 20:53:53 (697 KB/s) - `/usr/portage/distfiles/XBMC-8.10.src.tar.gz' saved [121992403/121992403]

>>> Creating Manifest for /usr/local/overlay/media-tv/xbmc

5. Next, add xbmc to package.keywords, since gentoo will see it as a masked package:
# echo "media-tv/xbmc **" >> /etc/portage/package.keywords

6. Finally, emerge xbmc

# emerge -av xbmc
My system emerged 15 packages total, and everything compiled just fine. I now have a working xbmc install on my Gentoo machine, and am poking at all the features and stuff now. So far it looks pretty slick!

4 comments:

  1. Thank you for the helpful copy+pastable instructions. I had to switch to Gentoo on my HTPC to accomodate the newest ALSA drivers, and this post has saved me a great deal of time.

    ReplyDelete
  2. Cool, Im glad it was helpful for you too! Thanks.

    ReplyDelete
  3. Thanks, it was quite helpful for me as well :).

    ReplyDelete