From ceb067c46c6f8c83ec2e103437498fdfbc59e1d9 Mon Sep 17 00:00:00 2001 From: Ingo Bauersachs Date: Sun, 27 Apr 2025 18:21:22 +0200 Subject: [PATCH 1/7] Update dependencies, build fixes --- .github/workflows/deploy-debian.yml | 3 +- .github/workflows/maven-and-native.yml | 14 +-- pom.xml | 85 +++++++++++++------ resources/deb-build.sh | 23 ++++- resources/ubuntu-build-image/Dockerfile | 2 +- resources/ubuntu-build-image/packages.sh | 2 +- .../ubuntu-build-image/ports-sources.list | 16 ++-- 7 files changed, 95 insertions(+), 50 deletions(-) diff --git a/.github/workflows/deploy-debian.yml b/.github/workflows/deploy-debian.yml index c61e9745e..bdf025243 100644 --- a/.github/workflows/deploy-debian.yml +++ b/.github/workflows/deploy-debian.yml @@ -32,7 +32,8 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - uses: robinraju/release-downloader@4bdb8ee081c9ee08a35320794dd461312ac9e4ad + # v1.12 + - uses: robinraju/release-downloader@daf26c55d821e836577a15f77d86ddc078948b05 with: repository: "${{ github.repository }}" tag: "${{ github.event.inputs.tag || inputs.tag }}" diff --git a/.github/workflows/maven-and-native.yml b/.github/workflows/maven-and-native.yml index 20218b698..f757057a2 100644 --- a/.github/workflows/maven-and-native.yml +++ b/.github/workflows/maven-and-native.yml @@ -133,14 +133,6 @@ jobs: env: DEBIAN_FRONTEND: noninteractive run: | - # Remove broken packages from pre-installed php in Actions image - # No longer needed in ubuntu-22.04 - sudo apt-get remove -y libpcre2-dev libicu-dev icu-devtools - sudo apt-add-repository ppa:ondrej/php -y - sudo apt-get install -y aptitude - echo "Get::allow-downgrades \"true\";" | sudo tee /etc/apt/apt.conf.d/99-downgrades - echo "Get::Assume-Yes \"true\";" | sudo tee -a /etc/apt/apt.conf.d/99-downgrades - sudo ./resources/ubuntu-build-image/ppa-purge.sh ppa:ondrej/php -y true if [ "${{ matrix.arch }}" != "x86" ] && [ "${{ matrix.arch }}" != "x86-64" ]; then sudo cp -f resources/ubuntu-build-image/ports-sources.list /etc/apt/sources.list fi @@ -228,7 +220,8 @@ jobs: resources/deb-build.sh \ "${{ needs.version.outputs.version }}" \ "${{ matrix.dist.dist }}" \ - "${{ matrix.arch }}" + "${{ matrix.arch }}" \ + "dev+maven@jitsi.org" - name: Upload package as artifact uses: actions/upload-artifact@v4 @@ -441,7 +434,8 @@ jobs: - name: Create release if: github.ref == 'refs/heads/master' - uses: ncipollo/release-action@37c87f6b53fb46d40450c3cac428aa83c8d0055f + # v1.16.0 + uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174 with: artifacts: "target/*.jar,debian-releases.tar" allowUpdates: true diff --git a/pom.xml b/pom.xml index 5862dd06b..3092ababc 100644 --- a/pom.xml +++ b/pom.xml @@ -45,7 +45,7 @@ - 1.77 + 1.80 UTF-8 @@ -69,7 +69,7 @@ net.java.dev.jna jna - 5.13.0 + 5.17.0 org.bouncycastle @@ -94,12 +94,12 @@ ${project.groupId} jitsi-utils - 1.0-126-g02b0c86 + 1.0-135-g56f462d ${project.groupId} jitsi-srtp - 1.1-15-ga19c05a + 1.1-20-g3cd87a0 org.opentelecoms.sdp @@ -127,12 +127,12 @@ org.apache.commons commons-lang3 - 3.12.0 + 3.17.0 org.jetbrains annotations - 24.0.1 + 26.0.2 provided @@ -140,13 +140,13 @@ org.junit.jupiter junit-jupiter-engine - 5.9.3 + 5.12.2 test org.mockito mockito-core - 5.4.0 + 5.17.0 test @@ -158,11 +158,35 @@ + + + + org.apache.maven.plugins + maven-antrun-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-assembly-plugin + 3.7.1 + + + org.apache.maven.plugins + maven-dependency-plugin + 3.8.1 + + + org.apache.maven.plugins + maven-release-plugin + 3.1.1 + + + org.codehaus.mojo versions-maven-plugin - 2.16.0 + 2.18.0 @@ -213,7 +237,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.11.0 + 3.14.0 11 @@ -224,13 +248,24 @@ - maven-surefire-plugin - 3.1.2 + org.apache.maven.plugins + maven-clean-plugin + 3.4.1 + + + org.apache.maven.plugins + maven-deploy-plugin + 3.1.4 + + + org.apache.maven.plugins + maven-install-plugin + 3.1.4 org.apache.maven.plugins maven-javadoc-plugin - 3.5.0 + 3.11.2 -missing 11 @@ -238,31 +273,31 @@ org.apache.maven.plugins - maven-source-plugin - 3.3.0 - - true - + maven-resources-plugin + 3.3.1 org.apache.maven.plugins - maven-resources-plugin - 3.3.1 + maven-site-plugin + 3.21.0 org.apache.maven.plugins - maven-install-plugin - 3.1.1 + maven-source-plugin + 3.3.1 + + true + org.apache.maven.plugins - maven-deploy-plugin - 3.1.1 + maven-surefire-plugin + 3.5.3 org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 true ossrh diff --git a/resources/deb-build.sh b/resources/deb-build.sh index d4d18555d..2de7a9514 100755 --- a/resources/deb-build.sh +++ b/resources/deb-build.sh @@ -1,9 +1,19 @@ #!/usr/bin/env bash +if [ "$#" -ne 4 ]; then + echo "Usage: $0 " + echo " VERSION: Source package version, e.g. 2.14.123-gcaffee" + echo " DIST: Debian/Ubuntu distribution name (e.g. focal or bullseye)" + echo " ARCH: Architecture (e.g. amd64, aarch64)" + echo " GPG_ID: id for package signing" + exit 1 +fi; + set -e set -x VERSION=$1 DIST=$2 ARCH=$3 +GPG_ID=$4 PROJECT_DIR="$(realpath "$(dirname "$0")/../")" cd "${PROJECT_DIR}" || exit # export for sbuildrc sourcing @@ -13,16 +23,21 @@ mkdir -p "${BUILD_DIR}" # use tmpfs for sbuild sudo tee -a /etc/fstab < "${PROJECT_DIR}/resources/sbuild-tmpfs" -# --skip-security because: https://bugs.launchpad.net/ubuntu/+source/ubuntu-dev-tools/+bug/1955116 if [[ "${ARCH}" != "amd64" ]]; then - mk-sbuild "${DIST}" --target "${ARCH}" --skip-security --type=file --debootstrap-include=ca-certificates || sbuild-update -udc "${DIST}"-amd64-"${ARCH}" + mk-sbuild "${DIST}" --target "${ARCH}" --type=file --debootstrap-include=ca-certificates || sbuild-update -udc "${DIST}"-amd64-"${ARCH}" + + # union-type= is not valid for type=file, remove to prevent warnings + sudo sed -i s/union-type=.*//g "/etc/schroot/chroot.d/sbuild-${DIST}-amd64-${ARCH}" else if debian-distro-info --all | grep -Fqxi "${DIST}"; then export DEBOOTSTRAP_MIRROR=${DEBOOTSTRAP_MIRROR:-$UBUNTUTOOLS_DEBIAN_MIRROR} elif ubuntu-distro-info --all | grep -Fqxi "${DIST}"; then export DEBOOTSTRAP_MIRROR=${DEBOOTSTRAP_MIRROR:-$UBUNTUTOOLS_UBUNTU_MIRROR} fi - mk-sbuild "${DIST}" --skip-security --type=file --debootstrap-include=ca-certificates || sbuild-update -udc "${DIST}"-amd64 + mk-sbuild "${DIST}" --type=file --debootstrap-include=ca-certificates || sbuild-update -udc "${DIST}"-amd64 + + # union-type= is not valid for type=file, remove to prevent warnings + sudo sed -i s/union-type=.*//g "/etc/schroot/chroot.d/sbuild-${DIST}-amd64" fi mvn -B versions:set -DnewVersion="${VERSION}" -DgenerateBackupPoms=false @@ -35,7 +50,7 @@ else cp "${PROJECT_DIR}"/../libjitsi_* "$BUILD_DIR" fi -debsign -S -edev+maven@jitsi.org "${BUILD_DIR}"/*.changes --re-sign -p"${PROJECT_DIR}"/resources/gpg-wrap.sh +debsign -S -e"${GPG_ID}" "${BUILD_DIR}"/*.changes --re-sign -p"${PROJECT_DIR}"/resources/gpg-wrap.sh #make build files readable for Windows and archivable for GitHub Actions rename 's|:|-|g' "$BUILD_DIR"/*.build diff --git a/resources/ubuntu-build-image/Dockerfile b/resources/ubuntu-build-image/Dockerfile index 79f5846a8..ffbd0c4af 100644 --- a/resources/ubuntu-build-image/Dockerfile +++ b/resources/ubuntu-build-image/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:focal +FROM ubuntu:jammy ARG ARCH=x86-64 ARG JAVA_VERSION=11 diff --git a/resources/ubuntu-build-image/packages.sh b/resources/ubuntu-build-image/packages.sh index e4a62be7a..d7e112c8a 100755 --- a/resources/ubuntu-build-image/packages.sh +++ b/resources/ubuntu-build-image/packages.sh @@ -25,7 +25,7 @@ dpkg --add-architecture $DEBARCH if [[ "$GNUARCH" == "" ]]; then PACKAGES+=(g++-multilib gcc-multilib) else - PACKAGES+=("libgcc-7-dev:$DEBARCH" "g++-$GNUARCH-linux-gnu" "gcc-$GNUARCH-linux-gnu") + PACKAGES+=("libgcc-9-dev:$DEBARCH" "g++-$GNUARCH-linux-gnu" "gcc-$GNUARCH-linux-gnu") fi; PACKAGES+=( diff --git a/resources/ubuntu-build-image/ports-sources.list b/resources/ubuntu-build-image/ports-sources.list index ccaae6eab..e2a298419 100644 --- a/resources/ubuntu-build-image/ports-sources.list +++ b/resources/ubuntu-build-image/ports-sources.list @@ -1,9 +1,9 @@ -deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse -deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse -deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse -deb [arch=amd64,i386] http://security.ubuntu.com/ubuntu focal-security main restricted universe multiverse +deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse +deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse +deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse +deb [arch=amd64,i386] http://security.ubuntu.com/ubuntu jammy-security main restricted universe multiverse -deb [arch=arm64,ppc64el] http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe multiverse -deb [arch=arm64,ppc64el] http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe multiverse -deb [arch=arm64,ppc64el] http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted universe multiverse -deb [arch=arm64,ppc64el] http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse +deb [arch=arm64,ppc64el] http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe multiverse +deb [arch=arm64,ppc64el] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe multiverse +deb [arch=arm64,ppc64el] http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe multiverse +deb [arch=arm64,ppc64el] http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse From 361ade1ea266311ac905fbf7fb0c9ad233a37d21 Mon Sep 17 00:00:00 2001 From: Ingo Bauersachs Date: Sun, 27 Apr 2025 19:10:56 +0200 Subject: [PATCH 2/7] Update ppc64el patch for vcpkg, update required packages --- resources/ubuntu-build-image/packages.sh | 6 +++- src/native/vcpkg-ppc64el.patch | 46 ++++++++++++------------ 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/resources/ubuntu-build-image/packages.sh b/resources/ubuntu-build-image/packages.sh index d7e112c8a..7adbfdd33 100755 --- a/resources/ubuntu-build-image/packages.sh +++ b/resources/ubuntu-build-image/packages.sh @@ -25,7 +25,7 @@ dpkg --add-architecture $DEBARCH if [[ "$GNUARCH" == "" ]]; then PACKAGES+=(g++-multilib gcc-multilib) else - PACKAGES+=("libgcc-9-dev:$DEBARCH" "g++-$GNUARCH-linux-gnu" "gcc-$GNUARCH-linux-gnu") + PACKAGES+=("crossbuild-essential-${DEBARCH}") fi; PACKAGES+=( @@ -46,6 +46,10 @@ PACKAGES+=( "libxext-dev:$DEBARCH" \ "libxt-dev:$DEBARCH" \ "libxv-dev:$DEBARCH" \ + "libopus-dev:$DEBARCH" \ + "libspeex-dev:$DEBARCH" \ + "libspeexdsp-dev:$DEBARCH" \ + "libvpx-dev:$DEBARCH" \ "openjdk-$JAVA_VERSION-jdk:$DEBARCH") DEBIAN_FRONTEND=noninteractive apt-get update && \ diff --git a/src/native/vcpkg-ppc64el.patch b/src/native/vcpkg-ppc64el.patch index 174bb9ed4..3c9a4e15c 100644 --- a/src/native/vcpkg-ppc64el.patch +++ b/src/native/vcpkg-ppc64el.patch @@ -1,28 +1,28 @@ diff --git a/scripts/toolchains/linux.cmake b/scripts/toolchains/linux.cmake -index 2fac4922d..27653cb8f 100644 +index 4cc47f3f1c..52a657018d 100644 --- a/scripts/toolchains/linux.cmake +++ b/scripts/toolchains/linux.cmake -@@ -44,6 +44,23 @@ elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - endif() - message(STATUS "Cross compiling arm64 on host x86_64, use cross compiler: ${CMAKE_CXX_COMPILER}/${CMAKE_C_COMPILER}") - endif() -+elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "ppc64le") -+ set(CMAKE_SYSTEM_PROCESSOR ppc64le CACHE STRING "") -+ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64") -+ if(NOT DEFINED CMAKE_CXX_COMPILER) -+ set(CMAKE_CXX_COMPILER "powerpc64le-linux-gnu-g++") -+ endif() -+ if(NOT DEFINED CMAKE_C_COMPILER) -+ set(CMAKE_C_COMPILER "powerpc64le-linux-gnu-gcc") -+ endif() -+ if(NOT DEFINED CMAKE_ASM_COMPILER) -+ set(CMAKE_ASM_COMPILER "powerpc64le-linux-gnu-gcc") +@@ -65,6 +65,23 @@ if(NOT _VCPKG_LINUX_TOOLCHAIN) + endif() + message(STATUS "Cross compiling arm64 on host ${CMAKE_HOST_SYSTEM_PROCESSOR}, use cross compiler: ${CMAKE_CXX_COMPILER}/${CMAKE_C_COMPILER}") + endif() ++ elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "ppc64le") ++ set(CMAKE_SYSTEM_PROCESSOR ppc64le CACHE STRING "") ++ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64") ++ if(NOT DEFINED CMAKE_CXX_COMPILER) ++ set(CMAKE_CXX_COMPILER "powerpc64le-linux-gnu-g++") ++ endif() ++ if(NOT DEFINED CMAKE_C_COMPILER) ++ set(CMAKE_C_COMPILER "powerpc64le-linux-gnu-gcc") ++ endif() ++ if(NOT DEFINED CMAKE_ASM_COMPILER) ++ set(CMAKE_ASM_COMPILER "powerpc64le-linux-gnu-gcc") ++ endif() ++ if(NOT DEFINED CMAKE_ASM-ATT_COMPILER) ++ set(CMAKE_ASM-ATT_COMPILER "powerpc64le-linux-gnu-as") ++ endif() ++ message(STATUS "Cross compiling ppc64le on host x86_64, use cross compiler: ${CMAKE_CXX_COMPILER}/${CMAKE_C_COMPILER}") + endif() -+ if(NOT DEFINED CMAKE_ASM-ATT_COMPILER) -+ set(CMAKE_ASM-ATT_COMPILER "powerpc64le-linux-gnu-as") -+ endif() -+ message(STATUS "Cross compiling ppc64le on host x86_64, use cross compiler: ${CMAKE_CXX_COMPILER}/${CMAKE_C_COMPILER}") -+ endif() - endif() + endif() - get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE ) + if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL CMAKE_HOST_SYSTEM_PROCESSOR) From 516ef9f34e2c03019b954749ea1d3832e232382c Mon Sep 17 00:00:00 2001 From: via GitHub Actions Date: Sun, 27 Apr 2025 19:59:05 +0200 Subject: [PATCH 3/7] Use aptitude, prevent sending mails --- resources/sbuildrc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/sbuildrc b/resources/sbuildrc index c99acbf43..e37581600 100644 --- a/resources/sbuildrc +++ b/resources/sbuildrc @@ -2,8 +2,11 @@ $verbose = 1; $batch_mode = 1; $build_dir = $ENV{'BUILD_DIR'}; $run_lintian = 0; -$apt_update = 0; -$apt_distupgrade = 0; +$apt_update = 1; +$apt_distupgrade = 1; +$build_dep_resolver = 'aptitude'; +$mailto = ''; +$mailprog = ''; # don't remove this, Perl needs it: 1; From 453a85cbf0dfae7ba5ff7f4501ab4c9a7dba2614 Mon Sep 17 00:00:00 2001 From: damencho Date: Fri, 31 Oct 2025 10:59:47 -0500 Subject: [PATCH 4/7] Fixes native builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed the single string with spaces to a CMake list with separate quoted arguments. Now each flag will be passed as a separate argument to the compiler. added -mmacosx-version-min=14.0 which tells the compiler to target macOS 14.0, making the CGWindowListCreateImage API available again. This sets the minimum deployment target to macOS 14.0, which is before the API was obsoleted in 15.0. - For ppc64el: Use the toolchain file directly (-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN) and system libraries - For other architectures: Use vcpkg with the chainload toolchain file 1. Debian bookworm arm64 - JNI header issue ✅ - Added JAVA_HOME export and -DJAVA_HOME flag to debian/rules so CMake can properly find jni_md.h 2. Linux ppc64el - vcpkg wrong architecture ✅ - Modified resources/ubuntu-build-image/build-static.sh to use system libraries (USE_SYSTEM_OPUS/SPEEX/VPX=ON) for ppc64el instead of vcpkg, avoiding the cross-compilation issues 3. macOS x86_64 - CGWindowListCreateImage obsolete error ✅ - Added -Wno-unguarded-availability flag in addition to -Wno-deprecated-declarations in src/native/screencapture/CMakeLists.txt to suppress the "unavailable API" error 1. deb-prepare.sh - Added qemu-user-static and binfmt-support packages, which enable running arm64/ppc64el binaries on amd64 through QEMU emulation 2. deb-build.sh - Completely replaced cross-compilation with native builds: - Instead of mk-sbuild --arch=amd64 --target arm64 (cross-compilation), now using mk-sbuild --arch=arm64 (native with QEMU) - Removed all the complex multiarch repository configuration - Removed cross-compilation-specific sbuild flags (--host, --build, cross-resolvers, etc.) - Now using simple sbuild --arch=arm64 which builds natively in a QEMU-emulated chroot I've added --chroot-setup-commands to disable the external solver in the actual build chroot that sbuild uses (which is a temporary copy). This should run before the dependency resolution happens and disable the sbuild-cross-resolver. Completely rewrote the chroot's sources.list (lines 43-56) to have clean, non-duplicate repository configurations with proper architecture restrictions 2. Removed all --extra-repository flags from sbuild commands (line 98-100) since the repositories are now properly configured in the chroot itself 3. Simplified the sbuild command structure - now there's just one command for all non-amd64 architectures 1. Test if the packages can actually be installed with our repository configuration 2. If they can, they'll already be present when sbuild tries to install them, bypassing the broken dependency resolver 3. The || true means we'll see the actual error in the logs if it fails, but continue to let sbuild try anyway Added --bd-uninstallable-explainer=none back to all cross-compilation sbuild commands. This should skip the dose3 dependency checking that was failing. Added line 57 to remove the sbuild-cross-resolver apt config file from the chroot. This should prevent apt from trying to use the external resolver which keeps failing. With this removed, apt should use its internal dependency resolution with the properly configured repositories. Changed both sbuildrc and deb-build.sh to use --build-dep-resolver=apt instead of aptitude. The apt resolver is simpler and doesn't require installing aptitude in the chroot, but with --resolve-alternatives it should still handle the build profile alternatives correctly. resources/deb-prepare.sh:31 - Re-added aptitude package installation (needed for the aptitude resolver) 2. resources/sbuildrc:7 - Changed back to $build_dep_resolver = 'aptitude'; and added $resolve_alternatives = 1; 3. resources/deb-build.sh:82,88,94,99 - Added explicit --build-dep-resolver=aptitude --resolve-alternatives flags to all sbuild commands to force aptitude resolver and enable alternative resolution 1. Used single quotes around the repository line to prevent bash from interpreting the square brackets as glob patterns 2. Split the variable expansion outside quotes: 'deb [arch=arm64,ppc64el] http://... '"${DIST}"' main universe' 3. Added proper handling for i386 (falls through to the else case without extra repos since i386 packages are in the main Ubuntu archive) 4. Inlined the sbuild commands to avoid array expansion issues Fixed. Changed from a string variable to a bash array (EXTRA_REPO_ARGS=()) and used "${EXTRA_REPO_ARGS[@]}" expansion so each --extra-repository argument is properly quoted and passed as a single argument to sbuild. 1. resources/deb-build.sh:78-87 - Added --extra-repository flags to the sbuild command to explicitly configure the Ubuntu Ports repository (or Debian main repository) during the build, ensuring sbuild can fetch arm64/ppc64el packages from the correct source 2. debian/control:11 - Fixed debhelper to use the build profile syntax so it's treated as a native (amd64) build tool during cross-compilation, matching the other build tools 1. Restrict main sources.list to amd64: Added sed commands to prepend [arch=amd64] to all repository entries in the main sources.list, preventing apt from trying to fetch arm64/ppc64el packages from archive.ubuntu.com 2. Added Debian support: Added proper repository configuration for Debian distributions (bookworm, etc.) since Debian keeps arm64 packages in the main repository unlike Ubuntu For arm64 and ppc64el on Ubuntu, packages are hosted on ports.ubuntu.com not the regular archives. I've added: deb [arch=arm64,ppc64el] http://ports.ubuntu.com/ubuntu-ports ${DIST} main universe deb [arch=arm64,ppc64el] http://ports.ubuntu.com/ubuntu-ports ${DIST}-updates main universe This tells apt where to find arm64/ppc64el packages. This syntax: - Fixes amd64 builds (doesn't require :native qualifier) - Fixes cross-compilation (uses :native only when cross-compiling) - Keeps libraries unmarked (so they install for target arch) - Simplified mk-sbuild command - Added manual chroot configuration for multiarch support - Directly runs dpkg --add-architecture and apt-get update in the chroot Simplified mk-sbuild to use --arch=amd64 --target="${ARCH}" which should automatically configure multiarch properly Revert :native qualifiers from debian/control - breaks normal builds Fixed cross-compilation Build-Depends by marking build tools as :native: - libtool:native, cmake:native, git:native, default-jdk:native - Must run on build arch (amd64) - Libraries remain unmarked - Will be installed for target arch (arm64/ppc64el) 1. Added crossbuild-essential-${ARCH} to debootstrap-include - This installs the cross-compilation toolchain during chroot creation - Provides essential packages like crossbuild-essential-arm64 that are needed for cross-compilation 2. Explicitly add target architecture to chroot sudo schroot -c source:"${DIST}"-amd64-"${ARCH}" -u root -- dpkg --add-architecture "${ARCH}" - This ensures dpkg knows about the target architecture (arm64, ppc64el, etc.) - Allows apt to find and install packages for the target architecture 3. Update the chroot after adding architecture sudo sbuild-update -udc "${DIST}"-amd64-"${ARCH}" - Refreshes the package lists so apt can see arm64/ppc64el packages This should fix the "but it is not going to be installed" errors because now: - The chroot will have multiarch support enabled - dpkg will know about the target architecture - apt will be able to find and install arm64/ppc64el versions of the build dependencies Tries to fix deps problems when cross compiling. 1. ✅ Debian dose-distcheck cross-compilation issue - using apt resolver directly 2. ✅ Added --skip-proposed and explicit chroot configuration 3. ✅ Added --build=amd64 --resolve-alternatives flags to sbuild Revert "fix: Modified build-static.sh to use community triplets (community/ppc64le-linux and community/arm64-linux) instead of trying to use non-existent root triplets" This reverts commit 3e784f7a2be13911fdb7cd666ff4f95c52ab795b. fix: Using aspcud instead of apt/dose for dependency resolution fix: Modified build-static.sh to use community triplets (community/ppc64le-linux and community/arm64-linux) instead of trying to use non-existent root triplets The issue was that vcpkg was looking for ppc64le-linux.cmake and arm64-linux.cmake in the root triplets/ directory, but they only exist in triplets/community/. By modifying the build script to reference community/ppc64le-linux for these architectures, vcpkg will now find and use the correct triplet files, which should fix the linking errors where it was building x86_64 libraries instead of ppc64le. squash: Fix apt errors and mac deprecation. --- debian/control | 10 ++--- debian/rules | 3 ++ resources/deb-build.sh | 19 +++++++--- resources/deb-prepare.sh | 5 ++- resources/sbuildrc | 5 ++- resources/ubuntu-build-image/build-static.sh | 40 ++++++++++++++------ src/native/CMakeLists.txt | 5 +++ src/native/screencapture/CMakeLists.txt | 9 +++++ 8 files changed, 71 insertions(+), 25 deletions(-) diff --git a/debian/control b/debian/control index cfd77076f..e4786bc76 100644 --- a/debian/control +++ b/debian/control @@ -8,12 +8,12 @@ Vcs-Git: https://github.com/jitsi/libjitsi.git Vcs-Browser: https://github.com/jitsi/libjitsi Standards-Version: 4.5.0 Build-Depends: - debhelper (>= 11), + debhelper (>= 11) | debhelper:native , dpkg-dev (>= 1.16.1), - libtool, - cmake, - git, - default-jdk, + libtool | libtool:native , + cmake | cmake:native , + git | git:native , + default-jdk | default-jdk:native , libasound2-dev, libpulse-dev, libx11-dev, diff --git a/debian/rules b/debian/rules index 01ca08ca6..4d24453de 100755 --- a/debian/rules +++ b/debian/rules @@ -7,8 +7,11 @@ DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) %: dh $@ -Scmake --sourcedirectory src/native +export JAVA_HOME ?= /usr/lib/jvm/default-java + override_dh_auto_configure: dh_auto_configure -- \ + -DJAVA_HOME="$(JAVA_HOME)" \ -DCMAKE_LIBRARY_ARCHITECTURE="$(DEB_HOST_MULTIARCH)" \ -DCMAKE_INSTALL_LIBDIR="lib/$(DEB_HOST_MULTIARCH)/jni" \ -DJITSI_BUILD_DEBIAN=ON \ diff --git a/resources/deb-build.sh b/resources/deb-build.sh index 2de7a9514..602564512 100755 --- a/resources/deb-build.sh +++ b/resources/deb-build.sh @@ -24,10 +24,18 @@ mkdir -p "${BUILD_DIR}" sudo tee -a /etc/fstab < "${PROJECT_DIR}/resources/sbuild-tmpfs" if [[ "${ARCH}" != "amd64" ]]; then - mk-sbuild "${DIST}" --target "${ARCH}" --type=file --debootstrap-include=ca-certificates || sbuild-update -udc "${DIST}"-amd64-"${ARCH}" + # For non-amd64, set mirror for ports if needed + if [[ "${ARCH}" == "arm64" || "${ARCH}" == "ppc64el" ]]; then + if ubuntu-distro-info --all | grep -Fqxi "${DIST}"; then + export DEBOOTSTRAP_MIRROR=http://ports.ubuntu.com/ubuntu-ports + fi + fi + + # Create native chroot for the target architecture (using QEMU for emulation) + mk-sbuild "${DIST}" --arch="${ARCH}" --type=file --skip-proposed || sbuild-update -udc "${DIST}"-"${ARCH}" # union-type= is not valid for type=file, remove to prevent warnings - sudo sed -i s/union-type=.*//g "/etc/schroot/chroot.d/sbuild-${DIST}-amd64-${ARCH}" + sudo sed -i s/union-type=.*//g "/etc/schroot/chroot.d/sbuild-${DIST}-${ARCH}" else if debian-distro-info --all | grep -Fqxi "${DIST}"; then export DEBOOTSTRAP_MIRROR=${DEBOOTSTRAP_MIRROR:-$UBUNTUTOOLS_DEBIAN_MIRROR} @@ -43,11 +51,12 @@ fi mvn -B versions:set -DnewVersion="${VERSION}" -DgenerateBackupPoms=false "${PROJECT_DIR}/resources/deb-gen-source.sh" "${VERSION}" "${DIST}" export SBUILD_CONFIG="${PROJECT_DIR}/resources/sbuildrc" -if [[ "${ARCH}" != "amd64" ]]; then - sbuild --dist "${DIST}" --no-arch-all --host "${ARCH}" "${PROJECT_DIR}"/../libjitsi_*.dsc -else +if [[ "${ARCH}" == "amd64" ]]; then sbuild --dist "${DIST}" --arch-all "${PROJECT_DIR}"/../libjitsi_*.dsc cp "${PROJECT_DIR}"/../libjitsi_* "$BUILD_DIR" +else + # Native build in QEMU-emulated chroot + sbuild --dist "${DIST}" --no-arch-all --arch="${ARCH}" "${PROJECT_DIR}"/../libjitsi_*.dsc fi debsign -S -e"${GPG_ID}" "${BUILD_DIR}"/*.changes --re-sign -p"${PROJECT_DIR}"/resources/gpg-wrap.sh diff --git a/resources/deb-prepare.sh b/resources/deb-prepare.sh index c5d36f5a4..4b6fe1700 100755 --- a/resources/deb-prepare.sh +++ b/resources/deb-prepare.sh @@ -25,9 +25,12 @@ fi sudo apt-get install -y \ debhelper \ - aptitude \ sbuild \ schroot \ + apt-utils \ + aptitude \ + qemu-user-static \ + binfmt-support \ "$DEVTOOLS_PACKAGE" \ "$UBUNTUTOOLS_PACKAGE" \ debian-archive-keyring \ diff --git a/resources/sbuildrc b/resources/sbuildrc index e37581600..a94d8b811 100644 --- a/resources/sbuildrc +++ b/resources/sbuildrc @@ -3,8 +3,9 @@ $batch_mode = 1; $build_dir = $ENV{'BUILD_DIR'}; $run_lintian = 0; $apt_update = 1; -$apt_distupgrade = 1; -$build_dep_resolver = 'aptitude'; +$apt_distupgrade = 0; +$build_dep_resolver = 'apt'; +$resolve_alternatives = 1; $mailto = ''; $mailprog = ''; diff --git a/resources/ubuntu-build-image/build-static.sh b/resources/ubuntu-build-image/build-static.sh index b492441db..02949e7a6 100755 --- a/resources/ubuntu-build-image/build-static.sh +++ b/resources/ubuntu-build-image/build-static.sh @@ -37,17 +37,33 @@ esac export JAVA_HOME=/usr/lib/jvm/java-$JAVA_VERSION-openjdk-$JAVA_ARCH cd "$LIBROOT/src/native" || exit 1 -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 + +# For ppc64el, vcpkg cross-compilation is broken, use system libraries +if [ "$ARCH" = "ppc64el" ]; then + USE_SYSTEM_LIBS=ON + # When using system libs, we need to use the toolchain directly instead of vcpkg + cmake -B cmake-build-$ARCH \ + -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN \ + -DCMAKE_BUILD_TYPE=release \ + -DCMAKE_C_FLAGS="$CFLAGS" \ + -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ + -DUSE_SYSTEM_OPUS=ON \ + -DUSE_SYSTEM_SPEEX=ON \ + -DUSE_SYSTEM_USRSCTP=OFF \ + -DUSE_SYSTEM_VPX=ON +else + 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 +fi cmake --build cmake-build-$ARCH --config Release --target install --parallel diff --git a/src/native/CMakeLists.txt b/src/native/CMakeLists.txt index fa3f36a5f..3a50dd01e 100644 --- a/src/native/CMakeLists.txt +++ b/src/native/CMakeLists.txt @@ -23,10 +23,15 @@ option(USE_SYSTEM_SPEEX "Use system-installed speex" ${DEFAULT_USE_SYSTEM_SPEEX} option(USE_SYSTEM_VPX "Use system-installed vpx" ${DEFAULT_USE_SYSTEM_VPX}) find_package(Git REQUIRED) +# Apply vcpkg patch, ignore if already applied execute_process( COMMAND "${GIT_EXECUTABLE}" apply --verbose --binary ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg-ppc64el.patch WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg" + RESULT_VARIABLE PATCH_RESULT ) +if(PATCH_RESULT AND NOT PATCH_RESULT EQUAL 0) + message(STATUS "vcpkg patch already applied or not needed") +endif() if (NOT USE_SYSTEM_SPEEX OR NOT USE_SYSTEM_VPX) set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake CACHE STRING "Vcpkg toolchain file") diff --git a/src/native/screencapture/CMakeLists.txt b/src/native/screencapture/CMakeLists.txt index 48b4799aa..ab6833d87 100644 --- a/src/native/screencapture/CMakeLists.txt +++ b/src/native/screencapture/CMakeLists.txt @@ -2,10 +2,15 @@ project(jnscreencapture C) set(OS_SOURCES "") set(OS_LIBS "") +set(MACOS_COMPILE_FLAGS "") if (WIN32) set(OS_SOURCES screencapture.rc) elseif (APPLE) set(OS_LIBS "-framework ApplicationServices") + # CGWindowListCreateImage is deprecated/unavailable in macOS 15.0+ + # Set deployment target to 14.0 to allow using this API + # TODO: Migrate to ScreenCaptureKit for macOS 15+ support + set(MACOS_COMPILE_FLAGS "-mmacosx-version-min=14.0" "-Wno-deprecated-declarations" "-Wno-unguarded-availability") elseif (UNIX AND NOT APPLE) find_package(X11 REQUIRED) if (NOT X11_FOUND) @@ -35,6 +40,10 @@ target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_BINARY_DIR}/include/ ) +if (APPLE) + target_compile_options(${PROJECT_NAME} PRIVATE ${MACOS_COMPILE_FLAGS}) +endif () + if (JITSI_BUILD_DEBIAN) install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) From 97024b7b0197443184bd46b2e6bd7a16fd59d58c Mon Sep 17 00:00:00 2001 From: damencho Date: Sat, 1 Nov 2025 17:59:40 -0500 Subject: [PATCH 5/7] Update portaudio submodule --- src/native/third_party/portaudio | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/third_party/portaudio b/src/native/third_party/portaudio index 09ac94762..e4edf0f98 160000 --- a/src/native/third_party/portaudio +++ b/src/native/third_party/portaudio @@ -1 +1 @@ -Subproject commit 09ac94762ce91fdde41aed82599f328e578bafb2 +Subproject commit e4edf0f9806a6b8a8e143b94edd360bddf9d6aed From 08c1c0de75ca505ac191c8a161194198d577a4e8 Mon Sep 17 00:00:00 2001 From: damencho Date: Sat, 1 Nov 2025 18:07:38 -0500 Subject: [PATCH 6/7] Added -DCMAKE_INSTALL_LIBDIR:PATH=lib to override the Debian multiarch path and force portaudio to install to the expected lib/ directory. --- src/native/portaudio/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/native/portaudio/CMakeLists.txt b/src/native/portaudio/CMakeLists.txt index 272d7cf7d..c13fb8898 100644 --- a/src/native/portaudio/CMakeLists.txt +++ b/src/native/portaudio/CMakeLists.txt @@ -39,6 +39,7 @@ externalproject_add(ext_lib_portaudio -DPA_DLL_LINK_WITH_STATIC_RUNTIME:BOOL=OFF -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON -DCMAKE_INSTALL_PREFIX:PATH= + -DCMAKE_INSTALL_LIBDIR:PATH=lib ) add_library(${PROJECT_NAME} SHARED From 35177bd684bc9639fd18bb78427edd93b1f3e7d4 Mon Sep 17 00:00:00 2001 From: damencho Date: Sat, 1 Nov 2025 19:08:42 -0500 Subject: [PATCH 7/7] Update dependencies Keeps bc as the one used by jvb. --- pom.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 3092ababc..f1e86beda 100644 --- a/pom.xml +++ b/pom.xml @@ -45,7 +45,7 @@ - 1.80 + 1.78.1 UTF-8 @@ -94,12 +94,12 @@ ${project.groupId} jitsi-utils - 1.0-135-g56f462d + 1.0-147-g12d0b20 ${project.groupId} jitsi-srtp - 1.1-20-g3cd87a0 + 1.1-21-g66f32c3 org.opentelecoms.sdp @@ -127,12 +127,12 @@ org.apache.commons commons-lang3 - 3.17.0 + 3.19.0 org.jetbrains annotations - 26.0.2 + 26.0.2-1 provided @@ -140,7 +140,7 @@ org.junit.jupiter junit-jupiter-engine - 5.12.2 + 5.14.0 test @@ -186,7 +186,7 @@ org.codehaus.mojo versions-maven-plugin - 2.18.0 + 2.19.1 @@ -265,7 +265,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.11.2 + 3.12.0 -missing 11