From 9729ef0cd03139d72c962894feaac074e1954d69 Mon Sep 17 00:00:00 2001 From: Weslley Date: Sat, 30 Nov 2024 14:03:58 -0300 Subject: [PATCH 1/8] update gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index e43b0f9..4048941 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ .DS_Store +lib/**/*.a +pjsip/logs/* +pjsip/config_site.h From 066d3e762cc0d2647d12ce4ce4fad747ae388e01 Mon Sep 17 00:00:00 2001 From: Weslley Date: Sat, 30 Nov 2024 14:08:30 -0300 Subject: [PATCH 2/8] fix bcg729 build, add curl options to ssl script download the file correctly, upgrade ios sdk version to 18.1, drop 12.1 and below ios sdk version --- build | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/build b/build index fdf6a55..72debe3 100755 --- a/build +++ b/build @@ -12,8 +12,8 @@ export PATH_REPO="/Users/runner/work/libpjsua2-ios/libpjsua2-ios" export BASE_DIR=`pwd -P` -export MIN_IOS_VERSION="11.0" -export IOS_SDK_VERSION="17.2" +export MIN_IOS_VERSION="12.2" +export IOS_SDK_VERSION="18.1" export AVAILABLE_ARCHS export USE_ARCHS=() @@ -208,21 +208,25 @@ function build_bcg729 () { echo "-- BCG729: Compiling $arch" if [ "$arch" == "x86_64" ]; then os_platform="iPhoneSimulator" - mkdir -p "${os_platform}${IOS_SDK_VERSION}-${arch}.sdk" - cmake . -DCMAKE_INSTALL_PREFIX="${os_platform}${IOS_SDK_VERSION}-${arch}.sdk" -DCMAKE_SKIP_INSTALL_RPATH=ON - make C_FLAGS="$C_FLAGS -O2 -m64 -mios-simulator-version-min=${MIN_IOS_VERSION} -isysroot ${xcode_dev_path}/Platforms/${os_platform}.platform/Developer/SDKs/${os_platform}.sdk -march=x86-64" || exit - - else + C_FLAGS="$C_FLAGS -O2 -m64 -mios-simulator-version-min=${MIN_IOS_VERSION} -isysroot ${xcode_dev_path}/Platforms/${os_platform}.platform/Developer/SDKs/${os_platform}.sdk " + else os_platform="iPhoneOS" - mkdir -p "${os_platform}${IOS_SDK_VERSION}-${arch}.sdk" - cmake . -DCMAKE_INSTALL_PREFIX="${os_platform}${IOS_SDK_VERSION}-${arch}.sdk" -DCMAKE_SKIP_INSTALL_RPATH=ON - make C_FLAGS="$C_FLAGS -miphoneos-version-min=${MIN_IOS_VERSION} -isysroot ${xcode_dev_path}/Platforms/${os_platform}.platform/Developer/SDKs/${os_platform}.sdk -march=${arch}" || exit fi + + if [ -d "${BCG729_BUILD_DIR}/${os_platform}${IOS_SDK_VERSION}-${arch}.sdk"] ]; then + rm -rf "${BCG729_BUILD_DIR}/${os_platform}${IOS_SDK_VERSION}-${arch}.sdk" + fi + + if [ -d "${BCG729_BUILD_DIR}/CMakeFiles" ]; then + rm -rf "${BCG729_BUILD_DIR}/CMakeFiles" + rm -rf "${BCG729_BUILD_DIR}/CMakeCache.txt" + fi + mkdir -p "${os_platform}${IOS_SDK_VERSION}-${arch}.sdk" + cmake -DCMAKE_OSX_ARCHITECTURES=${arch} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${os_platform}${IOS_SDK_VERSION}-${arch}.sdk" -DCMAKE_SKIP_INSTALL_RPATH="ON" -DCMAKE_MAKE_PROGRAM:PATH=$(which make) -D CMAKE_C_COMPILER=`which gcc` . + make || exit make install + lipo -info "$BCG729_BUILD_DIR/${os_platform}${IOS_SDK_VERSION}-${arch}.sdk/lib/libbcg729.a" done - lipo -info "$BCG729_BUILD_DIR/iPhoneSimulator17.2-x86_64.sdk/lib/libbcg729.a" - lipo -info "$BCG729_BUILD_DIR/iPhoneOS17.2-arm64.sdk/lib/libbcg729.a" - } function build_h264 () { @@ -261,8 +265,6 @@ function build_h264 () { if [ ! -d "${H264_BUILD_DIR}/lib" ]; then mkdir -p "${H264_BUILD_DIR}/lib" fi - echo "--- Lipo openH264" - xcrun -sdk iphoneos lipo ${h264_lipo_args} -create -output "${H264_BUILD_DIR}/lib/libopenh264.a" || exit echo "Done compiling openh264" } @@ -282,8 +284,8 @@ function build_ssl () { targets="${targets} ios-cross-$arch" fi done - - ./build-libssl.sh --version=1.1.1d --archs="${USE_ARCHS[*]// /\s}" --ios-min-sdk=${MIN_IOS_VERSION} --targets="$targets"|| exit + + CURL_OPTIONS="-L" ./build-libssl.sh --version=1.1.1s --archs="${USE_ARCHS[*]// /\s}" --ios-min-sdk=${MIN_IOS_VERSION} --targets="$targets"|| exit popd > /dev/null echo "Using SSL..." @@ -514,8 +516,6 @@ function _build () { arch=$1 arch_log="$PJSIP_LOGS_DIR/$arch.log" - #clean_pjsip_libs $arch - configure="./configure-iphone" if [ $HAS_BITCODE = true ]; then From 58441a31e6ee1097f0be77cfc5c00d6affef4944 Mon Sep 17 00:00:00 2001 From: Weslley Date: Sat, 30 Nov 2024 15:10:07 -0300 Subject: [PATCH 3/8] disable bitcode by default --- build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build b/build index 72debe3..f5c99a0 100755 --- a/build +++ b/build @@ -25,7 +25,7 @@ export H264_SUPPORT=false export BCG729_SUPPORT=false export INDEPENDENT_WEBRTC=false export ENABLE_ZRTP=false -export HAS_BITCODE=true +export HAS_BITCODE=false export HAS_IPV6=false export SHOW_HELP=false export PJSIP_VERSION="2.14.1" From f54dd5ca083587bd95cda993b5c7f32b5ce7b95e Mon Sep 17 00:00:00 2001 From: Weslley Date: Sat, 30 Nov 2024 16:38:19 -0300 Subject: [PATCH 4/8] upgrade xcode version on workflows --- .github/workflows/pjsua2.yml | 10 +++++++--- .github/workflows/release.yml | 16 +++++++++++----- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pjsua2.yml b/.github/workflows/pjsua2.yml index 494afd0..e99ce0f 100644 --- a/.github/workflows/pjsua2.yml +++ b/.github/workflows/pjsua2.yml @@ -9,13 +9,17 @@ on: jobs: libpjsua2-ios: - runs-on: macos-13 + runs-on: macos-latest name: iOS Build permissions: contents: write steps: + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + - name: Selecting Xcode Version - run: sudo xcode-select -switch /Applications/Xcode_15.2.app + run: sudo xcode-select -switch /Applications/Xcode_16.1.app - name: Running Xcode version Is? run: /usr/bin/xcodebuild -version @@ -27,7 +31,7 @@ jobs: - name: build all ios archs run: | brew install nasm autoconf automake libtool swig - sudo mv /Applications/Xcode_15.1.app /Applications/Xcode.app + sudo mv /Applications/Xcode_16.1.app /Applications/Xcode.app sed -i'' -e 's/xamarin/maui/g' ${{ github.workspace }}/pjproject/pjsip-apps/src/swig/csharp/Makefile ./build h264 opus ssl bcg729 -a=x86_64,arm64 --ci - uses: actions/upload-artifact@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e9ade4..845fe8e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,12 +7,17 @@ on: '*' jobs: release: - runs-on: macos-13 + runs-on: macos-latest + name: iOS Build permissions: - contents: write - steps: + contents: write + steps: + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + - name: Selecting Xcode Version - run: sudo xcode-select -switch /Applications/Xcode_15.2.app + run: sudo xcode-select -switch /Applications/Xcode_16.1.app - name: Running Xcode version Is? run: /usr/bin/xcodebuild -version @@ -21,9 +26,10 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive - - name: build pjsip with opus and h264 + - name: build pjsip with opus bcg729 and h264 run: | brew install nasm autoconf automake libtool swig + sudo mv /Applications/Xcode_16.1.app /Applications/Xcode.app sed -i'' -e 's/xamarin/maui/g' ${{ github.workspace }}/pjproject/pjsip-apps/src/swig/csharp/Makefile ./build h264 opus ssl bcg729 -a=x86_64,arm64 --ci tar -zcvf libpjsua2.tar.gz ./libpjsua2 From 71d145184b31c4fe7d6695fa529f2ebb1657b3cb Mon Sep 17 00:00:00 2001 From: Weslley Date: Sat, 30 Nov 2024 16:50:46 -0300 Subject: [PATCH 5/8] Added sdk version to ssl build script call --- build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build b/build index f5c99a0..777ef30 100755 --- a/build +++ b/build @@ -285,7 +285,7 @@ function build_ssl () { fi done - CURL_OPTIONS="-L" ./build-libssl.sh --version=1.1.1s --archs="${USE_ARCHS[*]// /\s}" --ios-min-sdk=${MIN_IOS_VERSION} --targets="$targets"|| exit + CURL_OPTIONS="-L" ./build-libssl.sh --version=1.1.1s --archs="${USE_ARCHS[*]// /\s}" --ios-sdk=${IOS_SDK_VERSION} --ios-min-sdk=${MIN_IOS_VERSION} --targets="$targets"|| exit popd > /dev/null echo "Using SSL..." From 38a56e49d0fb4b0fdc5b6b51c07651a5d80b4c11 Mon Sep 17 00:00:00 2001 From: Weslley Date: Sat, 30 Nov 2024 17:08:34 -0300 Subject: [PATCH 6/8] switch to self hosted runners --- .github/workflows/pjsua2.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pjsua2.yml b/.github/workflows/pjsua2.yml index e99ce0f..242ad0e 100644 --- a/.github/workflows/pjsua2.yml +++ b/.github/workflows/pjsua2.yml @@ -9,7 +9,7 @@ on: jobs: libpjsua2-ios: - runs-on: macos-latest + runs-on: self-hosted name: iOS Build permissions: contents: write diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 845fe8e..1fc2e32 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: '*' jobs: release: - runs-on: macos-latest + runs-on: self-hosted name: iOS Build permissions: contents: write From 8c7669aa79ecbb0a10e99181d31eae1b32475636 Mon Sep 17 00:00:00 2001 From: Weslley Date: Sat, 30 Nov 2024 17:11:16 -0300 Subject: [PATCH 7/8] fix xcode path and remove rename file command --- .github/workflows/pjsua2.yml | 3 +-- .github/workflows/release.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pjsua2.yml b/.github/workflows/pjsua2.yml index 242ad0e..c87c21e 100644 --- a/.github/workflows/pjsua2.yml +++ b/.github/workflows/pjsua2.yml @@ -19,7 +19,7 @@ jobs: xcode-version: latest-stable - name: Selecting Xcode Version - run: sudo xcode-select -switch /Applications/Xcode_16.1.app + run: sudo xcode-select -switch /Applications/Xcode.app - name: Running Xcode version Is? run: /usr/bin/xcodebuild -version @@ -31,7 +31,6 @@ jobs: - name: build all ios archs run: | brew install nasm autoconf automake libtool swig - sudo mv /Applications/Xcode_16.1.app /Applications/Xcode.app sed -i'' -e 's/xamarin/maui/g' ${{ github.workspace }}/pjproject/pjsip-apps/src/swig/csharp/Makefile ./build h264 opus ssl bcg729 -a=x86_64,arm64 --ci - uses: actions/upload-artifact@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1fc2e32..50f799b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: xcode-version: latest-stable - name: Selecting Xcode Version - run: sudo xcode-select -switch /Applications/Xcode_16.1.app + run: sudo xcode-select -switch /Applications/Xcode.app - name: Running Xcode version Is? run: /usr/bin/xcodebuild -version @@ -29,7 +29,6 @@ jobs: - name: build pjsip with opus bcg729 and h264 run: | brew install nasm autoconf automake libtool swig - sudo mv /Applications/Xcode_16.1.app /Applications/Xcode.app sed -i'' -e 's/xamarin/maui/g' ${{ github.workspace }}/pjproject/pjsip-apps/src/swig/csharp/Makefile ./build h264 opus ssl bcg729 -a=x86_64,arm64 --ci tar -zcvf libpjsua2.tar.gz ./libpjsua2 From 8043309eb33bc4dcae4febb53244bff36c8c27af Mon Sep 17 00:00:00 2001 From: Weslley Date: Sat, 30 Nov 2024 17:30:13 -0300 Subject: [PATCH 8/8] remove --ci flag of build since the run is self hosted --- .github/workflows/pjsua2.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pjsua2.yml b/.github/workflows/pjsua2.yml index c87c21e..4aaba17 100644 --- a/.github/workflows/pjsua2.yml +++ b/.github/workflows/pjsua2.yml @@ -32,7 +32,7 @@ jobs: run: | brew install nasm autoconf automake libtool swig sed -i'' -e 's/xamarin/maui/g' ${{ github.workspace }}/pjproject/pjsip-apps/src/swig/csharp/Makefile - ./build h264 opus ssl bcg729 -a=x86_64,arm64 --ci + ./build h264 opus ssl bcg729 -a=x86_64,arm64 - uses: actions/upload-artifact@v3 with: name: libpjsua2-ios diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 50f799b..f665da3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,7 @@ jobs: run: | brew install nasm autoconf automake libtool swig sed -i'' -e 's/xamarin/maui/g' ${{ github.workspace }}/pjproject/pjsip-apps/src/swig/csharp/Makefile - ./build h264 opus ssl bcg729 -a=x86_64,arm64 --ci + ./build h264 opus ssl bcg729 -a=x86_64,arm64 tar -zcvf libpjsua2.tar.gz ./libpjsua2 - name: release uses: actions/create-release@v1