mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 21:14:01 +08:00
* Build vendored artifacts in CI * parallel * deterministic * fix up * fix gitignores * lil more * lil more consistency
43 lines
813 B
Bash
Executable File
43 lines
813 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
export SOURCE_DATE_EPOCH=0
|
|
export ZERO_AR_DATE=1
|
|
|
|
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 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
|
|
## ```
|