#!/bin/sh if [ "$(id -u)" = "0" ]; then case $(cat /etc/kanotix-version 2>/dev/null) in *Excalibur*) wget -NP /etc/apt http://kanotix.com/files/excalibur/sources.list echo deb http://kanotix.com/files/fix/vlc.lenny ./ > /etc/apt/sources.list.d/vlc.list echo deb-src http://kanotix.com/files/fix/vlc.lenny ./ >> /etc/apt/sources.list.d/vlc.list case $(kde4-config -v 2>/dev/null) in *"Qt: 4.5"*) echo deb http://www.debian-desktop.org/pub/linux/debian/kde43 lenny-backports main contrib non-free > /etc/apt/sources.list.d/kde4.list echo deb-src http://www.debian-desktop.org/pub/linux/debian/kde43 lenny-backports main contrib non-free >> /etc/apt/sources.list.d/kde4.list ;; esac ;; *Hellfire*) wget -NP /etc/apt http://kanotix.com/files/hellfire/sources.list ;; esac grep -q lh_chroot_apt /etc/apt/preferences 2>/dev/null && rm -f /etc/apt/preferences echo "Installing depends..." >&2 export DEBIAN_FRONTEND=noninteractive apt-get update apt-get --allow-unauthenticated --yes build-dep vlc apt-get --allow-unauthenticated --yes install automake autotools-dev libdrm-dev liblua5.1-0-dev libqt4-dev libtool libx11-xcb-dev libxcb-shm0-dev libxcb-xv0-dev libxcb-composite0-dev lua5.1 patchutils python-dev time yasm #apt-get --allow-unauthenticated --yes install libvpx-dev apt-get --allow-unauthenticated --yes install libvdpau-dev apt-get --allow-unauthenticated --yes install libspeexdsp-dev apt-get --yes remove --purge $(dpkg -l|awk '/vlc/{print $2}') echo "Hint: Run as user to compile/build/install in the home!" >&2 exit 1 fi target=$HOME/dist mkdir -p $target/src if ! grep -qs $target/bin $HOME/.bashrc; then echo "export PATH=$target/bin:$PATH" >> $HOME/.bashrc export PATH=$target/bin:$PATH fi if ! grep -qs $target/lib $HOME/.bashrc; then echo "export LD_LIBRARY_PATH=$target/lib" >> $HOME/.bashrc export LD_LIBRARY_PATH=$target/lib fi if ! grep VERSION_STR /usr/include/alsa/version.h 2>/dev/null|awk {'print $3'}|sed 's/"//g'|grep -q 1.0.2[4-9]; then cd $target/src alsa_ver=1.0.24.1 rm -rf alsa-lib-* wget -N ftp://ftp.alsa-project.org/pub/lib/alsa-lib-$alsa_ver.tar.bz2 #wget -N http://alsa.cybermirror.org/lib/alsa-lib-$alsa_ver.tar.bz2 tar jxf alsa-lib-$alsa_ver.tar.bz2 cd alsa-lib-$alsa_ver ./configure --prefix=$target time make -j`grep -c ^processor /proc/cpuinfo 2>/dev/null||echo 1` make install alsa_plugins_ver=1.0.24 rm -rf alsa-plugins-* wget -N ftp://ftp.alsa-project.org/pub/plugins/alsa-plugins-$alsa_plugins_ver.tar.bz2 tar jxf alsa-plugins-$alsa_plugins_ver.tar.bz2 cd alsa-plugins-$alsa_plugins_ver ./configure --prefix=$target time make -j`grep -c ^processor /proc/cpuinfo 2>/dev/null||echo 1` make install fi if true; then cd $target/src rm -rf live* wget -N http://live555.com/liveMedia/public/live555-latest.tar.gz tar zxf live555-latest.tar.gz cd live if [ "$(uname -m)" = "x86_64" ]; then ./genMakefiles linux-64bit else ./genMakefiles linux fi time make -j`grep -c ^processor /proc/cpuinfo 2>/dev/null||echo 1` cd .. rm -rf $target/lib/live mkdir -p $target/lib mv -v live $target/lib fi if true; then cd $target/src ebml_ver=1.2.2 rm -rf libebml* wget -N http://dl.matroska.net/downloads/libebml/libebml-$ebml_ver.tar.bz2 tar jxf libebml-$ebml_ver.tar.bz2 cd libebml-$ebml_ver time make -j`grep -c ^processor /proc/cpuinfo 2>/dev/null||echo 1` -C make/linux make -C make/linux prefix=$target install fi if true; then cd $target/src rm -rf libmatroska* matroska_ver=1.3.0 wget -N http://dl.matroska.net/downloads/libmatroska/libmatroska-$matroska_ver.tar.bz2 tar jxf libmatroska-$matroska_ver.tar.bz2 cd libmatroska-$matroska_ver LDFLAGS=-L$target/lib CPPFLAGS=-I$target/include time make -j`grep -c ^processor /proc/cpuinfo 2>/dev/null||echo 1` -C make/linux make -C make/linux prefix=$target install fi if [ ! -r /usr/include/va/va.h ]; then cd $target/src rm -rf libva-* wget -N http://www.splitted-desktop.com/~gbeauchesne/libva/libva-latest.tar.gz tar zxf libva-latest.tar.gz #VER=0.32.0-1+sds2 #wget -N http://www.splitted-desktop.com/~gbeauchesne/libva/libva_$VER.tar.gz #tar zxf libva_$VER.tar.gz cd libva-* for p in debian/patches/*.patch; do patch -p1 < $p; done autoreconf -i ./configure --prefix=$target time make -j`grep -c ^processor /proc/cpuinfo 2>/dev/null||echo 1` make install fi if ! [ -r /usr/lib/va/drivers/nvidia_drv_video.so -o -r /usr/lib/dri/nvidia_drv_video.so ] && [ -r /usr/include/vdpau/vdpau.h ]; then cd $target/src rm -rf vdpau-video-* wget -N http://www.splitted-desktop.com/~gbeauchesne/vdpau-video/vdpau-video-latest.tar.gz tar zxf vdpau-video-latest.tar.gz #VER=0.7.3 #wget -N http://www.splitted-desktop.com/~gbeauchesne/vdpau-video/vdpau-video-$VER.tar.gz #tar zxf vdpau-video-$VER.tar.gz cd vdpau-video-* ./configure --prefix=$target PKG_CONFIG_PATH=$target/lib/pkgconfig time make -j`grep -c ^processor /proc/cpuinfo 2>/dev/null||echo 1` make install fi if ! [ -r /usr/lib/va/drivers/fglrx_drv_video.so -o -r /usr/lib/dri/fglrx_drv_video.so ] && [ -r /usr/lib/libAMDXvBA.so.1.0 -o -r /usr/lib/fglrx/libAMDXvBA.so.1.0 ]; then cd $target/src rm -rf xvba-video-* ARCH=i686 [ "$(uname -m)" = "x86_64" ] && ARCH="x86_64" wget -N http://www.splitted-desktop.com/~gbeauchesne/xvba-video/xvba-video-latest.$ARCH.tar.gz tar zxf xvba-video-latest.$ARCH.tar.gz #VER=0.7.8.pre2 #wget -N http://www.splitted-desktop.com/~gbeauchesne/xvba-video/xvba-video-$VER.$ARCH.tar.gz #tar zxf xvba-video-$VER.$ARCH.tar.gz cd xvba-video-* cp -rv usr/lib $target fi #if [ ! -r /usr/include/vpx/vp8.h ]; then if true; then cd $target/src vpx_ver=0.9.6 rm -rf libvpx* #wget -qO- http://review.webmproject.org/gitweb?p=libvpx.git|awk -F\" '/snapshot/{print $12}'|head -1|wget -i- -Olibvpx.tar.gz -B http://review.webmproject.org #tar zxf libvpx.tar.gz wget -N http://webm.googlecode.com/files/libvpx-v$vpx_ver.tar.bz2 tar jxf libvpx-v$vpx_ver.tar.bz2 cd libvpx-v$vpx_ver #cd libvpx PKG_CONFIG_PATH=$target/lib/pkgconfig ./configure --prefix=$target --enable-shared time make -j`grep -c ^processor /proc/cpuinfo 2>/dev/null||echo 1` make install fi if [ ! -r /usr/include/faac.h ]; then cd $target/src faac_ver=1.28 rm -rf faac-* wget -N http://downloads.sourceforge.net/faac/faac-$faac_ver.tar.bz2 tar jxf faac-$faac_ver.tar.bz2 cd faac-$faac_ver PKG_CONFIG_PATH=$target/lib/pkgconfig ./configure --prefix=$target time make -j`grep -c ^processor /proc/cpuinfo 2>/dev/null||echo 1` make install fi cd $target/src rm -rf x264 x264-* wget -Ox264.tar.gz http://git.videolan.org$(wget -qO- http://git.videolan.org/?p=x264.git|awk -F\" '/snapshot/{print $12}'|head -1) tar zxf x264.tar.gz cd x264* PKG_CONFIG_PATH=$target/lib/pkgconfig ./configure --prefix=$target --enable-shared time make -j`grep -c ^processor /proc/cpuinfo 2>/dev/null||echo 1` make install cd $target/src vorbis_ver=1.3.1 rm -rf libvorbis-* wget -N http://downloads.xiph.org/releases/vorbis/libvorbis-$vorbis_ver.tar.gz tar zxf libvorbis-$vorbis_ver.tar.gz cd libvorbis-$vorbis_ver ./configure --prefix=$target PKG_CONFIG_PATH=$target/lib/pkgconfig time make -j`grep -c ^processor /proc/cpuinfo 2>/dev/null||echo 1` make install cd $target/src #if ping -c1 ffmpeg.org >/dev/null 2>&1; then # rm -rf ffmpeg* # wget -Offmpeg.tar.gz "http://git.ffmpeg.org/?p=ffmpeg.git;a=snapshot;h=HEAD;sf=tgz" # tar zxf ffmpeg.tar.gz # wget -O ffmpeg.vaapi.mpeg4.bframes.patch http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100413/79f5efee/attachment-0001.obj # wget -O ffmpeg.vaapi.gma500.mpeg4.bframes.patch http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100413/79f5efee/attachment.obj # cd ffmpeg-* rm -rf libav* rm -rf ffmpeg* wget -N http://kanotix.com/files/fix/ffmpeg.vaapi/ffmpeg.vaapi.mpeg4.bframes.patch wget -N http://kanotix.com/files/fix/ffmpeg.vaapi/ffmpeg.vaapi.gma500.mpeg4.bframes.patch if ping -c1 libav.or1g >/dev/null 2>&1; then #wget -O libav.tar.gz "http://git.libav.org/?p=libav.git;a=snapshot;h=HEAD;sf=tgz" wget -O libav.tar.gz --no-check-certificate https://github.com/libav/libav/tarball/master tar zxf libav.tar.gz cd libav-* else wget -Offmpeg.tar.gz "http://git.videolan.org/?p=ffmpeg.git;a=snapshot;h=570f6aaab12e2bc;sf=tgz" tar zxf ffmpeg.tar.gz cd ffmpeg-* fi patch -fp1 < ../ffmpeg.vaapi.mpeg4.bframes.patch patch -p1 < ../ffmpeg.vaapi.gma500.mpeg4.bframes.patch if false; then wget -N http://www.splitted-desktop.com/~gbeauchesne/mplayer-vaapi/mplayer-vaapi-latest.tar.bz2 tar jxf mplayer-vaapi-latest.tar.bz2 cd mplayer-vaapi-* if [ -d patches ]; then filterdiff -i "*libavcodec/*" patches/mplayer-vaapi.patch patches/mplayer-vaapi-gma500-workaround.patch patches/mplayer-vdpau.patch > ../libavcodec-vaapi.patch else filterdiff -i "*libavcodec/*" mplayer-vaapi.patch > ../libavcodec-vaapi.patch fi cd .. rm -rf mplayer-vaapi-* patch -p1 < libavcodec-vaapi.patch fi opts="--enable-postproc --enable-gpl" #[ "$(uname -m)" = "x86_64" ] && opts="$opts --enable-shared" opts="$opts --enable-shared" ([ -r /usr/include/lame/lame.h ] && strings /usr/lib/libmp3lame.so.0|grep -q LAME3.98) && opts="$opts --enable-libmp3lame" [ -r /usr/include/xvid.h ] && opts="$opts --enable-libxvid" [ -r /usr/include/opencore-amrnb/interf_dec.h -a -r /usr/include/opencore-amrwb/dec_if.h ] && opts="$opts --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3" [ -r /usr/include/vpx/vp8.h -o -r $target/include/vpx/vp8.h ] && opts="$opts --enable-libvpx" [ -r /usr/include/faac.h -o -r $target/include/faac.h ] && opts="$opts --enable-libfaac --enable-nonfree" PKG_CONFIG_PATH=$target/lib/pkgconfig pkg-config --libs vorbisenc|grep -q lvorbisenc && opts="$opts --enable-libvorbis" PKG_CONFIG_PATH=$target/lib/pkgconfig pkg-config --libs x264|grep -q lx264 && opts="$opts --enable-libx264" PKG_CONFIG_PATH=$target/lib/pkgconfig pkg-config --libs x264|grep -q lpthread && opts="$opts --enable-pthreads" # libva needs --enable-vaapi now opts="$opts --enable-vaapi" ./configure --prefix=$target $opts --extra-ldflags=-L$target/lib --extra-cflags=-I$target/include time make -j`grep -c ^processor /proc/cpuinfo 2>/dev/null||echo 1` make install cd $target/src rm -rf x264 x264-* tar zxf x264.tar.gz cd x264* PKG_CONFIG_PATH=$target/lib/pkgconfig ./configure --prefix=$target --enable-shared time make -j`grep -c ^processor /proc/cpuinfo 2>/dev/null||echo 1` make install cd $target/src rm -rf hwdecode-demos-* wget -N http://www.splitted-desktop.com/static/libva/hwdecode-demos/hwdecode-demos-latest.tar.gz tar zxf hwdecode-demos-latest.tar.gz cd hwdecode-demos-* ./configure --prefix=$target PKG_CONFIG_PATH=$target/lib/pkgconfig time make -j`grep -c ^processor /proc/cpuinfo 2>/dev/null||echo 1` make install cd $target/src rm -rf libmodplug-* wget -N http://switch.dl.sourceforge.net/project/modplug-xmms/libmodplug/0.8.8.1/libmodplug-0.8.8.1.tar.gz tar zxf libmodplug-0.8.8.1.tar.gz cd libmodplug-0.8.8.1 ./configure --prefix=$target PKG_CONFIG_PATH=$target/lib/pkgconfig time make -j`grep -c ^processor /proc/cpuinfo 2>/dev/null||echo 1` make install cd $target/src rm -rf vlc vlc-* case $(automake --version|head -1) in *1.[1-9][1-9]*) #wget -Ovlc.tar.gz $(wget -qO- http://repo.or.cz/w/vlc.git|awk -F\" '/snapshot/{print $10}'|head -1) wget -Ovlc.tar.gz http://git.videolan.org$(wget -qO- http://git.videolan.org/?p=vlc.git|awk -F\" '/snapshot/{print $12}'|head -1) ;; *) wget -Ovlc.tar.gz http://git.videolan.org$(wget -qO- http://git.videolan.org/?p=vlc/vlc-1.1.git|awk -F\" '/snapshot/{print $12}'|head -1) ;; esac tar zxf vlc.tar.gz #wget -N http://kanotix.com/files/fix/vlc-hotfix.diff #wget -N http://kanotix.com/files/fix/vlc-extra-profiles.diff cd vlc* #patch -p1 < ../vlc-hotfix.diff #patch -p1 < ../vlc-extra-profiles.diff wget -qO- "http://git.videolan.org/?p=vlc.git;a=blobdiff_plain;f=modules/demux/mkv/mkv.hpp;h=664cafac21a05489e77669453d21649a860a11a3;hp=f0e87c68948433e7c48465c1a43ef048731dfcd3;hb=59491dcedffbf97612d2c572943b56ee4289dd07;hpb=f085cfc1c95b922e3c750ee93ec58c3f2d5f7456"|patch -Rp1 # warning: remove if not needed anymore! ./bootstrap sed -i 's/\(__GLIBC_MINOR__ <=\) 7/\1 6/' configure configure.ac sed -i 's|glcv, "2.8"|glcv, "2.7"|' src/misc/linux_specific.c [ -d $target/lib/live ] && live555="--with-live555-tree=$target/lib/live" LDFLAGS=-L$target/lib CPPFLAGS=-I$target/include ./configure --prefix=$target --enable-libva --without-kde-solid PKG_CONFIG_PATH=$target/lib/pkgconfig $live555 # hack needed for latest git touch src/revision.txt time make -j`grep -c ^processor /proc/cpuinfo 2>/dev/null||echo 1` make install mkdir -p ~/Desktop rm -f ~/Desktop/vlc.desktop if [ -f $target/share/applications/vlc.desktop ]; then echo '#!/usr/bin/env xdg-open' > ~/Desktop/vlc.desktop sed 's|\(Icon=\).*|\1'$target'/share/icons/hicolor/48x48/apps/vlc.png|' \ $target/share/applications/vlc.desktop >> ~/Desktop/vlc.desktop if ! grep -q $target/bin ~/Desktop/vlc.desktop; then sed -I 's|\(Exec=\)\(.*\)|\1'$target'/bin/\2|' ~/Desktop/vlc.desktop fi mkdir -p ~/.local/share/applications cp -v ~/Desktop/vlc.desktop ~/.local/share/applications/ chmod 744 ~/Desktop/vlc.desktop fi cat <