-
Notifications
You must be signed in to change notification settings - Fork 6
/
configure
executable file
·94 lines (66 loc) · 2.65 KB
/
configure
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/env bash
# Preparation script to build the OpenH264 GStreamer plugin.
#
# This shell script downloads all dependencies and tools needed to build the
# 'gst-plugins-bad' module in a system where the OpenH264 library is installed.
# Doing so has the effect of enabling the generation of an OpenH264 GStreamer
# plugin, during the configuration phase of 'gst-plugins-bad'.
# Shell setup
# -----------
# Bash options for strict error checking
set -o errexit -o errtrace -o pipefail -o nounset
# Trace all commands
set -o xtrace
# Configure Apt
# -------------
# Disable interactive prompts
export DEBIAN_FRONTEND="noninteractive"
# Uncomment system's source repositories.
sed --regexp-extended --in-place \
's/# *(deb-src.*(main|restricted|universe|multiverse))/\1/' \
/etc/apt/sources.list
apt-get update
# Install dependencies
# --------------------
SOURCE_NAME="gst-plugins-bad1.0"
apt-get build-dep --yes "$SOURCE_NAME"
# Build gst-plugins-bad
# ---------------------
apt-get source "$SOURCE_NAME"
cd ./"$SOURCE_NAME"*/
# Quick fix for an error that gstopenh264dec raises when starting to decode,
# about trying to handle and unref a null frame.
# This patch was tested to work with gst-plugins-bad 1.14.5; different versions
# may need adjusting. In that case, maybe it makes sense to keep a different
# patch file for each of the GStreamer versions that we want to support.
patch -R ./ext/openh264/gstopenh264dec.cpp \
../gstreamer_1.14.5_gstopenh264dec.cpp.diff
# Inspect the 'configure.ac' file to obtain the names of all plugins that
# can be enabled or disabled with '--enable-*' and '--disable-*' flags.
NAMES="$(sed -rn 's/^AG_GST_CHECK_FEATURE\((\w+),.*$/\L\1/p' configure.ac)"
# Convert all names into '--disable-*' arguments
ARGS=""
set +o xtrace
for NAME in $NAMES; do
ARGS="$ARGS --disable-${NAME}"
done
set -o xtrace
# Run './configure' with almost everything disabled.
# * '--without-plugins' disables all internal plugins that don't depend on any
# external library.
# * External plugins must be disabled one by one, to end up enabling only the
# one we are interested in, OpenH264.
# It is possible to disable all external plugins with '--disable-external',
# but that would also force disabling the OpenH264 plugin.
export DEB_CONFIGURE_EXTRA_FLAGS=" \
--disable-dependency-tracking \
--disable-examples \
--without-plugins \
$ARGS \
--enable-openh264 \
"
# Also disable hardcoded flag to generate documentation
sed -i 's/--enable-gtk-doc/--disable-gtk-doc/' debian/rules
# Launch the build
# Package construction will fail, but only after having built our file
debuild -b -uc -us --target=install-arch || true