forked from jackersson/gstreamer-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-gst-python.sh
More file actions
executable file
·40 lines (28 loc) · 1.08 KB
/
build-gst-python.sh
File metadata and controls
executable file
·40 lines (28 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# After PyGObject (https://lazka.github.io/pgi-docs/) installed
# Run current script to override Gstreamer related Scripts
LIBPYTHONPATH=""
PYTHON=${PYTHON:-/usr/bin/python3}
GST_VERSION=${GST_VERSION:-$(gst-launch-1.0 --version | grep version | tr -s ' ' '\n' | tail -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_PREFIX=${GST_PREFIX:-$(dirname $(dirname $(which python)))}
echo "Python Executable: $PYTHON"
echo "Python Library Path: $LIBPYTHONPATH"
echo "Current Python Path $GST_PREFIX"
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 $GST_PREFIX
make
make install
cd ../..
# Clear folder
rm -rf $TEMP_DIR