Skip to content

Commit 5a32449

Browse files
Merge pull request #11 from weslleymurdock/fix/build-script
Fix/build script
2 parents ffb9b26 + 8043309 commit 5a32449

File tree

4 files changed

+41
-30
lines changed

4 files changed

+41
-30
lines changed

.github/workflows/pjsua2.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ on:
99

1010
jobs:
1111
libpjsua2-ios:
12-
runs-on: macos-13
12+
runs-on: self-hosted
1313
name: iOS Build
1414
permissions:
1515
contents: write
1616
steps:
17+
- uses: maxim-lobanov/setup-xcode@v1
18+
with:
19+
xcode-version: latest-stable
20+
1721
- name: Selecting Xcode Version
18-
run: sudo xcode-select -switch /Applications/Xcode_15.2.app
22+
run: sudo xcode-select -switch /Applications/Xcode.app
1923

2024
- name: Running Xcode version Is?
2125
run: /usr/bin/xcodebuild -version
@@ -27,9 +31,8 @@ jobs:
2731
- name: build all ios archs
2832
run: |
2933
brew install nasm autoconf automake libtool swig
30-
sudo mv /Applications/Xcode_15.1.app /Applications/Xcode.app
3134
sed -i'' -e 's/xamarin/maui/g' ${{ github.workspace }}/pjproject/pjsip-apps/src/swig/csharp/Makefile
32-
./build h264 opus ssl bcg729 -a=x86_64,arm64 --ci
35+
./build h264 opus ssl bcg729 -a=x86_64,arm64
3336
- uses: actions/upload-artifact@v3
3437
with:
3538
name: libpjsua2-ios

.github/workflows/release.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ on:
77
'*'
88
jobs:
99
release:
10-
runs-on: macos-13
10+
runs-on: self-hosted
11+
name: iOS Build
1112
permissions:
12-
contents: write
13-
steps:
13+
contents: write
14+
steps:
15+
- uses: maxim-lobanov/setup-xcode@v1
16+
with:
17+
xcode-version: latest-stable
18+
1419
- name: Selecting Xcode Version
15-
run: sudo xcode-select -switch /Applications/Xcode_15.2.app
20+
run: sudo xcode-select -switch /Applications/Xcode.app
1621

1722
- name: Running Xcode version Is?
1823
run: /usr/bin/xcodebuild -version
@@ -21,11 +26,11 @@ jobs:
2126
uses: actions/checkout@v4
2227
with:
2328
submodules: recursive
24-
- name: build pjsip with opus and h264
29+
- name: build pjsip with opus bcg729 and h264
2530
run: |
2631
brew install nasm autoconf automake libtool swig
2732
sed -i'' -e 's/xamarin/maui/g' ${{ github.workspace }}/pjproject/pjsip-apps/src/swig/csharp/Makefile
28-
./build h264 opus ssl bcg729 -a=x86_64,arm64 --ci
33+
./build h264 opus ssl bcg729 -a=x86_64,arm64
2934
tar -zcvf libpjsua2.tar.gz ./libpjsua2
3035
- name: release
3136
uses: actions/create-release@v1

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
.DS_Store
2+
lib/**/*.a
3+
pjsip/logs/*
4+
pjsip/config_site.h

build

+20-20
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ export PATH_REPO="/Users/runner/work/libpjsua2-ios/libpjsua2-ios"
1212

1313
export BASE_DIR=`pwd -P`
1414

15-
export MIN_IOS_VERSION="11.0"
16-
export IOS_SDK_VERSION="17.2"
15+
export MIN_IOS_VERSION="12.2"
16+
export IOS_SDK_VERSION="18.1"
1717
export AVAILABLE_ARCHS
1818
export USE_ARCHS=()
1919

@@ -25,7 +25,7 @@ export H264_SUPPORT=false
2525
export BCG729_SUPPORT=false
2626
export INDEPENDENT_WEBRTC=false
2727
export ENABLE_ZRTP=false
28-
export HAS_BITCODE=true
28+
export HAS_BITCODE=false
2929
export HAS_IPV6=false
3030
export SHOW_HELP=false
3131
export PJSIP_VERSION="2.14.1"
@@ -208,21 +208,25 @@ function build_bcg729 () {
208208
echo "-- BCG729: Compiling $arch"
209209
if [ "$arch" == "x86_64" ]; then
210210
os_platform="iPhoneSimulator"
211-
mkdir -p "${os_platform}${IOS_SDK_VERSION}-${arch}.sdk"
212-
cmake . -DCMAKE_INSTALL_PREFIX="${os_platform}${IOS_SDK_VERSION}-${arch}.sdk" -DCMAKE_SKIP_INSTALL_RPATH=ON
213-
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
214-
215-
else
211+
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 "
212+
else
216213
os_platform="iPhoneOS"
217-
mkdir -p "${os_platform}${IOS_SDK_VERSION}-${arch}.sdk"
218-
cmake . -DCMAKE_INSTALL_PREFIX="${os_platform}${IOS_SDK_VERSION}-${arch}.sdk" -DCMAKE_SKIP_INSTALL_RPATH=ON
219-
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
220214
fi
215+
216+
if [ -d "${BCG729_BUILD_DIR}/${os_platform}${IOS_SDK_VERSION}-${arch}.sdk"] ]; then
217+
rm -rf "${BCG729_BUILD_DIR}/${os_platform}${IOS_SDK_VERSION}-${arch}.sdk"
218+
fi
219+
220+
if [ -d "${BCG729_BUILD_DIR}/CMakeFiles" ]; then
221+
rm -rf "${BCG729_BUILD_DIR}/CMakeFiles"
222+
rm -rf "${BCG729_BUILD_DIR}/CMakeCache.txt"
223+
fi
224+
mkdir -p "${os_platform}${IOS_SDK_VERSION}-${arch}.sdk"
225+
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` .
226+
make || exit
221227
make install
228+
lipo -info "$BCG729_BUILD_DIR/${os_platform}${IOS_SDK_VERSION}-${arch}.sdk/lib/libbcg729.a"
222229
done
223-
lipo -info "$BCG729_BUILD_DIR/iPhoneSimulator17.2-x86_64.sdk/lib/libbcg729.a"
224-
lipo -info "$BCG729_BUILD_DIR/iPhoneOS17.2-arm64.sdk/lib/libbcg729.a"
225-
226230
}
227231

228232
function build_h264 () {
@@ -261,8 +265,6 @@ function build_h264 () {
261265
if [ ! -d "${H264_BUILD_DIR}/lib" ]; then
262266
mkdir -p "${H264_BUILD_DIR}/lib"
263267
fi
264-
echo "--- Lipo openH264"
265-
xcrun -sdk iphoneos lipo ${h264_lipo_args} -create -output "${H264_BUILD_DIR}/lib/libopenh264.a" || exit
266268
echo "Done compiling openh264"
267269
}
268270

@@ -282,8 +284,8 @@ function build_ssl () {
282284
targets="${targets} ios-cross-$arch"
283285
fi
284286
done
285-
286-
./build-libssl.sh --version=1.1.1d --archs="${USE_ARCHS[*]// /\s}" --ios-min-sdk=${MIN_IOS_VERSION} --targets="$targets"|| exit
287+
288+
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
287289

288290
popd > /dev/null
289291
echo "Using SSL..."
@@ -514,8 +516,6 @@ function _build () {
514516
arch=$1
515517
arch_log="$PJSIP_LOGS_DIR/$arch.log"
516518

517-
#clean_pjsip_libs $arch
518-
519519
configure="./configure-iphone"
520520

521521
if [ $HAS_BITCODE = true ]; then

0 commit comments

Comments
 (0)