Skip to content

Instantly share code, notes, and snippets.

@tik0
Last active August 31, 2018 12:59
Show Gist options
  • Save tik0/2eef4cfd959acb22658c4d2006a64e38 to your computer and use it in GitHub Desktop.
Save tik0/2eef4cfd959acb22658c4d2006a64e38 to your computer and use it in GitHub Desktop.
Building gstreamer 1.0 from source
#!/bin/bash
echo "You should remove your old installation if it exist (CAUTION: You might damage your system)"
echo "sudo apt-get remove gstreamer1.0* libgstreamer1.0* libgstreamer-plugins-base1.0* libgstreamer-plugins-good1.0* libgstreamer-plugins-bad1.0* libgstreamer-plugins-ugly1.0* libgstreamer1.0-0:i386 libgstreamer1.0-0* libgstreamer-plugins-good1.0-0* libgstreamer-plugins-base1.0-0* libgstreamer1.0-0*"
echo ""
echo "Install some stuff like:"
echo "apt-get install libx264-dev liborc-0.4-dev liborc-0.4-0"
# Run as sudo
if [ $EUID != 0 ]; then
sudo "$0" "$@"
exit $?
fi
V="1.8.3"
P="/usr/share/gstreamer-${V}/"
PROC=2
PC=${P}lib/pkgconfig
export PKG_CONFIG_PATH=${PC}:$PKG_CONFIG_PATH
export GST_PLUGIN_PATH=${P}lib/gstreamer-1.0/:$GST_PLUGIN_PATH
# http://www.linuxfromscratch.org/blfs/view/svn/multimedia/gstreamer10.html
F="gstreamer-${V}"
rm -rf ${F}*
wget http://gstreamer.freedesktop.org/src/gstreamer/${F}.tar.xz
tar -xJf $F.tar.xz
cd $F
./configure --prefix=$P \
--with-package-name="GStreamer ${V} BLFS" \
--with-package-origin="http://www.linuxfromscratch.org/blfs/view/svn/" &&
make -j$PROC
make install
cd ..
# http://www.linuxfromscratch.org/blfs/view/svn/multimedia/gst10-plugins-base.html
F="gst-plugins-base-${V}"
rm -rf ${F}*
wget http://gstreamer.freedesktop.org/src/gst-plugins-base/${F}.tar.xz
tar -xJf $F.tar.xz
cd $F
./configure --prefix=$P \
--with-package-name="GStreamer ${V} BLFS" \
--with-package-origin="http://www.linuxfromscratch.org/blfs/view/svn/" &&
make -j$PROC
make install
cd ..
# http://www.linuxfromscratch.org/blfs/view/svn/multimedia/gst10-plugins-good.html
F="gst-plugins-good-${V}"
rm -rf ${F}*
wget http://gstreamer.freedesktop.org/src/gst-plugins-good/${F}.tar.xz
tar -xJf $F.tar.xz
cd $F
./configure --prefix=$P \
--with-package-name="GStreamer Good Plugins ${V} BLFS" \
--with-package-origin="http://www.linuxfromscratch.org/blfs/view/svn/" &&
make -j$PROC
make install
cd ..
# http://www.linuxfromscratch.org/blfs/view/svn/multimedia/gst10-plugins-bad.html
F="gst-plugins-bad-${V}"
rm -rf ${F}*
wget http://gstreamer.freedesktop.org/src/gst-plugins-bad/${F}.tar.xz
tar -xJf $F.tar.xz
cd $F
./configure --prefix=$P \
--with-package-name="GStreamer Bad Plugins ${V} BLFS" \
--with-package-origin="http://www.linuxfromscratch.org/blfs/view/svn/" &&
make -j$PROC
make install
cd ..
# http://www.linuxfromscratch.org/blfs/view/svn/multimedia/gst10-plugins-ugly.html
F="gst-plugins-ugly-${V}"
rm -rf ${F}*
wget http://gstreamer.freedesktop.org/src/gst-plugins-ugly/${F}.tar.xz
tar -xJf $F.tar.xz
cd $F
./configure --prefix=$P \
--with-package-name="GStreamer Ugly Plugins ${V} BLFS" \
--with-package-origin="http://www.linuxfromscratch.org/blfs/view/svn/" &&
make -j$PROC
make install
cd ..
# http://www.linuxfromscratch.org/blfs/view/svn/multimedia/gst10-libav.html
F="gst-libav-${V}"
rm -rf ${F}*
wget http://gstreamer.freedesktop.org/src/gst-libav/${F}.tar.xz
tar -xJf $F.tar.xz
cd $F
./configure --prefix=$P \
--with-package-name="GStreamer Libav Plugins ${V} BLFS" \
--with-package-origin="http://www.linuxfromscratch.org/blfs/view/svn/" &&
make -j$PROC
make install
cd ..
echo ""
echo "----------------------------------"
echo " -- extend your ~/.bashrc"
echo " -- You have to export, before your compile against this gstreamer version: "
echo "export PKG_CONFIG_PATH_1_0=${PC}:\$PKG_CONFIG_PATH"
echo "export GST_PLUGIN_PATH=${P}lib/gstreamer-1.0/:\$GST_PLUGIN_PATH"
echo "export PATH=${P}bin/:\$PATH"
echo "export MANPATH=${P}share/man/:\$MANPATH"
echo "export LD_LIBRARY_PATH=${P}lib/gstreamer-1.0/:${P}lib/:\$LD_LIBRARY_PATH"
echo "export LIBRARY_PATH=${P}lib/gstreamer-1.0/:${P}lib/:\$LIBRARY_PATH"
for line in $(ls ${P}share/bash-completion/completions/); do
echo "$ source ${P}share/bash-completion/completions/${line}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment