forked from intermedia-net/pjproject
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27f7fb9
commit c133da6
Showing
10 changed files
with
393 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Check mac X86 os | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build-apple-silicone: | ||
runs-on: macos-13 | ||
permissions: | ||
contents: write | ||
packages: read | ||
steps: | ||
- name: Pre-requirements | ||
run: | | ||
sudo -H pip install setuptools | ||
brew install java | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: checj | ||
run: | | ||
tar -xvzf macOS-x86-release.tar.gz | ||
cd jni | ||
java --version | ||
java Test.java | ||
swig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Linux release | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
|
||
env: | ||
RELEASE_ARCHIVE_NAME: linux-release | ||
|
||
jobs: | ||
build-linux: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
packages: read | ||
steps: | ||
- name: Pre-requirements | ||
run: | | ||
sudo -H pip install setuptools | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Build | ||
run: | | ||
cd build-scripts/mac | ||
export CFLAGS="${CFLAGS} -fPIC" | ||
export CXXFLAGS="${CXXFLAGS} -fPIC" | ||
sudo ./build | ||
- name: Archive artifacts | ||
if: always() | ||
run: | | ||
tar -czvf "$RELEASE_ARCHIVE_NAME".tar.gz -C build-scripts/mac/work/result . | ||
- name: Publish release | ||
if: always() | ||
id: update_release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ github.ref_name }} | ||
artifacts: ${{ env.RELEASE_ARCHIVE_NAME }}.tar.gz | ||
allowUpdates: true | ||
omitNameDuringUpdate: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: MacOs arm64 release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
env: | ||
RELEASE_ARCHIVE_NAME: macOS-arm64-release | ||
|
||
jobs: | ||
build-macos-arm64: | ||
runs-on: macos-14 | ||
permissions: | ||
contents: write | ||
packages: read | ||
steps: | ||
- name: Pre-requirements | ||
run: | | ||
brew install python-setuptools | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Build | ||
run: | | ||
cd build-scripts/mac | ||
sudo ./build | ||
- name: Archive artifacts | ||
if: always() | ||
run: | | ||
ls | ||
tar -czvf "$RELEASE_ARCHIVE_NAME".tar.gz -C build-scripts/mac/work/result . | ||
- name: Publish release | ||
if: always() | ||
id: update_release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ github.ref_name }} | ||
artifacts: ${{ env.RELEASE_ARCHIVE_NAME }}.tar.gz | ||
allowUpdates: true | ||
omitNameDuringUpdate: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: MacOs x86 release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
env: | ||
RELEASE_ARCHIVE_NAME: macOS-x86-release | ||
|
||
jobs: | ||
build-macos-x86: | ||
runs-on: macos-13 | ||
permissions: | ||
contents: write | ||
packages: read | ||
steps: | ||
- name: Pre-requirements | ||
run: | | ||
sudo -H pip install setuptools | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Build | ||
run: | | ||
cd build-scripts/mac | ||
sudo ./build | ||
- name: Archive artifacts | ||
if: always() | ||
run: | | ||
ls | ||
tar -czvf "$RELEASE_ARCHIVE_NAME".tar.gz -C build-scripts/mac/work/result . | ||
- name: Publish release | ||
if: always() | ||
id: update_release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ github.ref_name }} | ||
artifacts: ${{ env.RELEASE_ARCHIVE_NAME }}.tar.gz | ||
allowUpdates: true | ||
omitNameDuringUpdate: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
#!/bin/bash -e | ||
|
||
. config.conf | ||
source ./openssl | ||
source ./opus | ||
source ./swig | ||
|
||
# the paths are relative (!) | ||
WORKING_DIR="work" | ||
PJSUA_SWIG_DIR="pjsip-apps/src/swig" | ||
CONFIG_SITE_PATH="pjlib/include/pj/config_site.h" | ||
|
||
OPUS_DIR="deps/opus" | ||
OPENSSL_DIR="deps/openssl" | ||
SWIG_DIR+="deps/swig" | ||
|
||
function prepareWorkingDir { | ||
rm -rf "$WORKING_DIR/result" | ||
export WORKING_DIR="$PWD/work" | ||
|
||
mkdir -p "$WORKING_DIR" | ||
cd "$WORKING_DIR" | ||
mkdir -p $OPUS_DIR | ||
mkdir -p $OPENSSL_DIR | ||
mkdir -p $SWIG_DIR | ||
mkdir -p result | ||
} | ||
|
||
function installDependencies() { | ||
currentDir=$PWD | ||
echo "openssl-$OPENSSL_VERSION downloading ..." | ||
downloadOpenssl "$OPENSSL_DIR" | ||
cd "$currentDir" | ||
echo "openssl-$OPENSSL_VERSION building ..." | ||
buildOpenssl "$OPENSSL_DIR" | ||
cd "$currentDir" | ||
|
||
echo "opus-$OPUS_VERSION downloading ..." | ||
downloadOpus "$OPUS_DIR" | ||
cd "$currentDir" | ||
echo "opus-$OPUS_VERSION building ..." | ||
buildOpus "$OPUS_DIR" | ||
cd "$currentDir" | ||
|
||
echo "swig-$SWIG_VERSION downloading ..." | ||
downloadSwig "$SWIG_DIR" | ||
cd "$currentDir" | ||
echo "swig-$SWIG_VERSION building ..." | ||
buildAndInstallSwig "$SWIG_DIR" | ||
cd "$currentDir" | ||
} | ||
|
||
function setConfigSite { | ||
echo "#include <pj/config_site_sample.h>" >> "$CONFIG_SITE_PATH" | ||
echo "#define PJMEDIA_HAS_VIDEO 0" >> "$CONFIG_SITE_PATH" | ||
echo "#define PJMEDIA_AUDIO_DEV_HAS_ANDROID_JNI 0" >> "$CONFIG_SITE_PATH" | ||
echo "#define PJMEDIA_AUDIO_DEV_HAS_OPENSL 0" >> "$CONFIG_SITE_PATH" | ||
echo "#define PJSIP_AUTH_AUTO_SEND_NEXT 0" >> "$CONFIG_SITE_PATH" | ||
echo "#define PJMEDIA_HAS_OPUS_CODEC 1" >> "$CONFIG_SITE_PATH" | ||
echo "#define PJSUA_DETECT_MERGED_REQUESTS 0" >> "$CONFIG_SITE_PATH" | ||
|
||
if [ "${ENABLE_IPV6}" == "1" ] | ||
then | ||
echo "#define PJ_HAS_IPV6 1" >> "$CONFIG_SITE_PATH" | ||
fi | ||
} | ||
|
||
function buildPjSip { | ||
|
||
args=( | ||
"--with-opus=$WORKING_DIR/$OPUS_DIR/libs" | ||
"--with-ssl=$WORKING_DIR/$OPENSSL_DIR/libs" | ||
) | ||
|
||
./configure "${args[@]}" | ||
make dep | ||
make clean | ||
make | ||
|
||
cd "${PJSUA_SWIG_DIR}" | ||
make | ||
} | ||
|
||
function moveArtifacts() { | ||
libDir="$WORKING_DIR/result/lib" | ||
includeDir="$WORKING_DIR/result/include" | ||
jniDir="$WORKING_DIR/result/jni" | ||
|
||
mkdir -p "$libDir" | ||
cp -r "pjsip/lib"/* "$libDir" | ||
|
||
mkdir -p "$includeDir/pjlib" | ||
cp -r "pjlib/include"/* "$includeDir/pjlib" | ||
|
||
mkdir -p "$includeDir/pjlib-util" | ||
cp -r "pjlib-util/include"/* "$includeDir/pjlib-util" | ||
|
||
mkdir -p "$includeDir/pjmedia" | ||
cp -r "pjmedia/include"/* "$includeDir/pjmedia" | ||
|
||
mkdir -p "$includeDir/pjnath" | ||
cp -r "pjnath/include"/* "$includeDir/pjnath" | ||
|
||
mkdir -p "$includeDir/pjsip" | ||
cp -r "pjsip/include"/* "$includeDir/pjsip" | ||
mkdir -p "$jniDir" | ||
cp -r "${PJSUA_SWIG_DIR}/java/output"/* "$jniDir" | ||
} | ||
|
||
cd ../../ | ||
projectDir=$PWD | ||
cd build-scripts/mac | ||
echo "Prepare working dir..." | ||
prepareWorkingDir | ||
echo "Install dependencies..." | ||
installDependencies | ||
echo "Set config state..." | ||
cd "$projectDir" | ||
setConfigSite | ||
echo "Building pjsip..." | ||
buildPjSip | ||
cd "$projectDir" | ||
echo "Finalising..." | ||
moveArtifacts | ||
|
||
echo "Finished: check the generated output in $WORKING_DIR/result" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
############################################################################### | ||
############################### SWIG ############################### | ||
############################################################################### | ||
|
||
# SWIG Tool Version to download | ||
SWIG_VERSION=4.2.1 | ||
|
||
# The URL from which to download SWIG sources tar | ||
SWIG_DOWNLOAD_URL="http://prdownloads.sourceforge.net/swig/swig-$SWIG_VERSION.tar.gz" | ||
|
||
|
||
############################################################################### | ||
############################## OPENSSL ############################# | ||
############################################################################### | ||
|
||
# OpenSSL Version to download | ||
# we can not use newer version until https://github.com/openssl/openssl/issues/22414 | ||
OPENSSL_VERSION=3.1.2 | ||
|
||
# The URL from which to download OpenSSL sources tag | ||
OPENSSL_DOWNLOAD_URL="https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz" | ||
|
||
############################################################################### | ||
################################ OPUS ############################### | ||
############################################################################### | ||
|
||
# OPUS Version to download | ||
OPUS_VERSION=1.3.1 | ||
|
||
# The URL of the Opus repository | ||
OPUS_DOWNLOAD_URL="https://archive.mozilla.org/pub/opus/opus-$OPUS_VERSION.tar.gz" | ||
|
||
############################################################################### | ||
####################### PJSIP CONFIGURATION ######################## | ||
############################################################################### | ||
|
||
# Enable IPv6 | ||
# Thanks to @maccadoo and MR#40 | ||
ENABLE_IPV6=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash -e | ||
|
||
. config.conf | ||
|
||
function downloadOpenssl() { | ||
workingDir="$1" | ||
cd "$workingDir" | ||
mkdir -p download | ||
cd download | ||
curl -L -# -o openssl.tar.gz "$OPENSSL_DOWNLOAD_URL" 2>&1 | ||
tar xzf openssl.tar.gz && rm -rf openssl.tar.gz | ||
} | ||
|
||
function buildOpenssl() { | ||
workingDir="$1" | ||
cd "$workingDir" | ||
mkdir -p build | ||
cd build | ||
"../download/openssl-${OPENSSL_VERSION}/Configure" | ||
make | ||
make install | ||
cd ../ | ||
mkdir -p libs/lib | ||
cp build/libssl.a libs/lib | ||
cp build/libcrypto.a libs/lib | ||
cp -r build/include libs | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash -e | ||
|
||
. config.conf | ||
|
||
function downloadOpus() { | ||
workingDir="$1" | ||
cd "$workingDir" | ||
mkdir -p download | ||
cd download | ||
curl -L -# -o opus.tar.gz "$OPUS_DOWNLOAD_URL" 2>&1 | ||
tar xzf opus.tar.gz && rm -rf opus.tar.gz | ||
} | ||
|
||
function buildOpus() { | ||
workingDir="$1" | ||
cd "$workingDir" | ||
|
||
mkdir -p build | ||
cd build | ||
"../download/opus-${OPUS_VERSION}/configure" | ||
make | ||
cd ../ | ||
mkdir -p libs/lib | ||
cp build/.libs/libopus.a libs/lib | ||
cp build/.libs/libopus.la libs/lib | ||
cp build/.libs/libopus.lai libs/lib | ||
mkdir -p libs/include/opus | ||
cp -r "download/opus-${OPUS_VERSION}/include"/* libs/include/opus | ||
} |
Oops, something went wrong.