Last active
November 12, 2019 13:44
-
-
Save jackersson/a895c4d859010b05e536c16cb83317c7 to your computer and use it in GitHub Desktop.
install_pygst.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# After PyGObject (https://lazka.github.io/pgi-docs/) installed | |
# > pip install PyGObject | |
# Run current script to override Gstreamer related Scripts | |
LIBPYTHONPATH="" | |
PYTHON=/usr/bin/python3 | |
GST_VERSION=1.14.1 | |
# Ensure pygst to be installed in current environment | |
LIBPYTHON=$($PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_config_var("LDLIBRARY"))') | |
LIBPYTHONPATH=$(dirname $(ldconfig -p | grep -w $LIBPYTHON | head -1 | tr ' ' '\n' | grep /)) | |
GST_VERSION=$(gst-launch-1.0 --version | grep version | tr -s ' ' '\n' | tail -1) | |
PYTHON_LIB=$(dirname $(dirname $(which python))) | |
echo "Python Executable: $PYTHON" | |
echo "Python Library Path: $LIBPYTHONPATH" | |
echo "Current Python Path $PYTHON_LIB" | |
echo "Gstreamer Version: $GST_VERSION" | |
TEMP_DIR="temp" | |
mkdir $TEMP_DIR | |
cd $TEMP_DIR | |
# Build gst-python | |
git clone https://github.com/GStreamer/gst-python.git | |
cd gst-python | |
export PYTHON=$PYTHON | |
git checkout $GST_VERSION | |
./autogen.sh --disable-gtk-doc --noconfigure | |
./configure --with-libpython-dir=$LIBPYTHONPATH --prefix $PYTHON_LIB | |
make | |
make install | |
cd ../.. | |
# Clear folder | |
rm -rf $TEMP_DIR | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment