Skip to content

Commit 8640156

Browse files
authored
Build for arm64-osx (#564)
* Build for arm64-osx * More required packages * Remove unsupported filter for speex and speexdsp * Fix vcpkg ppc64el * Make Git available
1 parent 5c9346c commit 8640156

File tree

19 files changed

+99
-1486
lines changed

19 files changed

+99
-1486
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
*.c text eol=lf
44
*.cpp text eol=lf
55
*.m text eol=lf
6+
vcpkg-ppc64el.patch text eol=crlf

.github/workflows/maven-and-native.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ jobs:
296296
matrix:
297297
arch:
298298
- x86_64
299+
- arm64
299300
steps:
300301
- name: Checkout
301302
uses: actions/checkout@v3
@@ -321,12 +322,12 @@ jobs:
321322
run: |
322323
git config --global user.email "[email protected]"
323324
git config --global user.name "Jitsi GitHub Action"
324-
brew install nasm
325+
brew install nasm autoconf automake libtool
325326
resources/mac-cmake.sh ${{ steps.install_java.outputs.path }} ${{ matrix.arch }}
326327
327328
- name: The job has failed
328329
if: ${{ failure() }}
329-
run: tar --exclude *.o -cvJf target/debug-logs.tar.xz src/native/cmake-build
330+
run: tar --exclude *.o -cvJf target/debug-logs.tar.xz src/native/cmake-build-${{ matrix.arch }}
330331

331332
- name: Upload Debug logs
332333
if: ${{ failure() }}

debian/control

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Build-Depends:
1212
dpkg-dev (>= 1.16.1),
1313
libtool,
1414
cmake,
15+
git,
1516
default-jdk,
1617
libasound2-dev,
1718
libpulse-dev,

pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,14 @@
284284
darwin-x86-64/libjnscreencapture.dylib;
285285
darwin-x86-64/libjnspeex.dylib;
286286
darwin-x86-64/libjnvpx.dylib;osname=Mac OS X;processor=x86-64,
287+
darwin-aarch64/libjnawtrenderer.dylib;
288+
darwin-aarch64/libjnmaccoreaudio.dylib;
289+
darwin-aarch64/libjnopus.dylib;
290+
darwin-aarch64/libjnportaudio.dylib;
291+
darwin-aarch64/libjnquicktime.dylib;
292+
darwin-aarch64/libjnscreencapture.dylib;
293+
darwin-aarch64/libjnspeex.dylib;
294+
darwin-aarch64/libjnvpx.dylib;osname=Mac OS X;processor=AArch64,
287295
linux-x86/libjnawtrenderer.so;
288296
linux-x86/libjnopus.so;
289297
linux-x86/libjnportaudio.so;

resources/deb-prepare.sh

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
11
#!/usr/bin/env bash
22
set -e
33
set -x
4-
sudo apt-get update -
4+
sudo apt-get update
5+
sudo apt-get install -y distro-info
6+
57
# dev-tools from backports because https://bugs.launchpad.net/ubuntu/+source/ubuntu-dev-tools/+bug/1916633
8+
DEVTOOLS_PACKAGE=ubuntu-dev-tools
9+
UBUNTUTOOLS_PACKAGE=python3-ubuntutools
10+
if lsb_release -i -s == "Ubuntu"; then
11+
case $(lsb_release -c -s) in
12+
bionic | focal)
13+
DEVTOOLS_PACKAGE=$DEVTOOLS_PACKAGE/$(lsb_release -c -s)-backports
14+
UBUNTUTOOLS_PACKAGE=$UBUNTUTOOLS_PACKAGE/$(lsb_release -c -s)-backports
15+
;;
16+
esac
17+
elif lsb_release -i -s == "Debian"; then
18+
case $(lsb_release -c -s) in
19+
stretch | buster)
20+
>&2 echo "Packaging needs 'ubuntu-dev-tools' >= 1.181, which is only available in Bullseye"
21+
exit 1
22+
;;
23+
esac
24+
fi
25+
626
sudo apt-get install -y \
727
debhelper \
28+
aptitude \
829
sbuild \
930
schroot \
10-
ubuntu-dev-tools/$(lsb_release -c -s)-backports \
11-
python3-ubuntutools/$(lsb_release -c -s)-backports \
31+
"$DEVTOOLS_PACKAGE" \
32+
"$UBUNTUTOOLS_PACKAGE" \
1233
debian-archive-keyring \
1334
git-buildpackage \
14-
rename \
15-
distro-info
35+
rename
1636
sudo adduser $USER sbuild

resources/mac-cmake.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ case $ARCH in
2323
;;
2424
esac
2525

26-
cmake -B "${PROJECT_DIR}/src/native/cmake-build" \
26+
cmake -B "${PROJECT_DIR}/src/native/cmake-build-${OSX_ARCH}" \
2727
-S "${PROJECT_DIR}/src/native" \
2828
-DJAVA_HOME="$JAVA_HOME" \
2929
-DCMAKE_INSTALL_PREFIX="${PROJECT_DIR}/src/main/resources/darwin-$INSTALL_PREFIX_ARCH" \
3030
-DCMAKE_OSX_ARCHITECTURES="$OSX_ARCH" \
3131
-DVCPKG_TARGET_TRIPLET="$VCPKG_ARCH-osx"
32-
cmake --build "${PROJECT_DIR}/src/native/cmake-build" --config Release --target install --parallel
32+
cmake --build "${PROJECT_DIR}/src/native/cmake-build-${OSX_ARCH}" --config Release --target install --parallel

resources/ubuntu-build-image/build-static.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ case "$ARCH" in
2626
JAVA_ARCH="arm64"
2727
TOOLCHAIN=$LIBROOT/src/native/cmake/toolchains/arm64-linux.cmake
2828
;;
29-
"ppc64el")
29+
"ppc64el"|"ppc64le")
30+
ARCH="ppc64el"
3031
VCPKG_ARCH="ppc64le"
3132
JAVA_ARCH="ppc64el"
3233
TOOLCHAIN=$LIBROOT/src/native/cmake/toolchains/ppc64el-linux.cmake
@@ -36,7 +37,6 @@ esac
3637
export JAVA_HOME=/usr/lib/jvm/java-$JAVA_VERSION-openjdk-$JAVA_ARCH
3738

3839
cd "$LIBROOT/src/native" || exit 1
39-
cp cmake/vcpkg-triplets/x86-linux.cmake vcpkg/triplets/community
4040
cmake -B cmake-build-$ARCH \
4141
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$TOOLCHAIN \
4242
-DVCPKG_VERBOSE=ON \

src/native/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake-build-*
1+
cmake-build*
22
.idea/
33
.vs/
44
out/

src/native/CMakeLists.txt

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,23 @@ foreach(var ${vars})
1111
endif()
1212
endforeach()
1313

14-
if (WIN32 OR APPLE OR NOT USE_SYSTEM_VPX)
14+
if (UNIX AND NOT APPLE)
15+
set(DEFAULT_USE_SYSTEM_SPEEX ON)
16+
set(DEFAULT_USE_SYSTEM_VPX ON)
17+
else ()
18+
set(DEFAULT_USE_SYSTEM_SPEEX OFF)
19+
set(DEFAULT_USE_SYSTEM_VPX OFF)
20+
endif ()
21+
22+
option(USE_SYSTEM_SPEEX "Use system-installed speex" ${DEFAULT_USE_SYSTEM_SPEEX})
23+
option(USE_SYSTEM_VPX "Use system-installed vpx" ${DEFAULT_USE_SYSTEM_VPX})
24+
25+
find_package(Git REQUIRED)
26+
execute_process(
27+
COMMAND "${GIT_EXECUTABLE}" apply --verbose --binary ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg-ppc64el.patch
28+
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg"
29+
)
30+
if (NOT USE_SYSTEM_SPEEX OR NOT USE_SYSTEM_VPX)
1531
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake
1632
CACHE STRING "Vcpkg toolchain file")
1733
endif ()
@@ -53,7 +69,6 @@ endif ()
5369
find_package(JNI REQUIRED)
5470

5571
if (WIN32)
56-
find_package(Git REQUIRED)
5772
execute_process(
5873
COMMAND "${GIT_EXECUTABLE}" describe --match "v[0-9\\.]*" --long --dirty --always
5974
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
@@ -92,13 +107,6 @@ set(LIBJITSI_JAVAH "${CMAKE_CURRENT_SOURCE_DIR}/../../target/native/javah")
92107
include(ExternalProject)
93108

94109
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
95-
if (UNIX AND NOT APPLE)
96-
set(DEFAULT_USE_SYSTEM_SPEEX ON)
97-
else ()
98-
set(DEFAULT_USE_SYSTEM_SPEEX OFF)
99-
endif ()
100-
101-
option(USE_SYSTEM_SPEEX "Use system-installed speex" ${DEFAULT_USE_SYSTEM_SPEEX})
102110

103111
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
104112

@@ -110,7 +118,6 @@ if (CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64el" OR CMAKE_SYSTEM_PROCESSOR STREQUAL
110118
endif ()
111119

112120
include(GNUInstallDirs)
113-
add_subdirectory(third_party/speex)
114121

115122
add_subdirectory(jawtrenderer)
116123
add_subdirectory(opus)

src/native/cmake/vcpkg-triplets/x86-linux.cmake

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)