Skip to content

Upgrade pj #14

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

Merged
merged 4 commits into from
Mar 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions .github/workflows/pjsua2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,19 @@ jobs:
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.app

- name: Running Xcode version Is?
run: /usr/bin/xcodebuild -version


- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: build all ios archs
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
- uses: actions/upload-artifact@v3

- uses: actions/upload-artifact@v4
with:
name: libpjsua2-ios
path: ${{ github.workspace }}/libpjsua2
54 changes: 30 additions & 24 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export PATH_REPO="/Users/runner/work/libpjsua2-ios/libpjsua2-ios"
export BASE_DIR=`pwd -P`

export MIN_IOS_VERSION="12.2"
export IOS_SDK_VERSION="18.1"
export IOS_SDK_VERSION="18.2"
export AVAILABLE_ARCHS
export USE_ARCHS=()

Expand All @@ -28,7 +28,7 @@ export ENABLE_ZRTP=false
export HAS_BITCODE=false
export HAS_IPV6=false
export SHOW_HELP=false
export PJSIP_VERSION="2.14.1"
export PJSIP_VERSION="2.15.1"
export PJSIP_BASE_URL="https://github.com/pjsip/pjproject.git"
export PJSIP_DIR="$BASE_DIR/pjsip"
export PJSIP_FINAL_LIB_DIR="$BASE_DIR/lib"
Expand Down Expand Up @@ -205,27 +205,33 @@ function build_bcg729 () {

for arch in ${USE_ARCHS[@]}
do
echo "-- BCG729: Compiling $arch"
if [ "$arch" == "x86_64" ]; then
os_platform="iPhoneSimulator"
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"
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"
os_platform="iPhoneSimulator"
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"
C_FLAGS="$C_FLAGS -O2 -miphoneos-version-min=${MIN_IOS_VERSION} -isysroot ${xcode_dev_path}/Platforms/${os_platform}.platform/Developer/SDKs/${os_platform}.sdk"
fi

rm -rf "${BCG729_BUILD_DIR}/${os_platform}${IOS_SDK_VERSION}-${arch}.sdk"
rm -rf "${BCG729_BUILD_DIR}/CMakeFiles" "${BCG729_BUILD_DIR}/CMakeCache.txt"

# Criar diretório de instalação
mkdir -p "${os_platform}${IOS_SDK_VERSION}-${arch}.sdk"

# Executar o CMake com configurações específicas para iOS
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) \
-DCMAKE_C_COMPILER=$(which clang) \
-DCMAKE_OSX_SYSROOT="${xcode_dev_path}/Platforms/${os_platform}.platform/Developer/SDKs/${os_platform}.sdk" \
.

# Compilar e instalar
make || exit 1
make install
done
}

Expand Down Expand Up @@ -525,11 +531,11 @@ function _build () {
if [ $BCG729_SUPPORT = true ]; then
if [ "$arch" != "i386" ] && [ "$arch" != "x86_64" ]; then
configure="$configure --with-bcg729=${BCG729_BUILD_DIR}/iPhoneOS${IOS_SDK_VERSION}-${arch}.sdk"
export CFLAGS="${CFLAGS} -I${BCG729_BUILD_DIR}/iPhoneOS${IOS_SDK_VERSION}-${arch}.sdk/include/bcg729"
export CFLAGS="${CFLAGS} -I${BCG729_BUILD_DIR}/iPhoneOS${IOS_SDK_VERSION}-${arch}.sdk/include"
export LDFLAGS="${LDFLAGS} -L${BCG729_BUILD_DIR}/iPhoneOS${IOS_SDK_VERSION}-${arch}.sdk/lib"
else
configure="$configure --with-bcg729=${BCG729_BUILD_DIR}/iPhoneSimulator${IOS_SDK_VERSION}-${arch}.sdk"
export CFLAGS="${CFLAGS} -I${BCG729_BUILD_DIR}/iPhoneSimulator${IOS_SDK_VERSION}-${arch}.sdk/include/bcg729"
export CFLAGS="${CFLAGS} -I${BCG729_BUILD_DIR}/iPhoneSimulator${IOS_SDK_VERSION}-${arch}.sdk/include"
export LDFLAGS="${LDFLAGS} -L${BCG729_BUILD_DIR}/iPhoneSimulator${IOS_SDK_VERSION}-${arch}.sdk/lib"
fi
fi
Expand Down
2 changes: 1 addition & 1 deletion pjproject
Submodule pjproject updated 280 files
Loading