Skip to content

Fix/build script #11

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 8 commits into from
Nov 30, 2024
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
11 changes: 7 additions & 4 deletions .github/workflows/pjsua2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ on:

jobs:
libpjsua2-ios:
runs-on: macos-13
runs-on: self-hosted
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.app

- name: Running Xcode version Is?
run: /usr/bin/xcodebuild -version
Expand All @@ -27,9 +31,8 @@ jobs:
- name: build all ios archs
run: |
brew install nasm autoconf automake libtool swig
sudo mv /Applications/Xcode_15.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
./build h264 opus ssl bcg729 -a=x86_64,arm64
- uses: actions/upload-artifact@v3
with:
name: libpjsua2-ios
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ on:
'*'
jobs:
release:
runs-on: macos-13
runs-on: self-hosted
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.app

- name: Running Xcode version Is?
run: /usr/bin/xcodebuild -version
Expand All @@ -21,11 +26,11 @@ 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
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
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.DS_Store
lib/**/*.a
pjsip/logs/*
pjsip/config_site.h
40 changes: 20 additions & 20 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -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=()

Expand All @@ -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"
Expand Down Expand Up @@ -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 () {
Expand Down Expand Up @@ -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"
}

Expand All @@ -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-sdk=${IOS_SDK_VERSION} --ios-min-sdk=${MIN_IOS_VERSION} --targets="$targets"|| exit

popd > /dev/null
echo "Using SSL..."
Expand Down Expand Up @@ -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
Expand Down
Loading