-
Notifications
You must be signed in to change notification settings - Fork 29
Fix Apple and Android tools for m137 #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pblazej
wants to merge
16
commits into
main
Choose a base branch
from
blaze/m137-patching
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c9dc603
Fix mocks patch
pblazej 0497c0c
Use autoninja everywhere
pblazej ce49b4f
Old apple infra
pblazej 4cf38df
Fix mac build, upload
pblazej 8319698
Update jni_prefix.patch for m137
davidliu c135d29
Update version and set commit to 137 branch for testing
davidliu b1b5fef
Full Apple script
pblazej cce6a92
Fix paths
pblazej b0ea15f
Pass framework name
pblazej 537fc6c
Absolute paths
pblazej f18bbb5
Revert: iOS only
pblazej e43106a
Fix paths alt
pblazej a0baabc
Other platforms
pblazej 3f158cc
Fix artifact name
pblazej c7010dc
Shellcheck
pblazej 9c832f8
Fix constant prefix
pblazej File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
WEBRTC_BUILD_VERSION=125.6422.07.0 | ||
WEBRTC_VERSION=125.6422.07 | ||
WEBRTC_READABLE_VERSION=M125.6422@{#7} | ||
WEBRTC_COMMIT=c4b376ac375710de19c1ba20157dba9b065930b0 | ||
WEBRTC_BUILD_VERSION=137.7151.00.0 | ||
WEBRTC_VERSION=137.7151.00 | ||
WEBRTC_READABLE_VERSION=M137.7151@{#0} | ||
WEBRTC_COMMIT=blaze/m137-patching |
This file contains hidden or 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,151 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [[ -z "$1" ]]; then | ||
echo "Usage: $0 'debug' | 'release' 'source_dir' 'out_dir' ['prefix']" | ||
exit 0 | ||
fi | ||
|
||
MODE="$1" | ||
SOURCE_DIR="$(realpath "$2")" | ||
OUT_DIR="$(realpath "$3")" | ||
PREFIX="${4:-""}" | ||
|
||
if [ -z "$PREFIX" ]; then | ||
FRAMEWORK_NAME="WebRTC" | ||
else | ||
FRAMEWORK_NAME="${PREFIX}WebRTC" | ||
fi | ||
|
||
DEBUG="false" | ||
if [[ "$MODE" == "debug" ]]; then | ||
DEBUG="true" | ||
fi | ||
|
||
PARALLEL_BUILDS=6 | ||
|
||
echo "xcframework.sh: MODE=$MODE, DEBUG=$DEBUG, SOURCE_DIR=$SOURCE_DIR, OUT_DIR=$OUT_DIR, PREFIX=$PREFIX, FRAMEWORK_NAME=$FRAMEWORK_NAME" | ||
|
||
start_group() { | ||
if [[ "$CI" == "true" ]]; then | ||
echo "::group::$1" | ||
else | ||
echo "=== $1 ===" | ||
fi | ||
} | ||
|
||
end_group() { | ||
if [[ "$CI" == "true" ]]; then | ||
echo "::endgroup::" | ||
fi | ||
} | ||
|
||
COMMON_ARGS=" | ||
treat_warnings_as_errors = false | ||
ios_enable_code_signing = false | ||
is_component_build = false | ||
rtc_enable_symbol_export = true | ||
rtc_libvpx_build_vp9 = true | ||
rtc_include_tests = false | ||
rtc_build_examples = false | ||
rtc_use_h264 = false | ||
rtc_enable_protobuf = false | ||
enable_libaom = true | ||
rtc_include_dav1d_in_internal_decoder_factory = true | ||
use_rtti = true | ||
is_debug = $DEBUG | ||
enable_dsyms = $DEBUG | ||
enable_stripping = true" | ||
|
||
PLATFORMS=( | ||
"iOS-arm64-device:target_os=\"ios\" target_environment=\"device\" target_cpu=\"arm64\" ios_deployment_target=\"13.0\"" | ||
"iOS-arm64-simulator:target_os=\"ios\" target_environment=\"simulator\" target_cpu=\"arm64\" ios_deployment_target=\"13.0\"" | ||
"iOS-x64-simulator:target_os=\"ios\" target_environment=\"simulator\" target_cpu=\"x64\" ios_deployment_target=\"13.0\"" | ||
"macOS-arm64:target_os=\"mac\" target_cpu=\"arm64\" mac_deployment_target=\"10.15\"" | ||
"macOS-x64:target_os=\"mac\" target_cpu=\"x64\" mac_deployment_target=\"10.15\"" | ||
"catalyst-arm64:target_os=\"ios\" target_environment=\"catalyst\" target_cpu=\"arm64\" ios_deployment_target=\"14.0\"" | ||
"catalyst-x64:target_os=\"ios\" target_environment=\"catalyst\" target_cpu=\"x64\" ios_deployment_target=\"14.0\"" | ||
"tvOS-arm64-device:target_os=\"ios\" target_environment=\"appletv\" target_cpu=\"arm64\" ios_deployment_target=\"17.0\"" | ||
"tvOS-arm64-simulator:target_os=\"ios\" target_environment=\"appletvsimulator\" target_cpu=\"arm64\" ios_deployment_target=\"17.0\"" | ||
"xrOS-arm64-device:target_os=\"ios\" target_environment=\"xrdevice\" target_cpu=\"arm64\" ios_deployment_target=\"2.2.0\"" | ||
"xrOS-arm64-simulator:target_os=\"ios\" target_environment=\"xrsimulator\" target_cpu=\"arm64\" ios_deployment_target=\"2.2.0\"" | ||
) | ||
|
||
cd "$SOURCE_DIR" | ||
|
||
end_group | ||
|
||
for platform_config in "${PLATFORMS[@]}"; do | ||
platform="${platform_config%%:*}" | ||
config="${platform_config#*:}" | ||
|
||
start_group "Building $platform" | ||
|
||
gn gen "$OUT_DIR/$platform" --args="$COMMON_ARGS $config" --ide=xcode | ||
|
||
if [[ $platform == *"macOS"* ]]; then | ||
build_target="mac_framework_bundle" | ||
else | ||
build_target="ios_framework_bundle" | ||
fi | ||
|
||
ninja -C "$OUT_DIR/$platform" "$build_target" -j $PARALLEL_BUILDS --quiet || exit 1 | ||
end_group | ||
done | ||
|
||
start_group "Creating universal binaries (x64 + arm64)" | ||
|
||
mkdir -p "$OUT_DIR/macOS-lib" | ||
cp -R "$OUT_DIR/macOS-x64/$FRAMEWORK_NAME.framework" "$OUT_DIR/macOS-lib/$FRAMEWORK_NAME.framework" | ||
lipo -create -output "$OUT_DIR/macOS-lib/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" "$OUT_DIR/macOS-arm64/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" "$OUT_DIR/macOS-x64/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" | ||
|
||
mkdir -p "$OUT_DIR/catalyst-lib" | ||
cp -R "$OUT_DIR/catalyst-arm64/$FRAMEWORK_NAME.framework" "$OUT_DIR/catalyst-lib/$FRAMEWORK_NAME.framework" | ||
lipo -create -output "$OUT_DIR/catalyst-lib/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" "$OUT_DIR/catalyst-arm64/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" "$OUT_DIR/catalyst-x64/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" | ||
|
||
mkdir -p "$OUT_DIR/iOS-device-lib" | ||
cp -R "$OUT_DIR/iOS-arm64-device/$FRAMEWORK_NAME.framework" "$OUT_DIR/iOS-device-lib/$FRAMEWORK_NAME.framework" | ||
lipo -create -output "$OUT_DIR/iOS-device-lib/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" "$OUT_DIR/iOS-arm64-device/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" | ||
|
||
mkdir -p "$OUT_DIR/iOS-simulator-lib" | ||
cp -R "$OUT_DIR/iOS-arm64-simulator/$FRAMEWORK_NAME.framework" "$OUT_DIR/iOS-simulator-lib/$FRAMEWORK_NAME.framework" | ||
lipo -create -output "$OUT_DIR/iOS-simulator-lib/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" "$OUT_DIR/iOS-arm64-simulator/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" "$OUT_DIR/iOS-x64-simulator/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" | ||
|
||
end_group | ||
|
||
start_group "Creating XCFramework" | ||
|
||
xcodebuild -create-xcframework \ | ||
-framework "$OUT_DIR/iOS-device-lib/$FRAMEWORK_NAME.framework" \ | ||
-framework "$OUT_DIR/iOS-simulator-lib/$FRAMEWORK_NAME.framework" \ | ||
-framework "$OUT_DIR/macOS-lib/$FRAMEWORK_NAME.framework" \ | ||
-framework "$OUT_DIR/catalyst-lib/$FRAMEWORK_NAME.framework" \ | ||
-framework "$OUT_DIR/tvOS-arm64-device/$FRAMEWORK_NAME.framework" \ | ||
-framework "$OUT_DIR/tvOS-arm64-simulator/$FRAMEWORK_NAME.framework" \ | ||
-framework "$OUT_DIR/xrOS-arm64-device/$FRAMEWORK_NAME.framework" \ | ||
-framework "$OUT_DIR/xrOS-arm64-simulator/$FRAMEWORK_NAME.framework" \ | ||
-output "$OUT_DIR/$FRAMEWORK_NAME.xcframework" | ||
|
||
end_group | ||
|
||
start_group "Post-processing XCFramework" | ||
|
||
cp LICENSE "$OUT_DIR/$FRAMEWORK_NAME.xcframework/" | ||
|
||
cd "$OUT_DIR/$FRAMEWORK_NAME.xcframework/macos-arm64_x86_64/$FRAMEWORK_NAME.framework/" | ||
mv "$FRAMEWORK_NAME" "Versions/A/$FRAMEWORK_NAME" | ||
ln -s "Versions/Current/$FRAMEWORK_NAME" "$FRAMEWORK_NAME" | ||
|
||
cd "$OUT_DIR/$FRAMEWORK_NAME.xcframework/ios-arm64_x86_64-maccatalyst/$FRAMEWORK_NAME.framework/" | ||
mv "$FRAMEWORK_NAME" "Versions/A/$FRAMEWORK_NAME" | ||
ln -s "Versions/Current/$FRAMEWORK_NAME" "$FRAMEWORK_NAME" | ||
|
||
cd "$OUT_DIR" | ||
zip --symlinks -9 -r "$FRAMEWORK_NAME.xcframework.zip" "$FRAMEWORK_NAME.xcframework" | ||
|
||
end_group | ||
|
||
if [[ "$CI" == "true" ]]; then | ||
echo "framework_name=$FRAMEWORK_NAME" >> "$GITHUB_OUTPUT" | ||
fi |
This file contains hidden or 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,10 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
cd `dirname $0` | ||
python3 run.py build apple --commit "$1" --webrtc-fetch | ||
|
||
export PATH="$PWD/_source/apple/depot_tools:$PATH" | ||
mkdir -p _package/apple | ||
. apple/xcframework.sh release _source/apple/webrtc/src _package/apple |
This file contains hidden or 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,10 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
cd `dirname $0` | ||
python3 run.py build apple_prefixed --commit "$1" --webrtc-fetch | ||
|
||
export PATH="$PWD/_source/apple_prefixed/depot_tools:$PATH" | ||
mkdir -p _package/apple_prefixed | ||
. apple/xcframework.sh release _source/apple_prefixed/webrtc/src _package/apple_prefixed LiveKit # prefix |
This file contains hidden or 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,124 @@ | ||
diff --git forkSrcPrefix/sdk/objc/base/RTCMacros.h forkDstPrefix/sdk/objc/base/RTCMacros.h | ||
index 09418b86ac77a1a1dc8672775ce05bca0061377d..269e8acd718e51c65fba57304bee03ce6d94db80 100644 | ||
--- forkSrcPrefix/sdk/objc/base/RTCMacros.h | ||
+++ forkDstPrefix/sdk/objc/base/RTCMacros.h | ||
@@ -40,13 +40,9 @@ | ||
// problem. | ||
// | ||
// This macro must be defined uniformily across all the translation units. | ||
-#ifndef RTC_OBJC_TYPE_PREFIX | ||
-#define RTC_OBJC_TYPE_PREFIX | ||
-#endif | ||
+#define RTC_OBJC_TYPE_PREFIX LK | ||
|
||
-#ifndef RTC_CONSTANT_TYPE_PREFIX | ||
-#define RTC_CONSTANT_TYPE_PREFIX k | ||
-#endif | ||
+#define RTC_CONSTANT_TYPE_PREFIX kLK | ||
|
||
// RCT_OBJC_TYPE | ||
// | ||
diff --git forkSrcPrefix/sdk/BUILD.gn forkDstPrefix/sdk/BUILD.gn | ||
index a710d600d671a97b355467269907c1cde4c50e0c..3af067c7929640b5afc443eefd95152315d90286 100644 | ||
--- forkSrcPrefix/sdk/BUILD.gn | ||
+++ forkDstPrefix/sdk/BUILD.gn | ||
@@ -1409,7 +1409,7 @@ if (is_ios || is_mac) { | ||
if (is_ios) { | ||
apple_framework_bundle_with_umbrella_header("framework_objc") { | ||
info_plist = "objc/Info.plist" | ||
- output_name = "WebRTC" | ||
+ output_name = "LiveKitWebRTC" | ||
|
||
common_objc_headers = [ | ||
"objc/base/RTCCodecSpecificInfo.h", | ||
@@ -1579,7 +1579,7 @@ if (is_ios || is_mac) { | ||
|
||
bundle_data("ios_framework_bundle") { | ||
deps = [ "../sdk:framework_objc" ] | ||
- sources = [ "$root_build_dir/WebRTC.framework" ] | ||
+ sources = [ "$root_build_dir/LiveKitWebRTC.framework" ] | ||
outputs = [ "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}" ] | ||
} | ||
} | ||
@@ -1587,7 +1587,7 @@ if (is_ios || is_mac) { | ||
if (is_mac) { | ||
apple_framework_bundle_with_umbrella_header("mac_framework_objc") { | ||
info_plist = "objc/Info.plist" | ||
- output_name = "WebRTC" | ||
+ output_name = "LiveKitWebRTC" | ||
|
||
sources = [ | ||
"objc/api/peerconnection/RTCAudioDeviceModule.h", | ||
@@ -1735,7 +1735,7 @@ if (is_ios || is_mac) { | ||
|
||
bundle_data("mac_framework_bundle") { | ||
deps = [ "../sdk:mac_framework_objc" ] | ||
- sources = [ "$root_build_dir/WebRTC.framework" ] | ||
+ sources = [ "$root_build_dir/LiveKitWebRTC.framework" ] | ||
outputs = [ "{{bundle_contents_dir}}/Frameworks/{{source_file_part}}" ] | ||
} | ||
} | ||
diff --git forkSrcPrefix/tools_webrtc/ios/generate_umbrella_header.py forkDstPrefix/tools_webrtc/ios/generate_umbrella_header.py | ||
index 1fd1eed38eedd64b11302c962d24c0cb0f60dc99..055732e044d61af98bec7c71949c18f84c54ea79 100644 | ||
--- forkSrcPrefix/tools_webrtc/ios/generate_umbrella_header.py | ||
+++ forkDstPrefix/tools_webrtc/ios/generate_umbrella_header.py | ||
@@ -41,7 +41,7 @@ def GenerateUmbrellaHeader(): | ||
*/\n\n""" % datetime.datetime.now().year)) | ||
|
||
for s in args.sources: | ||
- outfile.write("#import <WebRTC/{}>\n".format(os.path.basename(s))) | ||
+ outfile.write("#import <LiveKitWebRTC/{}>\n".format(os.path.basename(s))) | ||
|
||
return 0 | ||
|
||
diff --git forkSrcPrefix/tools_webrtc/apple/copy_framework_header.py forkDstPrefix/tools_webrtc/apple/copy_framework_header.py | ||
index 3574a67d2a243d4f95217b0a9e855f08b437c739..a68f22d887cbf798c4546ef4937fab75fd03e8ba 100755 | ||
--- forkSrcPrefix/tools_webrtc/apple/copy_framework_header.py | ||
+++ forkDstPrefix/tools_webrtc/apple/copy_framework_header.py | ||
@@ -20,7 +20,7 @@ def _ReplaceDoubleQuote(line): | ||
if not match: | ||
return line | ||
|
||
- return '%s#import <WebRTC/%sRTC%s.h>%s' % (match.group(1), match.group(3), | ||
+ return '%s#import <LiveKitWebRTC/%sRTC%s.h>%s' % (match.group(1), match.group(3), | ||
match.group(4), match.group(5)) | ||
|
||
|
||
diff --git forkSrcPrefix/sdk/objc/Info.plist forkDstPrefix/sdk/objc/Info.plist | ||
index 38c437e7feda9bfa1ee8aafb864174af1c891913..814989d53484f2b009f08ccfd2c6d0ad60e6f5ce 100644 | ||
--- forkSrcPrefix/sdk/objc/Info.plist | ||
+++ forkDstPrefix/sdk/objc/Info.plist | ||
@@ -5,13 +5,13 @@ | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>en</string> | ||
<key>CFBundleExecutable</key> | ||
- <string>WebRTC</string> | ||
+ <string>LiveKitWebRTC</string> | ||
<key>CFBundleIdentifier</key> | ||
- <string>org.webrtc.WebRTC</string> | ||
+ <string>io.livekit.LiveKitWebRTC</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
- <string>WebRTC</string> | ||
+ <string>LiveKitWebRTC</string> | ||
<key>CFBundlePackageType</key> | ||
<string>FMWK</string> | ||
<key>CFBundleShortVersionString</key> | ||
diff --git forkSrcPrefix/tools_webrtc/ios/build_ios_libs.py forkDstPrefix/tools_webrtc/ios/build_ios_libs.py | ||
index 50c9398e1739dd765f02e097e7d04544a70221bd..53dc1b12d775b348a40acbf35242a719ec731dc4 100755 | ||
--- forkSrcPrefix/tools_webrtc/ios/build_ios_libs.py | ||
+++ forkDstPrefix/tools_webrtc/ios/build_ios_libs.py | ||
@@ -27,9 +27,9 @@ sys.path.append(os.path.join(SRC_DIR, 'build')) | ||
import find_depot_tools | ||
|
||
SDK_OUTPUT_DIR = os.path.join(SRC_DIR, 'out_ios_libs') | ||
-SDK_FRAMEWORK_NAME = 'WebRTC.framework' | ||
-SDK_DSYM_NAME = 'WebRTC.dSYM' | ||
-SDK_XCFRAMEWORK_NAME = 'WebRTC.xcframework' | ||
+SDK_FRAMEWORK_NAME = 'LiveKitWebRTC.framework' | ||
+SDK_DSYM_NAME = 'LiveKitWebRTC.dSYM' | ||
+SDK_XCFRAMEWORK_NAME = 'LiveKitWebRTC.xcframework' | ||
|
||
ENABLED_ARCHS = [ | ||
'device:arm64', 'simulator:arm64', 'simulator:x64', |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.