forked from meta-flutter/meta-flutter
-
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.
-libwebrtc recipe - arm/arm64/x64 -depot_tools: roll version (python 3.11) -gn.py: create VPYTHON_VIRTUALENV_ROOT directory Signed-off-by: Joel Winarske <[email protected]>
- Loading branch information
Showing
8 changed files
with
197 additions
and
7 deletions.
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
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
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
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
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
26 changes: 26 additions & 0 deletions
26
recipes-graphics/libwebrtc/files/add-libwebrtc-target.patch
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,26 @@ | ||
From fb0f7a0e7ab3d5965126e2572fe1e219187e27ee Mon Sep 17 00:00:00 2001 | ||
From: Joel Winarske <[email protected]> | ||
Date: Sat, 2 Nov 2024 20:59:34 -0700 | ||
Subject: [PATCH] add libwebrtc target | ||
|
||
Signed-off-by: Joel Winarske <[email protected]> | ||
--- | ||
BUILD.gn | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/BUILD.gn b/BUILD.gn | ||
index 571049f..d2fce89 100644 | ||
--- a/BUILD.gn | ||
+++ b/BUILD.gn | ||
@@ -38,7 +38,7 @@ if (!build_with_chromium) { | ||
# 'ninja default' and then 'ninja all', the second build should do no work. | ||
group("default") { | ||
testonly = true | ||
- deps = [ ":webrtc" ] | ||
+ deps = [ ":webrtc","//libwebrtc", ] | ||
if (rtc_build_examples) { | ||
deps += [ "examples" ] | ||
} | ||
-- | ||
2.43.5 | ||
|
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,54 @@ | ||
# Copyright 2013 The Chromium Authors | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
import("//build/config/dcheck_always_on.gni") | ||
import("//build/config/ozone.gni") | ||
import("//build/config/sysroot.gni") | ||
import("//build/config/ui.gni") | ||
import("//build/toolchain/gcc_toolchain.gni") | ||
|
||
gcc_toolchain("@GN_TARGET_ARCH_NAME@") { | ||
toolprefix = "@TARGET_SYS@-" | ||
|
||
cc = "${toolprefix}gcc" | ||
cxx = "${toolprefix}g++" | ||
|
||
readelf = "${toolprefix}readelf" | ||
nm = "${toolprefix}nm" | ||
ar = "${toolprefix}ar" | ||
ld = cxx | ||
|
||
toolchain_args = { | ||
current_cpu = "@GN_TARGET_ARCH_NAME@" | ||
current_os = "linux" | ||
|
||
# reclient does not support gcc. | ||
use_remoteexec = false | ||
is_clang = false | ||
} | ||
} | ||
|
||
clang_toolchain("clang_@GN_TARGET_ARCH_NAME@") { | ||
enable_linker_map = true | ||
toolchain_args = { | ||
current_cpu = "@GN_TARGET_ARCH_NAME@" | ||
current_os = "linux" | ||
} | ||
} | ||
|
||
template("clang_v8_toolchain") { | ||
clang_toolchain(target_name) { | ||
toolchain_args = { | ||
current_os = "linux" | ||
forward_variables_from(invoker.toolchain_args, "*") | ||
} | ||
} | ||
} | ||
|
||
clang_v8_toolchain("clang_x86_v8_@GN_TARGET_ARCH_NAME@") { | ||
toolchain_args = { | ||
current_cpu = "x86" | ||
v8_current_cpu = "@GN_TARGET_ARCH_NAME@" | ||
} | ||
} |
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,105 @@ | ||
# | ||
# Copyright (c) 2024 Joel Winarske. All rights reserved. | ||
# | ||
|
||
SUMMARY = "libbrtc" | ||
DESCRIPTION = "A C++ wrapper for binary release, mainly used for \ | ||
flutter-webrtc desktop (windows, linux, embedded)." | ||
AUTHOR = "webrtc team" | ||
HOMEPAGE = "https://github.com/webrtc-sdk/libwebrtc" | ||
BUGTRACKER = "https://github.com/webrtc-sdk/libwebrtc/issues/list" | ||
SECTION = "graphics" | ||
LICENSE = "BSD-3-Clause & MIT" | ||
LIC_FILES_CHKSUM = "\ | ||
file://LICENSE;md5=ad296492125bc71530d06234d9bfebe0 \ | ||
file://libwebrtc/LICENSE;md5=166d54ea842ed1a582dabbd844fa4c80 \ | ||
" | ||
|
||
DEPENDS += "\ | ||
glib-2.0 \ | ||
gtk+3 \ | ||
pipewire \ | ||
" | ||
|
||
SRCREV = "543121ba1cd47780e92d48546b880333265b37b5" | ||
SRC_URI = "\ | ||
gn://github.com/webrtc-sdk/webrtc.git;gn_name=src \ | ||
git://github.com/webrtc-sdk/libwebrtc.git;;protocol=https;lfs=0;branch=main;destsuffix=src/libwebrtc;name=libwebrtc \ | ||
file://add-libwebrtc-target.patch \ | ||
file://toolchain.gn.in \ | ||
" | ||
|
||
SRCREV_FORMAT .= "_libwebrtc" | ||
SRCREV_libwebrtc = "a6522062f83cac380a4544e036114015cf061ffa" | ||
|
||
S = "${WORKDIR}/src" | ||
B = "${WORKDIR}/src/out/Linux-${GN_TARGET_ARCH_NAME}" | ||
|
||
inherit gn-fetcher features_check pkgconfig | ||
|
||
require conf/include/gn-utils.inc | ||
|
||
# For gn.bbclass | ||
EXTRA_GN_SYNC ?= "--shallow --no-history -R -D" | ||
|
||
GN_ARGS = '\ | ||
target_os=\"linux\" \ | ||
target_cpu=\"${GN_TARGET_ARCH_NAME}\" \ | ||
target_triple=\"${TARGET_SYS}\" \ | ||
target_sysroot=\"${STAGING_DIR_TARGET}\" \ | ||
is_debug=false \ | ||
rtc_include_tests=false \ | ||
rtc_use_h264=true \ | ||
ffmpeg_branding=\"Chrome\" \ | ||
is_component_build=false \ | ||
use_rtti=true \ | ||
use_custom_libcxx=true \ | ||
rtc_enable_protobuf=false \ | ||
ozone_auto_platforms=false \ | ||
ozone_platform_wayland=true \ | ||
' | ||
|
||
do_configure() { | ||
|
||
# stage runtime binaries for linking | ||
cd ${STAGING_DIR_TARGET}/usr/lib | ||
|
||
test -e crtbeginS.o && rm crtbeginS.o | ||
test -e crtendS.o && rm crtendS.o | ||
test -e libgcc.a && rm libgcc.a | ||
|
||
ln -s "$(find -iname crtbeginS.o)" crtbeginS.o | ||
ln -s "$(find -iname crtendS.o)" crtendS.o | ||
ln -s "$(find -iname libgcc.a)" libgcc.a | ||
|
||
cd ${S} | ||
|
||
# | ||
# configure toolchain file | ||
# | ||
|
||
cp ${WORKDIR}/toolchain.gn.in ${S}/build/toolchain/linux/BUILD.gn | ||
|
||
sed -i "s|@GN_TARGET_ARCH_NAME@|${GN_TARGET_ARCH_NAME}|g" ${S}/build/toolchain/linux/BUILD.gn | ||
sed -i "s|@TARGET_SYS@|${TARGET_SYS}|g" ${S}/build/toolchain/linux/BUILD.gn | ||
|
||
gn gen "${B}" --args="${GN_ARGS}" | ||
} | ||
|
||
do_compile() { | ||
ninja -C ${B} libwebrtc $PARALLEL_MAKE | ||
} | ||
do_compile[progress] = "outof:^\[(\d+)/(\d+)\]\s+" | ||
|
||
do_install() { | ||
|
||
install -d ${D}${libdir} | ||
install -m 0755 ${B}/libwebrtc.so ${D}${libdir}/libwebrtc.so.${PV} | ||
|
||
cd ${D}${libdir} | ||
ln -sf libwebrtc.so.${PV} libwebrtc.so.125 | ||
ln -sf libwebrtc.so.125 libwebrtc.so | ||
|
||
install -d ${D}${includedir}/libwebrtc | ||
cp -R ${S}/libwebrtc/include/* ${D}${includedir}/libwebrtc | ||
} |