Skip to content

Commit 32365ea

Browse files
committed
Fix paths alt
1 parent f18bbb5 commit 32365ea

File tree

3 files changed

+37
-35
lines changed

3 files changed

+37
-35
lines changed

build/apple/xcframework.sh

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
#!/bin/sh
2+
3+
set -e
4+
25
if [ ! -n "$1" ]; then
36
echo "Usage: $0 'debug' | 'release' 'source_dir' 'out_dir' ['prefix']"
47
exit 0
58
fi
69

7-
MODE=$1
8-
SOURCE_DIR=$2
9-
OUT_DIR=$3
10-
PREFIX=${4:-""}
10+
MODE="$1"
11+
SOURCE_DIR="$(realpath "$2")"
12+
mkdir -p "$(dirname "$3")"
13+
OUT_DIR="$(realpath "$3")"
14+
PREFIX="${4:-""}"
1115

1216
if [ -z "$PREFIX" ]; then
1317
FRAMEWORK_NAME="WebRTC"
@@ -67,7 +71,7 @@ PLATFORMS=(
6771
# "xrOS-arm64-simulator:target_os=\"ios\" target_environment=\"xrsimulator\" target_cpu=\"arm64\" ios_deployment_target=\"2.2.0\""
6872
)
6973

70-
cd $SOURCE_DIR
74+
cd "$SOURCE_DIR"
7175

7276
end_group
7377

@@ -77,15 +81,15 @@ for platform_config in "${PLATFORMS[@]}"; do
7781

7882
start_group "Building $platform"
7983

80-
gn gen $OUT_DIR/$platform --args="$COMMON_ARGS $config" --ide=xcode
84+
gn gen "$OUT_DIR/$platform" --args="$COMMON_ARGS $config" --ide=xcode
8185

8286
if [[ $platform == *"macOS"* ]]; then
8387
build_target="mac_framework_bundle"
8488
else
8589
build_target="ios_framework_bundle"
8690
fi
8791

88-
ninja -C $OUT_DIR/$platform $build_target -j 10 --quiet
92+
ninja -C "$OUT_DIR/$platform" "$build_target" -j 10 --quiet
8993
if [ $? -ne 0 ]; then
9094
exit 1
9195
fi
@@ -94,51 +98,49 @@ done
9498

9599
start_group "Creating universal binaries (x64 + arm64)"
96100

97-
rm -rf $OUT_DIR/*-lib $OUT_DIR/$FRAMEWORK_NAME.*
98-
99-
# mkdir -p $OUT_DIR/macOS-lib
100-
# cp -R $OUT_DIR/macOS-x64/$FRAMEWORK_NAME.framework $OUT_DIR/macOS-lib/$FRAMEWORK_NAME.framework
101-
# 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
101+
# mkdir -p "$OUT_DIR/macOS-lib"
102+
# cp -R "$OUT_DIR/macOS-x64/$FRAMEWORK_NAME.framework" "$OUT_DIR/macOS-lib/$FRAMEWORK_NAME.framework"
103+
# 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"
102104

103-
# mkdir -p $OUT_DIR/catalyst-lib
104-
# cp -R $OUT_DIR/catalyst-arm64/$FRAMEWORK_NAME.framework $OUT_DIR/catalyst-lib/$FRAMEWORK_NAME.framework
105-
# 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
105+
# mkdir -p "$OUT_DIR/catalyst-lib"
106+
# cp -R "$OUT_DIR/catalyst-arm64/$FRAMEWORK_NAME.framework" "$OUT_DIR/catalyst-lib/$FRAMEWORK_NAME.framework"
107+
# 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"
106108

107-
mkdir -p $OUT_DIR/iOS-device-lib
108-
cp -R $OUT_DIR/iOS-arm64-device/$FRAMEWORK_NAME.framework $OUT_DIR/iOS-device-lib/$FRAMEWORK_NAME.framework
109-
lipo -create -output $OUT_DIR/iOS-device-lib/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME $OUT_DIR/iOS-arm64-device/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME
109+
mkdir -p "$OUT_DIR/iOS-device-lib"
110+
cp -R "$OUT_DIR/iOS-arm64-device/$FRAMEWORK_NAME.framework" "$OUT_DIR/iOS-device-lib/$FRAMEWORK_NAME.framework"
111+
lipo -create -output "$OUT_DIR/iOS-device-lib/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" "$OUT_DIR/iOS-arm64-device/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME"
110112

111-
# mkdir -p $OUT_DIR/iOS-simulator-lib
112-
# cp -R $OUT_DIR/iOS-arm64-simulator/$FRAMEWORK_NAME.framework $OUT_DIR/iOS-simulator-lib/$FRAMEWORK_NAME.framework
113-
# 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
113+
# mkdir -p "$OUT_DIR/iOS-simulator-lib"
114+
# cp -R "$OUT_DIR/iOS-arm64-simulator/$FRAMEWORK_NAME.framework" "$OUT_DIR/iOS-simulator-lib/$FRAMEWORK_NAME.framework"
115+
# 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"
114116

115117
end_group
116118

117119
start_group "Creating XCFramework"
118120

119121
xcodebuild -create-xcframework \
120-
-framework $OUT_DIR/iOS-device-lib/$FRAMEWORK_NAME.framework \
121-
-output $OUT_DIR/$FRAMEWORK_NAME.xcframework
122+
-framework "$OUT_DIR/iOS-device-lib/$FRAMEWORK_NAME.framework" \
123+
-output "$OUT_DIR/$FRAMEWORK_NAME.xcframework"
122124

123125
end_group
124126

125127
start_group "Post-processing XCFramework"
126128

127-
cp $SOURCE_DIR/LICENSE $OUT_DIR/$FRAMEWORK_NAME.xcframework/
129+
cp LICENSE "$OUT_DIR/$FRAMEWORK_NAME.xcframework/"
128130

129-
# cd $OUT_DIR/$FRAMEWORK_NAME.xcframework/macos-arm64_x86_64/$FRAMEWORK_NAME.framework/
130-
# mv $FRAMEWORK_NAME Versions/A/$FRAMEWORK_NAME
131-
# ln -s Versions/Current/$FRAMEWORK_NAME $FRAMEWORK_NAME
131+
# cd "$OUT_DIR/$FRAMEWORK_NAME.xcframework/macos-arm64_x86_64/$FRAMEWORK_NAME.framework/"
132+
# mv "$FRAMEWORK_NAME" "Versions/A/$FRAMEWORK_NAME"
133+
# ln -s "Versions/Current/$FRAMEWORK_NAME" "$FRAMEWORK_NAME"
132134

133-
# cd $OUT_DIR/$FRAMEWORK_NAME.xcframework/ios-arm64_x86_64-maccatalyst/$FRAMEWORK_NAME.framework/
134-
# mv $FRAMEWORK_NAME Versions/A/$FRAMEWORK_NAME
135-
# ln -s Versions/Current/$FRAMEWORK_NAME $FRAMEWORK_NAME
135+
# cd "$OUT_DIR/$FRAMEWORK_NAME.xcframework/ios-arm64_x86_64-maccatalyst/$FRAMEWORK_NAME.framework/"
136+
# mv "$FRAMEWORK_NAME" "Versions/A/$FRAMEWORK_NAME"
137+
# ln -s "Versions/Current/$FRAMEWORK_NAME" "$FRAMEWORK_NAME"
136138

137-
cd $OUT_DIR
138-
zip --symlinks -9 -r $FRAMEWORK_NAME.xcframework.zip $FRAMEWORK_NAME.xcframework
139+
cd "$OUT_DIR"
140+
zip --symlinks -9 -r "$FRAMEWORK_NAME.xcframework.zip" "$FRAMEWORK_NAME.xcframework"
139141

140142
end_group
141143

142144
if [ "$CI" = "true" ]; then
143-
echo "framework_name=$FRAMEWORK_NAME" >> $GITHUB_OUTPUT
145+
echo "framework_name=$FRAMEWORK_NAME" >> "$GITHUB_OUTPUT"
144146
fi

build/build.apple.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ cd `dirname $0`
66
python3 run.py build apple --commit "$1" --webrtc-fetch
77

88
export PATH="$PWD/_source/apple/depot_tools:$PATH"
9-
. apple/xcframework.sh release "$PWD/_source/apple/webrtc/src" "$PWD/_package/apple"
9+
. apple/xcframework.sh release _source/apple/webrtc/src _package/apple

build/build.apple_prefixed.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ cd `dirname $0`
66
python3 run.py build apple_prefixed --commit "$1" --webrtc-fetch
77

88
export PATH="$PWD/_source/apple_prefixed/depot_tools:$PATH"
9-
. apple/xcframework.sh release "$PWD/_source/apple_prefixed/webrtc/src" "$PWD/_package/apple_prefixed" LiveKit # prefix
9+
. apple/xcframework.sh release _source/apple_prefixed/webrtc/src _package/apple_prefixed LiveKit # prefix

0 commit comments

Comments
 (0)