Skip to content

Commit

Permalink
Merge pull request #110 from shiguredo/feature/ubuntu-24.04
Browse files Browse the repository at this point in the history
Ubuntu 24.04 対応
  • Loading branch information
melpon authored Jun 23, 2024
2 parents 731abd0 + f39b4f3 commit ba50651
Show file tree
Hide file tree
Showing 12 changed files with 818 additions and 32 deletions.
91 changes: 64 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,26 @@ jobs:
strategy:
fail-fast: false
matrix:
name:
- ubuntu-20.04_x86_64
- ubuntu-22.04_x86_64
- android
name: Build sora-cpp-sdk for ${{ matrix.name }}
runs-on: ${{ matrix.name == 'ubuntu-22.04_x86_64' && 'ubuntu-22.04' || 'ubuntu-20.04' }}
platform:
- name: ubuntu-20.04_x86_64
runs-on: ubuntu-20.04
os: ubuntu
- name: ubuntu-22.04_x86_64
runs-on: ubuntu-22.04
os: ubuntu
- name: ubuntu-24.04_x86_64
runs-on: ubuntu-24.04
os: ubuntu
- name: android
runs-on: ubuntu-22.04
os: android
name: Build sora-cpp-sdk for ${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.runs-on }}
env:
TEST_SIGNALING_URL: ${{ secrets.TEST_SIGNALING_URL }}
TEST_CHANNEL_ID_PREFIX: ${{ secrets.TEST_CHANNEL_ID_PREFIX }}
TEST_SECRET_KEY: ${{ secrets.TEST_SECRET_KEY }}
TEST_MATRIX_NAME: ${{ matrix.name }}
TEST_MATRIX_NAME: ${{ matrix.platform.name }}
steps:
- uses: actions/checkout@v4
- name: Disk cleanup
Expand All @@ -177,35 +186,60 @@ jobs:
sudo du -h -d1 /usr/local/share
sudo du -h -d1 /usr/local/lib
sudo du -h -d1 /usr/share
docker rmi `docker images -q -a`
RMI=`docker images -q -a`
if [ -n "$RMI" ]; then
docker rmi $RMI
fi
# 4.6G
sudo rm -rf /usr/local/.ghcup
# 1.7G
sudo rm -rf /usr/share/swift
# 1.4G
sudo rm -rf /usr/share/dotnet
df -h
- name: Install deps for ${{ matrix.name }}
if: matrix.name == 'ubuntu-20.04_x86_64' || matrix.name == 'ubuntu-22.04_x86_64'
# Ubuntu 24.04 だと libtinfo5 が見つからない問題があるので、その修正
# ref: https://qiita.com/gengen16k/items/88cf3c18a40a94205fab
- name: Fix CUDA issues for Ubuntu 24.04
if: matrix.platform.name == 'ubuntu-24.04_x86_64'
run: |
sudo tee /etc/apt/sources.list.d/jammy.list << EOF
deb http://archive.ubuntu.com/ubuntu/ jammy universe
EOF
sudo tee /etc/apt/preferences.d/pin-jammy <<EOF
Package: *
Pin: release n=jammy
Pin-Priority: -10
Package: libtinfo5
Pin: release n=jammy
Pin-Priority: 990
EOF
- name: Install deps for ${{ matrix.platform.name }}
if: matrix.platform.os == 'ubuntu'
run: |
source VERSION
# clang-18 と CUDA を入れる
sudo apt-get update
sudo apt-get install -y software-properties-common
# X11
sudo apt-get install libx11-dev libxext-dev
# CUDA
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring_*all.deb
sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo apt-get -y install cuda=$CUDA_VERSION
# clang-18
wget https://apt.llvm.org/llvm.sh
chmod a+x llvm.sh
sudo ./llvm.sh 18
# Intel Media SDK のために libva-dev, libdrm-dev を入れる
DEBIAN_FRONTEND=noninteractive sudo apt-get -y install libva-dev libdrm-dev
- name: Install deps for Android
if: matrix.name == 'android'
if: matrix.platform.os == 'android'
run: |
sudo apt-get -y install ninja-build
# JDK を指定しないとデフォルトの JDK 11 で動作するため指定する
Expand All @@ -214,48 +248,48 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'
if: matrix.name == 'android'
if: matrix.platform.os == 'android'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
if: matrix.name == 'android'
- run: python3 run.py --test --run-e2e-test --package ${{ matrix.name }}
if: matrix.platform.os == 'android'
- run: python3 run.py --test --run-e2e-test --package ${{ matrix.platform.name }}
- name: Get package name
run: |
source _package/${{ matrix.name }}/release/sora.env
source _package/${{ matrix.platform.name }}/release/sora.env
echo "name=${PACKAGE_NAME}" >> $GITHUB_OUTPUT
echo "boost_name=${BOOST_PACKAGE_NAME}" >> $GITHUB_OUTPUT
id: package_name
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.package_name.outputs.name }}
path: _package/${{ matrix.name }}/release/${{ steps.package_name.outputs.name }}
path: _package/${{ matrix.platform.name }}/release/${{ steps.package_name.outputs.name }}
- name: Upload Boost Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.package_name.outputs.boost_name }}
path: _package/${{ matrix.name }}/release/${{ steps.package_name.outputs.boost_name }}
path: _package/${{ matrix.platform.name }}/release/${{ steps.package_name.outputs.boost_name }}
- name: Upload Environment
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}.env
path: _package/${{ matrix.name }}/release/sora.env
name: ${{ matrix.platform.name }}.env
path: _package/${{ matrix.platform.name }}/release/sora.env
# Examples のビルド
- name: Build Examples
run: |
cd examples
mkdir examples_${{ matrix.name }}
mkdir examples_${{ matrix.platform.name }}
for app in sdl_sample sumomo messaging_recvonly_sample; do
python3 $app/${{ matrix.name }}/run.py --local-sora-cpp-sdk-dir ..
cp _build/${{ matrix.name }}/release/$app/$app examples_${{ matrix.name }}
python3 $app/${{ matrix.platform.name }}/run.py --local-sora-cpp-sdk-dir ..
cp _build/${{ matrix.platform.name }}/release/$app/$app examples_${{ matrix.platform.name }}
done
if: matrix.name == 'ubuntu-20.04_x86_64' || matrix.name == 'ubuntu-22.04_x86_64'
if: matrix.platform.os == 'ubuntu'
- name: Upload Examples Artifact
uses: actions/upload-artifact@v4
with:
name: examples_${{ matrix.name }}
path: examples/examples_${{ matrix.name }}
if: matrix.name == 'ubuntu-20.04_x86_64' || matrix.name == 'ubuntu-22.04_x86_64'
name: examples_${{ matrix.platform.name }}
path: examples/examples_${{ matrix.platform.name }}
if: matrix.platform.os == 'ubuntu'

create-release:
name: Create Release
Expand All @@ -282,6 +316,9 @@ jobs:
- uses: ./.github/actions/download
with:
platform: ubuntu-22.04_x86_64
- uses: ./.github/actions/download
with:
platform: ubuntu-24.04_x86_64
- uses: ./.github/actions/download
with:
platform: android
Expand Down
4 changes: 3 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
- @enm10k
- [UPDATE] CLI11 を 2.4.2 にあげる
- @enm10k
- [UPDATE] libwebrtc を m125.6422.2.1 にあげる
- [UPDATE] libwebrtc を m125.6422.2.5 にあげる
- Android の test アプリがリンクできなくなったため、リンカーを Android NDK のものから libwebrtc のものに変更
- リンカーのバージョンの違いによる互換性の問題でエラーが発生していた
- @melpon @enm10k
Expand All @@ -47,6 +47,8 @@
- @melpon
- [ADD] NVIDIA Video Codec SDK を H265 に対応する
- @melpon
- [ADD] Ubuntu 24.04 に対応する
- @melpon

## 2024.6.1 (2024-04-16)

Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ elseif (SORA_TARGET STREQUAL "ubuntu-22.04_x86_64")
set(SORA_TARGET_OS_VERSION "22.04")
set(SORA_TARGET_ARCH "x86_64")
set(SORA_TARGET_DEF "SORA_CPP_SDK_UBUNTU_2204")
elseif (SORA_TARGET STREQUAL "ubuntu-24.04_x86_64")
set(SORA_TARGET_OS "ubuntu")
set(SORA_TARGET_OS_VERSION "24.04")
set(SORA_TARGET_ARCH "x86_64")
set(SORA_TARGET_DEF "SORA_CPP_SDK_UBUNTU_2404")
endif()

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SORA_CPP_SDK_VERSION=2024.7.0-canary.3
WEBRTC_BUILD_VERSION=m125.6422.2.1
WEBRTC_BUILD_VERSION=m125.6422.2.5
BOOST_VERSION=1.85.0
CMAKE_VERSION=3.28.1
CUDA_VERSION=11.8.0-1
Expand Down
2 changes: 1 addition & 1 deletion examples/VERSION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SORA_CPP_SDK_VERSION=2024.7.0-canary.3
WEBRTC_BUILD_VERSION=m125.6422.2.1
WEBRTC_BUILD_VERSION=m125.6422.2.5
BOOST_VERSION=1.85.0
CMAKE_VERSION=3.28.1
SDL2_VERSION=2.30.3
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
cmake_minimum_required(VERSION 3.23)

# Only interpret if() arguments as variables or keywords when unquoted.
cmake_policy(SET CMP0054 NEW)
# MSVC runtime library flags are selected by an abstraction.
cmake_policy(SET CMP0091 NEW)

set(WEBRTC_INCLUDE_DIR "" CACHE PATH "WebRTC のインクルードディレクトリ")
set(WEBRTC_LIBRARY_DIR "" CACHE PATH "WebRTC のライブラリディレクトリ")
set(WEBRTC_LIBRARY_NAME "webrtc" CACHE STRING "WebRTC のライブラリ名")
set(BOOST_ROOT "" CACHE PATH "Boost のルートディレクトリ")
set(SORA_DIR "" CACHE PATH "Sora のルートディレクトリ")
set(CLI11_DIR "" CACHE PATH "CLI11 のルートディレクトリ")

project(sora-sdl-sample C CXX)

list(APPEND CMAKE_PREFIX_PATH ${SORA_DIR})
list(APPEND CMAKE_MODULE_PATH ${SORA_DIR}/share/cmake)

set(Boost_USE_STATIC_LIBS ON)

find_package(Boost REQUIRED COMPONENTS json filesystem)
find_package(WebRTC REQUIRED)
find_package(Sora REQUIRED)
find_package(Threads REQUIRED)
find_package(Libva REQUIRED)
find_package(Libdrm REQUIRED)

add_executable(messaging_recvonly_sample)
set_target_properties(messaging_recvonly_sample PROPERTIES CXX_STANDARD 20 C_STANDARD 20)
set_target_properties(messaging_recvonly_sample PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_sources(messaging_recvonly_sample PRIVATE ../src/messaging_recvonly_sample.cpp)

target_compile_options(messaging_recvonly_sample
PRIVATE
"$<$<COMPILE_LANGUAGE:CXX>:-nostdinc++>"
"$<$<COMPILE_LANGUAGE:CXX>:-isystem${LIBCXX_INCLUDE_DIR}>"
)
target_include_directories(messaging_recvonly_sample PRIVATE ${CLI11_DIR}/include)
target_link_libraries(messaging_recvonly_sample PRIVATE Sora::sora)
target_compile_definitions(messaging_recvonly_sample PRIVATE CLI11_HAS_FILESYSTEM=0)
Loading

0 comments on commit ba50651

Please sign in to comment.