third_party: build scripts for libyuv and maplibre-native-qt (#31988)

* updated maplibre build.sh

* refactored libyuv build.sh
old-commit-hash: 245cbe97c7
pull/32199/head
Andrei Radulescu 1 year ago committed by GitHub
parent 7a3cbde20c
commit 61da0fd009
  1. 1
      third_party/libyuv/.gitignore
  2. 33
      third_party/libyuv/build.sh
  3. 12
      third_party/maplibre-native-qt/build.sh
  4. 1
      tools/install_ubuntu_dependencies.sh

@ -0,0 +1 @@
libyuv/

@ -1,12 +1,39 @@
#!/usr/bin/env bash
set -e
git clone https://chromium.googlesource.com/libyuv/libyuv
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
ARCHNAME=$(uname -m)
if [ -f /TICI ]; then
ARCHNAME="larch64"
fi
if [[ "$OSTYPE" == "darwin"* ]]; then
ARCHNAME="Darwin"
fi
cd $DIR
if [ ! -d libyuv ]; then
git clone --single-branch https://chromium.googlesource.com/libyuv/libyuv
fi
cd libyuv
git reset --hard 4a14cb2e81235ecd656e799aecaaf139db8ce4a2
git checkout 4a14cb2e81235ecd656e799aecaaf139db8ce4a2
# build
cmake .
make -j$(nproc)
INSTALL_DIR="$DIR/$ARCHNAME"
rm -rf $INSTALL_DIR
mkdir -p $INSTALL_DIR
rm -rf $DIR/include
mkdir -p $INSTALL_DIR/lib
cp $DIR/libyuv/libyuv.a $INSTALL_DIR/lib
cp -r $DIR/libyuv/include $DIR
## To create universal binary on Darwin:
## ```
## lipo -create -output Darwin/libyuv.a path-to-x64/libyuv.a path-to-arm64/libyuv.a
## ```
## ```

@ -3,35 +3,33 @@ set -e
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
ARCHNAME="x86_64"
ARCHNAME=$(uname -m)
MAPLIBRE_FLAGS="-DMLN_QT_WITH_LOCATION=OFF"
if [ -f /AGNOS ]; then
if [ -f /TICI ]; then
ARCHNAME="larch64"
#MAPLIBRE_FLAGS="$MAPLIBRE_FLAGS -DCMAKE_SYSTEM_NAME=Android -DANDROID_ABI=arm64-v8a"
fi
cd $DIR
if [ ! -d maplibre ]; then
git clone git@github.com:maplibre/maplibre-native-qt.git $DIR/maplibre
git clone --single-branch https://github.com/maplibre/maplibre-native-qt.git $DIR/maplibre
fi
cd maplibre
git fetch --all
git checkout 3726266e127c1f94ad64837c9dbe03d238255816
git submodule update --depth=1 --recursive --init
# build
mkdir -p build
cd build
set -x
cmake $MAPLIBRE_FLAGS $DIR/maplibre
make -j$(nproc) || make -j2 || make -j1
make -j$(nproc)
INSTALL_DIR="$DIR/$ARCHNAME"
rm -rf $INSTALL_DIR
mkdir -p $INSTALL_DIR
rm -rf $INSTALL_DIR/lib $DIR/include
rm -rf $DIR/include
mkdir -p $INSTALL_DIR/lib $INSTALL_DIR/include $DIR/include
cp -r $DIR/maplibre/build/src/core/*.so* $INSTALL_DIR/lib
cp -r $DIR/maplibre/build/src/core/include/* $INSTALL_DIR/include

@ -75,6 +75,7 @@ function install_ubuntu_common_requirements() {
libqt5charts5-dev \
libqt5serialbus5-dev \
libqt5x11extras5-dev \
libqt5opengl5-dev \
libreadline-dev \
libdw1 \
valgrind

Loading…
Cancel
Save