Skip to content

Commit

Permalink
Fixed build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
devopvoid committed Nov 7, 2024
1 parent b64052d commit 617e476
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 24 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
matrix:
platform:
- name: linux_x86-64
runs-on: ubuntu-24.04
runs-on: ubuntu-20.04
java: [17]
runs-on: ${{ matrix.platform.runs-on }}
steps:
Expand Down Expand Up @@ -113,11 +113,12 @@ jobs:
- name: Install required packages
run: |
sudo apt-get update
sudo apt-get install -y findutils libpulse-dev libasound2-dev libudev-dev libv4l-dev libx11-dev binutils cmake git locales lsb-release ninja-build pkg-config python3 python3-setuptools rsync unzip wget xz-utils
sudo apt-get install -y pulseaudio libpulse-dev libasound2-dev libdbus-1-dev libudev-dev libv4l-dev libx11-dev binutils cmake git locales lsb-release ninja-build pkg-config python3 python3-setuptools rsync unzip wget xz-utils
# Required for testing
sudo apt-get install -y pipewire pipewire-pulse gstreamer1.0-pipewire libspa-0.2-bluetooth libspa-0.2-jack pipewire-audio-client-libraries
systemctl --user daemon-reload
systemctl --user --now enable pipewire{,-pulse}.{socket,service}
pulseaudio --start
#sudo apt-get install -y pipewire pipewire-pulse gstreamer1.0-pipewire libspa-0.2-bluetooth libspa-0.2-jack pipewire-audio-client-libraries
#systemctl --user daemon-reload
#systemctl --user --now enable pipewire{,-pulse}.{socket,service}
- id: maven-build
name: Maven build
Expand Down
30 changes: 11 additions & 19 deletions webrtc-jni/src/main/cpp/dependencies/webrtc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,10 @@ function(execute_command)
print("${COMMAND_ERROR}")
endfunction()

function(sysroot_install use_webrtc_root)
function(sysroot_install)
message(STATUS "Installing sysroot")

if(${use_webrtc_root})
set(SCRIPT_PATH ${WEBRTC_SRC_DIR}/src/build/linux/sysroot_scripts/install-sysroot.py)
else()
set(SCRIPT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/linux/sysroot/install-sysroot.py)
endif()
set(SCRIPT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/linux/sysroot/install-sysroot.py)

execute_process(
COMMAND ${Python3_EXECUTABLE} ${SCRIPT_PATH} --arch=${TARGET_CPU}
Expand All @@ -97,14 +93,10 @@ function(sysroot_install use_webrtc_root)
print("${COMMAND_ERROR}")
endfunction()

function(sysroot_link use_webrtc_root)
function(sysroot_link)
message(STATUS "Retrieving libm.so from sysroot")

if(${use_webrtc_root})
set(SYSROOT_PATH ${WEBRTC_SRC_DIR}/src/build/linux)
else()
set(SYSROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/linux)
endif()
set(SYSROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/linux)

execute_process(
COMMAND find ${SYSROOT_PATH} -iname libm-*.so
Expand Down Expand Up @@ -175,17 +167,13 @@ if(EXISTS "${WEBRTC_LIB_PATH}" OR EXISTS "${WEBRTC_LIB_PATH_INSTALLED}")
message(STATUS "WebRTC: Compiled version found '${TARGET_LINK_LIB}'")

if(LINUX)
sysroot_install(FALSE)
sysroot_link(FALSE)
sysroot_install()
sysroot_link()
endif()

return()
endif()

if(LINUX)
sysroot_install(TRUE)
endif()

if(NOT EXISTS "${WEBRTC_SRC_DIR}/depot_tools")
message(STATUS "WebRTC: fetch depot tools")
file(MAKE_DIRECTORY ${WEBRTC_SRC_DIR})
Expand Down Expand Up @@ -221,6 +209,10 @@ execute_command(
WORKING_DIRECTORY "${WEBRTC_DIR}"
)

if(LINUX)
sysroot_install()
endif()

file(GLOB PATCHES "${CMAKE_CURRENT_LIST_DIR}/patches/${SOURCE_TARGET}/*.patch")

if (PATCHES)
Expand Down Expand Up @@ -256,7 +248,7 @@ execute_command(
)

if(LINUX)
sysroot_link(TRUE)
sysroot_link()
endif()

install(FILES "${WEBRTC_LIB_PATH}" DESTINATION "${WEBRTC_INSTALL_DIR}/lib")
Expand Down

0 comments on commit 617e476

Please sign in to comment.