Skip to content

Commit

Permalink
Add linux-arm64 and linux-ppc64el (#552)
Browse files Browse the repository at this point in the history
* Cache Ubuntu multi-arch build image

* Remove native binaries from source

* Update depdencies

* Add builds for aarch64 and ppc64el (Linux only)

* Disable sctp tests as the natives are not committed

* Change artifact transfer

* Fix dependency and test builds

* Java 17 and make package install executable

* Runner permissions

* The Mac runner has no automake installed

* Pin Ubuntu to 18.04

* Typo

* -fPIC for SpeexDSP

* Fix default install dir for linux-x86
  • Loading branch information
ibauersachs authored Nov 29, 2021
1 parent 19f651a commit 7488682
Show file tree
Hide file tree
Showing 76 changed files with 467 additions and 234 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/Dockerfile.static

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/build-static.sh

This file was deleted.

79 changes: 47 additions & 32 deletions .github/workflows/maven-and-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [ 8, 11 ]
java: [ 8, 11, 17 ]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -34,54 +34,57 @@ jobs:
cache: maven

- name: Verify Java
run: mvn -B verify
run: |
#disable bundling because no natives are committed
sed -i "s/>bundle</>jar</" pom.xml
mvn -B verify -DperformRelease=true
- name: Upload JNI headers
if: matrix.java == env.RELEASE_JAVA_VERSION
uses: actions/upload-artifact@v2
with:
name: jni_headers
path: target/native

ubuntu:
name: Ubuntu Natives (static)
runs-on: ubuntu-latest
name: Ubuntu Natives ${{ matrix.arch}}
runs-on: ubuntu-18.04
needs: javatest
strategy:
fail-fast: false
matrix:
arch: [ "x86", "x86-64", "arm64", "ppc64el" ]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true

- name: Install Java ${{ env.RELEASE_JAVA_VERSION }}
uses: actions/setup-java@v2
- name: Get JNI headers
uses: actions/download-artifact@v2
with:
java-version: ${{ env.RELEASE_JAVA_VERSION }}
distribution: temurin
cache: maven

- name: Compile Java for JNI headers
run: mvn -B compile
name: jni_headers
path: target/native

- name: Build build container
- name: Install packages
run: |
cd .github/workflows
docker build -f Dockerfile.static -t libjitsi-static:${{ github.sha }} .
if [ "${{ matrix.arch }}" != "x86" ] && [ "${{ matrix.arch }}" != "x86-64" ]; then
sudo cp -f resources/ubuntu-build-image/ports-sources.list /etc/apt/sources.list
fi
sudo ./resources/ubuntu-build-image/packages.sh ${{ matrix.arch }} ${{ env.RELEASE_JAVA_VERSION }}
- name: Build natives x86 (static)
run: docker run -v ${{ github.workspace }}:/ghws libjitsi-static:${{ github.sha }} /bin/bash -c "/ghws/.github/workflows/build-static.sh m32 /ghws"
- name: Build natives ${{ matrix.arch }}
run: ./resources/ubuntu-build-image/build-static.sh ${{ matrix.arch }} ${{ env.RELEASE_JAVA_VERSION }} "$(pwd)"

- name: Upload Linux x86 natives
- name: Upload Linux ${{ matrix.arch }} natives
uses: actions/upload-artifact@v2
with:
name: linux-x86
path: lib/native/linux-x86

- name: Build natives x64 (static)
run: docker run -v ${{ github.workspace }}:/ghws libjitsi-static:${{ github.sha }} /bin/bash -c "/ghws/.github/workflows/build-static.sh m64 /ghws"

- name: Upload Linux x64 natives
uses: actions/upload-artifact@v2
with:
name: linux-x86-64
path: lib/native/linux-x86-64
name: linux-${{ matrix.arch }}
path: lib/native/linux-*/*

windows:
name: Windows ${{ matrix.arch}} Natives
name: Windows Natives ${{ matrix.arch}}
runs-on: windows-latest
needs: javatest
strategy:
Expand Down Expand Up @@ -242,13 +245,25 @@ jobs:
uses: actions/download-artifact@v2
with:
name: linux-x86
path: lib/native/linux-x86
path: lib/native/

- name: Get Linux x64 natives
uses: actions/download-artifact@v2
with:
name: linux-x86-64
path: lib/native/linux-x86-64
path: lib/native/

- name: Get Linux arm64 natives
uses: actions/download-artifact@v2
with:
name: linux-arm64
path: lib/native/

- name: Get Linux ppc64el natives
uses: actions/download-artifact@v2
with:
name: linux-ppc64el
path: lib/native/

- name: Get Windows x86 natives
uses: actions/download-artifact@v2
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ libjitsi.jar
.project
libjitsi.iml
src/native/windows/directshow/Debug/*
lib/native/win32-x86/*.exp
lib/native/win32-x86-64/*.exp
lib/native/*
*.sdf
*.opensdf
*.o
Expand Down
Binary file removed lib/native/darwin/libjnawtrenderer.dylib
Binary file not shown.
Binary file removed lib/native/darwin/libjnmaccoreaudio.dylib
Binary file not shown.
Binary file removed lib/native/darwin/libjnopus.dylib
Binary file not shown.
Binary file removed lib/native/darwin/libjnportaudio.dylib
Binary file not shown.
Binary file removed lib/native/darwin/libjnquicktime.dylib
Binary file not shown.
Binary file removed lib/native/darwin/libjnscreencapture.dylib
Binary file not shown.
Binary file removed lib/native/darwin/libjnsctp.dylib
Binary file not shown.
Binary file removed lib/native/darwin/libjnspeex.dylib
Binary file not shown.
Binary file removed lib/native/darwin/libjnvpx.dylib
Binary file not shown.
Binary file removed lib/native/linux-x86-64/libjnawtrenderer.so
Binary file not shown.
Binary file removed lib/native/linux-x86-64/libjnopus.so
Binary file not shown.
Binary file removed lib/native/linux-x86-64/libjnportaudio.so
Binary file not shown.
Binary file removed lib/native/linux-x86-64/libjnpulseaudio.so
Binary file not shown.
Binary file removed lib/native/linux-x86-64/libjnscreencapture.so
Binary file not shown.
Binary file removed lib/native/linux-x86-64/libjnsctp.so
Binary file not shown.
Binary file removed lib/native/linux-x86-64/libjnspeex.so
Binary file not shown.
Binary file removed lib/native/linux-x86-64/libjnvideo4linux2.so
Binary file not shown.
Binary file removed lib/native/linux-x86-64/libjnvpx.so
Binary file not shown.
Binary file removed lib/native/linux-x86/libjnawtrenderer.so
Binary file not shown.
Binary file removed lib/native/linux-x86/libjnopus.so
Binary file not shown.
Binary file removed lib/native/linux-x86/libjnportaudio.so
Binary file not shown.
Binary file removed lib/native/linux-x86/libjnpulseaudio.so
Binary file not shown.
Binary file removed lib/native/linux-x86/libjnscreencapture.so
Binary file not shown.
Binary file removed lib/native/linux-x86/libjnsctp.so
Binary file not shown.
Binary file removed lib/native/linux-x86/libjnspeex.so
Binary file not shown.
Binary file removed lib/native/linux-x86/libjnvideo4linux2.so
Binary file not shown.
Binary file removed lib/native/linux-x86/libjnvpx.so
Binary file not shown.
Binary file removed lib/native/win32-x86-64/jnawtrenderer.dll
Binary file not shown.
Binary file removed lib/native/win32-x86-64/jndirectshow.dll
Binary file not shown.
Binary file removed lib/native/win32-x86-64/jnopus.dll
Binary file not shown.
Binary file removed lib/native/win32-x86-64/jnportaudio.dll
Binary file not shown.
Binary file removed lib/native/win32-x86-64/jnscreencapture.dll
Binary file not shown.
Binary file removed lib/native/win32-x86-64/jnsctp.dll
Binary file not shown.
Binary file removed lib/native/win32-x86-64/jnspeex.dll
Binary file not shown.
Binary file removed lib/native/win32-x86-64/jnvpx.dll
Binary file not shown.
Binary file removed lib/native/win32-x86-64/jnwasapi.dll
Binary file not shown.
Binary file removed lib/native/win32-x86-64/jnwincoreaudio.dll
Binary file not shown.
Binary file removed lib/native/win32-x86/jnawtrenderer.dll
Binary file not shown.
Binary file removed lib/native/win32-x86/jndirectshow.dll
Binary file not shown.
Binary file removed lib/native/win32-x86/jnopus.dll
Binary file not shown.
Binary file removed lib/native/win32-x86/jnportaudio.dll
Binary file not shown.
Binary file removed lib/native/win32-x86/jnscreencapture.dll
Binary file not shown.
Binary file removed lib/native/win32-x86/jnsctp.dll
Binary file not shown.
Binary file removed lib/native/win32-x86/jnspeex.dll
Binary file not shown.
Binary file removed lib/native/win32-x86/jnvpx.dll
Binary file not shown.
Binary file removed lib/native/win32-x86/jnwasapi.dll
Binary file not shown.
Binary file removed lib/native/win32-x86/jnwincoreaudio.dll
Binary file not shown.
50 changes: 34 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jitsi-utils</artifactId>
<version>1.0-99-gf60ac15</version>
<version>1.0-108-g480acf0</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jitsi-srtp</artifactId>
<version>1.1-2-gabdf3cc</version>
<version>1.1-4-gc42f998</version>
</dependency>
<dependency>
<groupId>org.opentelecoms.sdp</groupId>
Expand Down Expand Up @@ -132,7 +132,7 @@
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>22.0.0</version>
<version>23.0.0</version>
<scope>provided</scope>
</dependency>

Expand Down Expand Up @@ -162,7 +162,7 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.1</version>
<version>5.1.2</version>
<extensions>true</extensions>
<configuration>
<excludeDependencies>jitsi-lgpl-dependencies</excludeDependencies>
Expand Down Expand Up @@ -199,15 +199,32 @@
linux-x86/libjnsctp.so;
linux-x86/libjnspeex.so;
linux-x86/libjnvideo4linux2.so;osname=Linux;processor=x86,
linux-x86-64/libjnawtrenderer.so;
linux-x86-64/libjnopus.so;
linux-x86-64/libjnportaudio.so;
linux-x86-64/libjnpulseaudio.so;
linux-x86-64/libjnscreencapture.so;
linux-x86-64/libjnsctp.so;
linux-x86-64/libjnspeex.so;
linux-x86-64/libjnvideo4linux2.so;
linux-x86-64/libjnvpx.so;osname=Linux;processor=x86-64,
linux-x86_64/libjnawtrenderer.so;
linux-x86_64/libjnopus.so;
linux-x86_64/libjnportaudio.so;
linux-x86_64/libjnpulseaudio.so;
linux-x86_64/libjnscreencapture.so;
linux-x86_64/libjnsctp.so;
linux-x86_64/libjnspeex.so;
linux-x86_64/libjnvideo4linux2.so;
linux-x86_64/libjnvpx.so;osname=Linux;processor=x86-64,
linux-aarch64/libjnawtrenderer.so;
linux-aarch64/libjnopus.so;
linux-aarch64/libjnportaudio.so;
linux-aarch64/libjnpulseaudio.so;
linux-aarch64/libjnscreencapture.so;
linux-aarch64/libjnsctp.so;
linux-aarch64/libjnspeex.so;
linux-aarch64/libjnvideo4linux2.so;
linux-aarch64/libjnvpx.so;osname=Linux;processor=AArch64,
linux-ppc64le/libjnawtrenderer.so;
linux-ppc64le/libjnopus.so;
linux-ppc64le/libjnportaudio.so;
linux-ppc64le/libjnpulseaudio.so;
linux-ppc64le/libjnscreencapture.so;
linux-ppc64le/libjnsctp.so;
linux-ppc64le/libjnspeex.so;
linux-ppc64le/libjnvideo4linux2.so;osname=Linux;processor=PowerPC-64-LE,
win32-x86/jnawtrenderer.dll;
win32-x86/jndirectshow.dll;
win32-x86/jnopus.dll;
Expand Down Expand Up @@ -261,9 +278,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.1</version>
<configuration>
<doclint>-missing</doclint>
<source>8</source>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -313,7 +331,7 @@
<id>release</id>
<activation>
<property>
<name>performRelease</name>
<name>release</name>
<value>true</value>
</property>
</activation>
Expand All @@ -322,7 +340,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<version>3.0.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down
13 changes: 13 additions & 0 deletions resources/ubuntu-build-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ubuntu:bionic

ARG ARCH=x86-64
ARG JAVA_VERSION=8

ADD https://github.com/Kitware/CMake/releases/download/v3.22.0/cmake-3.22.0-Linux-x86_64.sh /opt/cmake.sh
RUN chmod +x /opt/cmake.sh && /opt/cmake.sh --skip-license --prefix=/usr --exclude-subdir

COPY ports-sources.list /etc/apt/
RUN if [ "$ARCH" != "x86" ] && [ "$ARCH" != "x86-64" ]; then cp /etc/apt/ports-sources.list /etc/apt/sources.list; fi

COPY packages.sh /opt/
RUN /opt/packages.sh $ARCH $JAVA_VERSION
53 changes: 53 additions & 0 deletions resources/ubuntu-build-image/build-static.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

export GIT_COMMITTER_EMAIL="[email protected]"
export GIT_COMMITTER_NAME="libjitsi `basename $0`"

ARCH=$1
JAVA_VERSION=$2
LIBROOT=$3
case "$ARCH" in
"x86")
VCPKG_ARCH="x86"
JAVA_ARCH="i386"
export CFLAGS="-m32 -msse -msse2"
export CXXFLAGS="-m32 -msse -msse2"
;;
"x86-64")
VCPKG_ARCH="x64"
JAVA_ARCH="amd64"
export CFLAGS="-m64 -msse -msse2"
export CXXFLAGS="-m64 -msse -msse2"
;;
"arm64")
#for libvpx
export CROSS="aarch64-linux-gnu-"
VCPKG_ARCH="arm64"
JAVA_ARCH="arm64"
TOOLCHAIN=$LIBROOT/src/native/cmake/toolchains/arm64-linux.cmake
;;
"ppc64el")
VCPKG_ARCH="ppc64le"
JAVA_ARCH="ppc64el"
TOOLCHAIN=$LIBROOT/src/native/cmake/toolchains/ppc64el-linux.cmake
;;
esac

export JAVA_HOME=/usr/lib/jvm/java-$JAVA_VERSION-openjdk-$JAVA_ARCH

cd "$LIBROOT/src/native" || exit 1
cp cmake/vcpkg-triplets/x86-linux.cmake vcpkg/triplets/community
cmake -B cmake-build-$ARCH \
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$TOOLCHAIN \
-DVCPKG_VERBOSE=ON \
-DVCPKG_TARGET_TRIPLET=$VCPKG_ARCH-linux \
-DVCPKG_BUILD_TYPE=release \
-DCMAKE_BUILD_TYPE=release \
-DCMAKE_C_FLAGS="$CFLAGS" \
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-DUSE_SYSTEM_OPUS=OFF \
-DUSE_SYSTEM_SPEEX=OFF \
-DUSE_SYSTEM_USRSCTP=OFF \
-DUSE_SYSTEM_VPX=OFF

cmake --build cmake-build-$ARCH --config Release --target install --parallel
Loading

0 comments on commit 7488682

Please sign in to comment.