-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-cmd.sh
More file actions
executable file
·95 lines (75 loc) · 2.46 KB
/
Copy pathbuild-cmd.sh
File metadata and controls
executable file
·95 lines (75 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/env bash
cd "$(dirname "$0")"
#artifact_id="$1"
# turn on verbose debugging output for logs.
exec 4>&1; export BASH_XTRACEFD=4; set -x
# make errors fatal
set -e
# bleat on references to undefined shell variables
set -u
# Suddenly, Cygwin inserts extra CRLFs in places such
# as the code that extracts version numbers so we need
# this command to stop it doing that...
[[ "$OSTYPE" == "cygwin" ]] && set -o igncr
case "$AUTOBUILD_PLATFORM" in
windows*)
autobuild="$(cygpath -u "$AUTOBUILD")"
build_type="windows_x86_64"
;;
darwin*)
autobuild="$AUTOBUILD"
;;
linux*)
build_type="ubuntu-24.04_x86_64"
autobuild="$AUTOBUILD"
;;
*)
echo "This project is not currently supported for $AUTOBUILD_PLATFORM" 1>&2 ; exit 1
;;
esac
top="$(pwd)"
stage="${top}"/stage
source_environment_tempfile="$stage/source_environment.sh"
"$autobuild" source_environment > "$source_environment_tempfile"
. "$source_environment_tempfile"
pushd "$stage"
case "$AUTOBUILD_PLATFORM" in
darwin*)
mkdir "x86_64"
pushd "x86_64"
tar -xjf "$top"/_packages/webrtc.macos_x86_64/webrtc.tar.bz2 --strip-components=1
popd
mkdir "arm64"
pushd "arm64"
tar -xjf "$top"/_packages/webrtc.macos_arm64/webrtc.tar.bz2 --strip-components=1
popd
# Munge the WebRTC Build package contents into something compatible
# with the layout we use for other autobuild pacakges
# Create universal library
mkdir -p lib/release
lipo -create -output "$stage/lib/release/libwebrtc.a" "$stage/x86_64/lib/libwebrtc.a" "$stage/arm64/lib/libwebrtc.a"
mkdir -p include/webrtc
mv x86_64/include/* include/webrtc
mkdir LICENSES
mv x86_64/NOTICE LICENSES/webrtc-license.txt
;;
*)
tar -xjf "$top"/_packages/webrtc."$build_type"/webrtc.tar.bz2 --strip-components=1
# Munge the WebRTC Build package contents into something compatible
# with the layout we use for other autobuild pacakges
mv include webrtc
mkdir include
mv webrtc include
mv lib release
mkdir lib
mv release lib
mkdir LICENSES
mv NOTICE LICENSES/webrtc-license.txt
;;
*)
echo "This project is not currently supported for $AUTOBUILD_PLATFORM" 1>&2 ; exit 1
;;
esac
build=${AUTOBUILD_BUILD_ID:=0}
echo "${GITHUB_REF:10}.${build}" > "VERSION.txt"
popd