-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·94 lines (87 loc) · 2.99 KB
/
setup.sh
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
#!/bin/bash
# Setup
###############################################################################
ROOTDIR=$PWD
mkdir $ROOTDIR/src
mkdir $ROOTDIR/build
mkdir $ROOTDIR/install
# GStreamer
###############################################################################
GSTREAMER_VERSION="gstreamer-1.0-android-universal-1.20.5"
# Download
wget -P $ROOTDIR/src/gstreamer/ \
https://gstreamer.freedesktop.org/data/pkg/android/1.20.5/$GSTREAMER_VERSION.tar.xz
# Extract
tar -xf $ROOTDIR/src/gstreamer/$GSTREAMER_VERSION.tar.xz -C $ROOTDIR/src/gstreamer/
GSTREAMER_ROOT_ANDROID=$ROOTDIR/src/gstreamer
export GSTREAMER_ROOT_ANDROID=$GSTREAMER_ROOT_ANDROID
# Java
###############################################################################
# Install
if false; then
sudo apt install openjdk-8-jdk
fi
# Define environment variables
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin
# Qt - setup
###############################################################################
# Install prerequisites
# (see https://wiki.qt.io/Building_Qt_5_from_Git)
if false; then
# need a better way to do this...
sudo apt-get install build-essential perl python3 git
sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev \
libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
sudo apt-get install libasound2-dev libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev \
libgstreamer-plugins-bad1.0-dev
fi
# Clone
git clone --branch 5.15.2 --depth 1 \
[email protected]:qt/qt5.git $ROOTDIR/src/qt
cd $ROOTDIR/src/qt
# Only init the submodules we care about
git submodule update --init qtbase
git submodule update --init qtmultimedia
# Qt - qtbase
###############################################################################
# Configure
cd $ROOTDIR/build
$ROOTDIR/src/qt/configure \
-xplatform android-clang \
-gstreamer \
-android-abis arm64-v8a \
-release \
-commercial -confirm-license \
--disable-rpath \
-nomake tests -nomake examples \
-android-ndk ~/Qt/Android/ndk/21.3.6528147/ \
-android-sdk ~/Qt/Android \
-android-ndk-host linux-x86_64 \
-skip qtlottie -skip qtpurchasing \
-no-warnings-are-errors \
-prefix $ROOTDIR/install \
-I$GSTREAMER_ROOT_ANDROID/arm64/include/gstreamer-1.0 \
-I$GSTREAMER_ROOT_ANDROID/arm64/include/glib-2.0 \
-I$GSTREAMER_ROOT_ANDROID/arm64/lib/glib-2.0/include
# Build qtbase
make -j$(nproc) module-qtbase
# Install qtbase
make -j$(nproc) module-qtbase-install_subtargets
# Qt - qtmultimedia
# (use qtbase to build qtmultimedia)
###############################################################################
# qmake
cd $ROOTDIR/build/qtmultimedia
$ROOTDIR/install/bin/qmake -r \
$ROOTDIR/src/qt/qtmultimedia/qtmultimedia.pro \
"LIBS+=-L$GSTREAMER_ROOT_ANDROID/arm64/lib/" \
"LIBS+=-L$GSTREAMER_ROOT_ANDROID/arm64/lib/gstreamer-1.0/"
# make
make -j$(nproc)
# make install
make -j$(nproc) install
# Done
###############################################################################
cd $ROOTDIR