Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arm32 and arm64 support/builds #254

Open
wants to merge 15 commits into
base: v21.xx.x
Choose a base branch
from
9 changes: 8 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ jobs:
- target: linuxjack
os: ubuntu-18.04
os_name: linux
- target: linux_arm32
os: ubuntu-18.04
os_name: linux
- target: linux_arm64
os: ubuntu-18.04
os_name: linux
- target: macos_x86_64
os: macos-10.15
os_name: macos
Expand All @@ -73,8 +79,9 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: sreimers/action-archlinux-mingw@main
- name: mingw
if: ${{ matrix.os_name == 'mingw' }}
uses: sreimers/action-archlinux-mingw@main
with:
run: "./dist/build_windows.sh"

Expand Down
34 changes: 31 additions & 3 deletions dist/before_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,37 @@
if [ "$BUILD_OS" == "linux" ]; then
sudo apt-get update
sudo apt-get install -y libasound2-dev libjack-jackd2-dev libpulse-dev libpulse0
wget http://lv2plug.in/spec/lv2-1.14.0.tar.bz2
tar xjf lv2-1.14.0.tar.bz2
pushd lv2-1.14.0 && ./waf configure && ./waf build && sudo ./waf install && popd

if [ "$BUILD_TARGET" == "linux_arm32" ] || [ "$BUILD_TARGET" == "linux_arm64" ]; then
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf

wget http://ports.ubuntu.com/pool/main/a/alsa-lib/libasound2_1.1.3-5_armhf.deb
wget http://ports.ubuntu.com/pool/main/a/alsa-lib/libasound2_1.1.3-5_arm64.deb

wget http://ports.ubuntu.com/pool/main/p/pulseaudio/libpulse0_11.1-1ubuntu7_armhf.deb
wget http://ports.ubuntu.com/pool/main/p/pulseaudio/libpulse0_11.1-1ubuntu7_arm64.deb

sudo dpkg-deb -x libasound2_1.1.3-5_armhf.deb /
sudo dpkg-deb -x libasound2_1.1.3-5_arm64.deb /
sudo dpkg-deb -x libpulse0_11.1-1ubuntu7_armhf.deb /
sudo dpkg-deb -x libpulse0_11.1-1ubuntu7_arm64.deb /
pushd /usr/lib/arm-linux-gnueabihf
sudo ln -s libasound.so.2.0.0 libasound.so
sudo ln -s libpulse-simple.so.0.1.1 libpulse-simple.so
sudo ln -s libpulse.so.0.20.2 libpulse.so
popd
pushd /usr/lib/aarch64-linux-gnu
sudo ln -s libasound.so.2.0.0 libasound.so
sudo ln -s libpulse-simple.so.0.1.1 libpulse-simple.so
sudo ln -s libpulse.so.0.20.2 libpulse.so
popd
else

wget http://lv2plug.in/spec/lv2-1.14.0.tar.bz2
tar xjf lv2-1.14.0.tar.bz2
pushd lv2-1.14.0 && ./waf configure && ./waf build && sudo ./waf install && popd
fi
elif [ "$BUILD_OS" == "macos" ]; then
security create-keychain -p travis sl-build.keychain
security list-keychains -s ~/Library/Keychains/sl-build.keychain
Expand Down
48 changes: 26 additions & 22 deletions dist/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,13 @@
source dist/lib/versions.sh
source dist/lib/functions.sh

make_opts="-j4 SYSROOT_ALT=../3rdparty"
make_opts="-j4 SYSROOT_ALT=../3rdparty "

if [ "$BUILD_TARGET" == "ccheck" ]; then
dist/tools/ccheck.sh
exit 0
fi

if [ "$BUILD_TARGET" == "linuxarm" ]; then
git clone https://github.com/raspberrypi/tools $HOME/rpi-tools
export PATH=$PATH:$HOME/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin
export ARCH=arm
export CCPREFIX=$HOME/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-
export CC=arm-linux-gnueabihf-gcc
export CXX=arm-linux-gnueabihf-g++
export RPI_CROSS_COMPILE=true
fi

# Start build
#-----------------------------------------------------------------------------
Expand All @@ -28,24 +19,39 @@ sl_3rdparty
sl_extra_lflags="-L ../opus -L ../my_include "
sl_extra_cflags=""

if [ "$BUILD_TARGET" == "linux_arm32" ]; then
make_opts+="SYSROOT=/usr/arm-linux-gnueabihf"
sl_extra_lflags+="-L /usr/lib/arm-linux-gnueabihf "
export CC=arm-linux-gnueabihf-gcc
export CXX=arm-linux-gnueabihf-g++

fi

if [ "$BUILD_TARGET" == "linux_arm64" ]; then
make_opts+="SYSROOT=/usr/aarch64-linux-gnu"
sl_extra_lflags+="-L ./usr/lib/aarch64-linux-gnu "
export CC=aarch64-linux-gnu-gcc
export CXX=aarch64-linux-gnu-g++
fi

if [ "$BUILD_OS" == "macos" ]; then
use_ssl='USE_OPENSSL="yes" USE_OPENSSL_DTLS="yes" USE_OPENSSL_SRTP="yes"'
else
use_ssl='USE_OPENSSL="yes"'
fi

if [ "$BUILD_TARGET" == "linux" ]; then
sl_extra_modules="alsa slaudio"
if [ "$BUILD_OS" == "linux" ]; then
sl_extra_modules="alsa slaudio "
fi
if [ "$BUILD_TARGET" == "linuxjack" ]; then
sl_extra_modules="jack alsa slaudio"
sl_extra_modules+="jack "
fi
if [ "$BUILD_OS" == "macos" ]; then
export MACOSX_DEPLOYMENT_TARGET=10.10
sl_extra_lflags+="-L ../openssl ../openssl/libssl.a ../openssl/libcrypto.a "
sl_extra_lflags+="-framework SystemConfiguration "
sl_extra_lflags+="-framework CoreFoundation"
sl_extra_modules="slaudio"
sl_extra_modules="slaudio "
sed_opt="-i ''"

if [ "$BUILD_TARGET" == "macos_arm64" ]; then
Expand All @@ -62,7 +68,7 @@ if [ "$BUILD_OS" == "macos" ]; then
fi
fi

sl_extra_modules="$sl_extra_modules g722 slogging dtls_srtp"
sl_extra_modules+="g722 slogging dtls_srtp"

# Build libre
#-----------------------------------------------------------------------------
Expand Down Expand Up @@ -93,7 +99,8 @@ if [ ! -d baresip-$baresip ]; then

pushd baresip-$baresip
# Standalone
if [ "$BUILD_TARGET" == "linux" ] || [ "$BUILD_TARGET" == "linuxjack" ]; then
if [ "$BUILD_TARGET" == "linux" ] || [ "$BUILD_TARGET" == "linuxjack" ] || \
[ "$BUILD_TARGET" == "linux_arm32" ] || [ "$BUILD_TARGET" == "linux_arm64" ]; then
make $debug $make_opts $use_ssl LIBRE_SO=../re LIBREM_PATH=../rem STATIC=1 \
MODULES="opus stdio ice g711 turn stun uuid auloop webapp $sl_extra_modules" \
EXTRA_CFLAGS="-I ../my_include $sl_extra_cflags" \
Expand Down Expand Up @@ -232,12 +239,9 @@ fi
s3_path="s3_upload/$GIT_BRANCH/$version_t/$BUILD_TARGET"
mkdir -p $s3_path

if [ "$BUILD_TARGET" == "linuxjack" ]; then
#./studio-link-standalone -t 5
ldd studio-link-standalone

strip --strip-all studio-link-standalone

if [ "$BUILD_TARGET" == "linuxjack" ] || \
[ "$BUILD_TARGET" == "linux_arm32" ] || \
[ "$BUILD_TARGET" == "linux_arm64" ]; then
chmod +x studio-link-standalone
mv studio-link-standalone studio-link-standalone-$version_tc
tar -cvzf studio-link-standalone-$version_tc.tar.gz studio-link-standalone-$version_tc
Expand Down
2 changes: 1 addition & 1 deletion dist/lib/versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ baresip="1.0.0"
baresip_lib="1.0.0"
re="1.1.0"
rem="0.6.0"
sl3rdparty="v21.12.0"
sl3rdparty="v22.02.0"
overlay="v19.09.0"
juce="6.0.7"
github_org="https://github.com/Studio-Link"
Expand Down