Linux - HOW-TO Compile XBMC from GIT - Script -

  Thread Rating:
  • 3 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
uNiversal Offline
Out of Memory
Posts: 5,611
Joined: Oct 2012
Reputation: 138
Location: Binary pulsar
Brick  HOW-TO Compile XBMC from GIT - Script -
Post: #1
Hi there people.

I decided to post here for everyone's benefit, a script to compile XBMC from GIT, I found it in the forums but needed updating (mostly dependencies). I have no experience or desire to support the script.

If you use it and find errors in the script logic, let me know what errors or logic and I will try to update it. Support wise, I cannot guaranty any. Sorry! Wink

FIXED:
  • Loads of updates and new/imporved version now in gist @ github.
  • Updated to Gotham depends/removed dead depends

Last Update: Fri Mar 28 06:56:30 GMT 2014

This is released with no warranty of any kind and by using it, you assume responsibility for the benefits and damages to your system.
Most of all, you should backup your system before using it.

Code:
#!/bin/bash
#
echo
echo ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::​::::::'
echo ':::          ___      ___    __                                                   :::'
echo ':::         / _ \    / __\  / _\       |                                          :::'
echo '::         / /_\/   / /     \ \        |:       Git Compile Script gplv2           ::'
echo '::        / /_\\_  / /____  _\ \ _     |:     Backup Your system before use!       ::'
echo ':::       \____(_) \____(_) \__/(_)    |                                          :::'
echo ':::                                                                               :::'
echo ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::​::::::'
echo
echo   @author uNiversal
echo   @date Fri Mar 28 06:56:30 GMT 2014
echo   @version 2.2.4
echo
#

BUILD_DIR="/home/setup"
GIT_DIR="xbmc"
REPO_URL="git://github.com/xbmc/xbmc.git"
LIBNFS_DIR="libnfs"
LIBBLURAY_DIR="lib/libbluray"
BDEPS="automake autopoint build-essential ccache cmake curl unzip yasm zip zlib1g-dev"
DEPS=" bison cvs default-jre fp-compiler gawk gdc gettext git-core gperf libasound2-dev libass-dev libavcodec-dev libavfilter-dev libavformat-dev libavutil-dev libbluetooth-dev libbluray-dev libbluray1 libboost-dev libboost-thread-dev libbz2-dev libcap-dev libcdio-dev libcurl3 libcurl4-gnutls-dev libcurl4-gnutls-dev libcwiid-dev libcwiid1 libdbus-1-dev libenca-dev libflac-dev libfontconfig-dev libfreetype6-dev libfribidi-dev libglew-dev libiso9660-dev libjasper-dev libjpeg-dev libltdl-dev liblzo2-dev libmad0-dev libmicrohttpd-dev libmodplug-dev libmp3lame-dev libmpeg2-4-dev libmpeg3-dev libmysqlclient-dev libnfs-dev libogg-dev libogg-dev libpcre3-dev libplist-dev libpng-dev libpostproc-dev libsamplerate-dev libsdl-dev libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsmbclient-dev libsqlite3-dev libssh-dev libssl-dev libswscale-dev libtinyxml-dev libtool libudev-dev libusb-dev libva-dev libva-egl1 libva-tpi1 libvdpau-dev libvorbisenc2 libxmu-dev libxrandr-dev libxrender-dev libxslt1-dev libxt-dev libyajl-dev mesa-utils nasm pmount python-dev python-imaging python-sqlite swig"
CONFIGOPTS="--enable-nfs --enable-vdpau --enable-libmp3lame --disable-vaapi --disable-pulse --disable-crystalhd"

  if [ "$(id -u)" != "0" ]
    then
        echo "      Error: This script must be run with sudo" 1>&2
        echo "      e.g.   sudo ./gcs.sh" 1>&2
        echo
    exit 1
  fi
  
case $1 in
  "upgrade" )
          stop xbmc
            apt-get update -y -qq
            apt-get install $BDEPS $DEPS -y -q
            mkdir $BUILD_DIR && cd $BUILD_DIR
            git clone $REPO_URL
            cd $BUILD_DIR/$GIT_DIR/
            ## Patches below here ##
            ## Patches end ##
            ./bootstrap && ./configure --prefix=/usr $CONFIGOPTS && make -j4 && make install prefix=/usr
          start xbmc
           ;;
   "update" )
          stop xbmc
            cd $BUILD_DIR/$GIT_DIR/
            git clean -xfd && git reset --hard && git pull --rebase origin master
            # Pull patch
            # Apply patch
            ./bootstrap && ./configure --prefix=/usr $CONFIGOPTS && make -j20 && make install prefix=/usr
          start xbmc
           ;;
   "libnfs" )
           apt-get update -y -qq
           apt-get install $BDEPS -y -qq
           mkdir -p $BUILD_DIR/$LIBNFS_DIR && cd $BUILD_DIR/$LIBNFS_DIR
           wget https://gist.github.com/uNiversaI/8350279/raw -O /home/setup/libnfs/Makefile
           cd /home
           make -C setup/libnfs && make -C setup/libnfs install
           echo
           echo "  **  Compiled and installed libnfs-1.8.0 successfully! You wont need to run ./gcs.sh libnfs command again!"
           echo
           ;;
   "taglib" )
           apt-get update -y -qq
           apt-get install $BDEPS -y -qq
           cd $BUILD_DIR/$GIT_DIR/
           make -C lib/taglib && make -C lib/taglib install ; ldconfig; depmod -a
           echo
           echo "  **  Compiled and installed libtag-1.8 successfully! You wont need to run ./gcs.sh libtag command again!"
           echo
             ;;
"libbluray" )
           apt-get update -y -qq
           apt-get install $BDEPS -y -qq
           rm -rf $BUILD_DIR/$GIT_DIR/$LIBBLURAY_DIR/libbluray
           cd $BUILD_DIR/$GIT_DIR/
           make -C lib/libbluray && make -C lib/libbluray install ; ldconfig; depmod -a
           echo
           echo "  **  Compiled and installed libbluray-2.2 successfully! You wont need to run ./gcs.sh libbluray command again!"
           echo
           ;;
    *       )
           echo
           echo "      Usage: $0 <upgrade / update / libnfs / libtag / libbluray>"
           echo
           echo "      This script uses $REPO_URL (Master official branch)"
           echo "      This should be compatible With Ubuntu and variants like XBMCbuntu etc."
           echo
           echo "  *  upgrade   = Full initial install (setup GIT, build environment (XBMC Master Git repo, compile and install XBMC.)"
           echo "  *  update    = update existing XBMC GIT COMPILE install to up-to-date revision"
           echo "  *  libnfs    = install libnfs - Ubuntu >=12.04 libnfs 1.3.0 or newer is advised, this pulls libnfs-1.8.0.tar.gz and compiles it."
           echo "  *  libtag    = install libtag - Ubuntu >=12.04 libtag 1.8 or newer is advised, this compiles libtag-1.8 in /lib/libtag."
           echo "  *  libbluray = install libbluray - Ubuntu >=12.04 libbluray 0.2.2 or newer is advised, this compiles /lib/libbluray from git master."
           echo
          ;;
      esac

To use you should "NOT" login as root (unless you know what your doing) execute script with sudo

Code:
wget https://gist.github.com/uNiversaI/8961332/raw -O ~/gcs.sh
chmod 755 gcs.sh
sudo ./gcs.sh upgrade (for first run)
     or
sudo ./gcs.sh update (everytime after)
Configure options (list for options you may want to enable or disable on the ./configure line

Default=yes ( meaning that by default this is enabled even if not defined in ./configure)
Default=no ( meaning the opposite of the above )
Default=auto ( meaning if a library is installed and detected it will be enabled otherwise if not detected it is not enabled )
Default is enabled ( meaning the option is enabled Note: usually it is dependent on a library being installed, if it is not, the compile will fail )

Some options dont have either of the yes/no/auto When in doubt look at was being enabled or disabled.
Options that can be enabled can usually also be disabled.

Syntax

--disable-option-checking ignore unrecognised --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]

Options ( A complete list of options are available when running ./configure --help inside the XBMC git directory in this case /home/setup/xbmc )

--enable-shared-lib build libxbmc. helpful for tests (default is no)
--enable-gl enable OpenGL rendering (default is yes)
--enable-vdpau enable VDPAU decoding (default is auto)
--enable-vaapi enable VAAPI decoding (default is auto)
--enable-crystalhd enable CrystalHD decoding (default is auto)
--enable-xrandr enable XRandR support (default is yes)
--enable-goom enable GOOM visualisation (default is no)
--enable-rsxs enable really slick X screensavers (default is yes)
--enable-projectm enable ProjectM visualisation (default is yes)
--enable-ccache enable building with ccache feature (default is auto)
--disable-alsa disable ALSA support (only for linux/freebsd)
--enable-pulse enable PulseAudio support (default is no)
--disable-ssh disable SSH SFTP support (default is enabled)
--enable-rtmp enable RTMP support via librtmp (default is auto)
--disable-samba disable SAMBA support (default is enabled)
--enable-nfs enable NFS support via libnfs (default is auto)
--enable-afpclient enable AFP support via libafpclient (default is auto)
--enable-airplay enable AirPlay support(default is auto)
--enable-airtunes enable AirTunes support(default is auto)
--disable-upnp disable UPnP support (default is enabled)
--enable-ffmpeg-libvorbis enable FFmpeg vorbis encoding (default is no)
--enable-dvdcss enable DVDCSS support (default is yes)
--enable-mid enable MID support (default is no)
--disable-hal disable HAL support (default is enabled if hal and hal-storage is found)
--disable-avahi disable Avahi support (default is enabled if libavahi-common and libavahi-client is found)
--disable-non-free disable componentents with non-compliant licenses
--enable-asap-codec enable ASAP ADPCM support
--disable-mysql disable mysql
--disable-webserver disable webserver
--disable-optical-drive disable optical drive
--enable-libbluray enable libbluray support
--enable-udev enable udev support (default is auto)
--enable-libusb enable libusb support (default is auto)
--enable-libcec enable libcec support (default is auto)
--enable-libmp3lame enable lame mp3 encoder support (default is auto)
--enable-libvorbisenc enable vorbis encoder support (default is auto)
--enable-libcap enable libcap support (default is auto)

Hope these help I have removed some options as to not get people enabling/disabling things that are not clear if their platforms support, if you are not sure consult your platform compile readme.
(This post was last modified: 2014-03-28 09:05 by uNiversal.)
find quote
pumkinut Offline
Posting Freak
Posts: 974
Joined: May 2006
Reputation: 9
Post: #2
Nice, I might give it a go tonight.
find quote
uNiversal Offline
Out of Memory
Posts: 5,611
Joined: Oct 2012
Reputation: 138
Location: Binary pulsar
Post: #3
(2012-10-09 16:13)pumkinut Wrote:  Nice, I might give it a go tonight.

Did it blow up your system or what?

uNi
find quote
pumkinut Offline
Posting Freak
Posts: 974
Joined: May 2006
Reputation: 9
Post: #4
Sorry, never got around to trying it out. It's still something I want to do,it's just that other things keep getting in the way. I'll post back when I give it a go.
find quote
namomaitreya Offline
Junior Member
Posts: 2
Joined: Oct 2012
Reputation: 0
Post: #5
I've run your script in two Ubuntu 12.04 minimal installations (One on VMware Fusion and one on VMware workstation). From what I can tell it does everything perfectly. Once I get a chance I will be using a spare HDD or FDD to install it on my actual HTPC hardware. After running the update install (after the initial upgrade install) I did notice that it said ~ "failed to start xbmcl" instead of ~"failed to start xbmc". I'm befuddled by the addition of the "L" rather than the fact it didn't start. Once I've installed the startup script from the repo it starts on boot just fine. =)

Also, when downloading the script from pastebin it looks as though it is in DOS format rather than Unix. Just ran dos2unix against it and that fixed the notorious ^M.
(This post was last modified: 2012-10-22 20:52 by namomaitreya.)
find quote
namomaitreya Offline
Junior Member
Posts: 2
Joined: Oct 2012
Reputation: 0
Post: #6
First attempt on real hardware. 12.04 Minimal. Installed nvidia driver for my GT430 and xorg. Set script up to run and it seems like it bombs somewhere during the compile. Wiping everything out and attempting a fresh run.
find quote
uNiversal Offline
Out of Memory
Posts: 5,611
Joined: Oct 2012
Reputation: 138
Location: Binary pulsar
Post: #7
@ namomaitreya

If compile fails, pastebin the terminal output, it could be I missed a dependency, wouldn't surprise me either way. no need to reinstall the system again, but ok.

the script starts and stops xbmc for various previous install methods (if you had ANY) e.g xbmc-live or just xbmc-standalone (your bound to see a error like: start: Unknown job: xbmc-live
which can be safely ignored) , on a fresh install all you need is the xbmc upstart/xinit scripts, you wont even need to preinstall xbmc. (its easier for some ppl to have a working install to begin)

uNi
find quote
uNiversal Offline
Out of Memory
Posts: 5,611
Joined: Oct 2012
Reputation: 138
Location: Binary pulsar
Post: #8
Further cleanups done,

I've tested and am using this instead of installing xbmc from ppa with this minimal Ubuntu install CD (12.04 because I prefer LTS) and used Minimal Ubuntu install and XBMC -Script-

I'm using ION1 system and all tweaks like in my signature for perfection.

Hoping the extra info helps.

Testing/Feedback welcome Smile

uNi
find quote
uNiversal Offline
Out of Memory
Posts: 5,611
Joined: Oct 2012
Reputation: 138
Location: Binary pulsar
Post: #9
OMG so many ppl trying this out I cant keep up with the replies....

Please everyone , not all at once eh!

uNi
find quote
roach9 Offline
Senior Member
Posts: 215
Joined: Sep 2012
Reputation: 0
Post: #10
(2012-11-08 01:22)uNiversal Wrote:  OMG so many ppl trying this out I cant keep up with the replies....

Please everyone , not all at once eh!

uNi

Was this sarcasm? There were no posts between your own posts... are you getting PMs?

would this be the method to update nightly builds (minimal Ubuntu)...
find quote
uNiversal Offline
Out of Memory
Posts: 5,611
Joined: Oct 2012
Reputation: 138
Location: Binary pulsar
Post: #11
Yes sarcasm, definitely maybe Wink

This would be A method not THE method of preference (if you understand the difference), I use this (I have other configure parameters but essentially its this) but I never installed any software from a ppa, in this case xbmc.

In your case, stick with the ppa's, it will be "easier" for you. (though you can learn a lot from compiling it requires willingness to research, commitment and dowork() yourself)

Though if you do want to use this feel free, you are 100% in control of what version of xbmc you have, however with great power comes great responsibility (Peter Parker). So if you assume that responsibility feel free to use it. Wink

uNi
find quote
unisubzero Offline
Junior Member
Posts: 2
Joined: May 2010
Reputation: 0
Post: #12
Worked like a charm !!!

Many thanks.

Cheers
find quote
uNiversal Offline
Out of Memory
Posts: 5,611
Joined: Oct 2012
Reputation: 138
Location: Binary pulsar
Post: #13
Excellent. Big Grin

uNi
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,789
Joined: Nov 2011
Reputation: 48
Location: Nantes - France
Post: #14
Hi.

Does your script can be used to compile Frodo on my Ubuntu 12.10 with XBMC Eden installed with ppa ?

Eden won't be overwritten ?

For first compilation, I have to run script with upgrade parameter so script will install a lot of packages :

Code:
aptitude install libvdpau-dev ccache autopoint libltdl-dev git-core build-essential gawk pmount libtool nasm yasm automake cmake gperf zip unzip bison libsdl-dev libsdl-image1.2-dev libsdl-gfx1.2-dev libsdl-mixer1.2-dev libfribidi-dev liblzo2-dev libfreetype6-dev libsqlite3-dev libogg-dev libasound2-dev python-sqlite libglew-dev libcurl3 libcurl4-gnutls-dev libxrandr-dev libxrender-dev libmad0-dev libogg-dev libvorbisenc2 libsmbclient-dev libmysqlclient-dev libpcre3-dev libdbus-1-dev libhal-dev libhal-storage-dev libjasper-dev libfontconfig-dev libbz2-dev libboost-dev libenca-dev libxt-dev libxmu-dev libpng-dev libjpeg-dev mesa-utils libcdio-dev libsamplerate-dev libmpeg3-dev libflac-dev libiso9660-dev libass-dev libssl-dev fp-compiler gdc libmpeg2-4-dev libmicrohttpd-dev libmodplug-dev libssh-dev gettext cvs python-dev libyajl-dev libboost-thread-dev libplist-dev libusb-dev libudev-dev libtinyxml-dev libcap-dev curl swig default-jre libavcodec-dev libavfilter-dev libavformat-dev libavutil-dev libbluetooth-dev libbluray-dev libbluray1 libcec-dev libcec1 libcrystalhd-dev libcrystalhd3 libcurl4-gnutls-dev libcwiid-dev libcwiid1 libnfs-dev libpostproc-dev libshairport-dev libswscale-dev libva-dev libva-egl1 libva-tpi1 libmp3lame-dev -y -q

Won't break Eden dependencies ?

Thanks.

Sorry for my english, but, you know, I'm French so ...

find quote
uNiversal Offline
Out of Memory
Posts: 5,611
Joined: Oct 2012
Reputation: 138
Location: Binary pulsar
Post: #15
It will overwrite Eden, unless you define a different install/configure prefix at configure and make install.

So instead of ./configure --prefix=/usr and make install prefix=/usr define your own paths like --prefix=/usr/local

However having two installs on same system means that you need to start the second manually and shutdown the old one you cant have Eden and frodo running at same time and this doesa not autostart the compiled build automatically IF you CHANGE the location of the installation. To autosatrt this after path is changed look at this http://forum.xbmc.org/showthread.php?tid...pid1260600 and adapt it to your needs...

If you want script to compile XBMC you need to install EVERYTHING in here it, It shouldn't affect Eden but if it does its not because of this.

http://wiki.xbmc.org/index.php?title=XBM...remotes.29

Backup your userdtata just in case.

or better yet, dont use any of this.

uNi
(This post was last modified: 2012-12-11 12:44 by uNiversal.)
find quote
Post Reply