Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 7802594

Browse files
committed
Add woogeen tools for install, patch and build
Signed-off-by: jdai12 <[email protected]>
1 parent 38ffd9a commit 7802594

File tree

4 files changed

+264
-0
lines changed

4 files changed

+264
-0
lines changed

tools-woogeen/build.sh

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
#!/bin/bash
2+
3+
this=`dirname "$0"`
4+
this=`cd "$this"; pwd`
5+
6+
ROOT=`cd "${this}/../.."; pwd`
7+
SOURCE="${ROOT}/src"
8+
TOOLS="${ROOT}/src/tools-woogeen"
9+
10+
REBUILD=false
11+
12+
export PATH=${TOOLS}/depto_tools:$PATH
13+
14+
usage() {
15+
echo
16+
echo "Usage:"
17+
echo " -r clean all, and rebuild"
18+
echo "Example:"
19+
echo " build.sh default build"
20+
echo " build.sh -r rebuild"
21+
echo
22+
}
23+
24+
shopt -s extglob
25+
while [[ $# -gt 0 ]]; do
26+
case $1 in
27+
*(-)r )
28+
REBUILD=true
29+
;;
30+
*(-)help )
31+
usage
32+
exit 0
33+
;;
34+
*(-)help )
35+
usage
36+
exit 0
37+
;;
38+
* )
39+
echo -e "\x1b[33mUnknown argument\x1b[0m: $1"
40+
usage
41+
exit 0
42+
;;
43+
esac
44+
shift
45+
done
46+
47+
cd ${SOURCE}
48+
49+
if ${REBUILD} ; then
50+
if [ -e "out" ];
51+
then
52+
echo "rm out/"
53+
rm -rf out
54+
fi
55+
fi
56+
57+
if [ ! -e "out" ];
58+
then
59+
60+
echo "Generate ninja files"
61+
62+
gn gen out --args="
63+
is_clang=false
64+
is_debug=false
65+
use_sysroot=false
66+
linux_use_bundled_binutils=false
67+
treat_warnings_as_errors=false
68+
69+
rtc_include_tests=false
70+
rtc_use_openmax_dl=false
71+
rtc_enable_protobuf=false
72+
rtc_enable_sctp=false
73+
rtc_build_expat=false
74+
rtc_build_json=false
75+
rtc_build_libjpeg=false
76+
rtc_build_libsrtp=false
77+
rtc_build_openmax_dl=false
78+
rtc_build_ssl=false
79+
rtc_build_usrsctp=false
80+
81+
libyuv_use_gflags=false
82+
libyuv_include_tests=false
83+
libyuv_disable_jpeg=true
84+
85+
rtc_use_h264=true
86+
rtc_build_libvpx=true
87+
rtc_libvpx_build_vp9=true
88+
rtc_build_opus=true
89+
rtc_include_opus=true
90+
"
91+
92+
fi
93+
94+
ninja -C out video_coding audio_coding audio_conference_mixer metrics_default field_trial_default
95+
96+
if [ -e "${ROOT}/libwebrtc.a" ];
97+
then
98+
rm -v ${ROOT}/libwebrtc.a
99+
fi
100+
101+
all=`find ./out/obj/ -name "*.o"`
102+
if [[ -n $all ]];
103+
then
104+
ar cq ${ROOT}/libwebrtc.a $all
105+
echo "Generate libwebrtc.a OK"
106+
else
107+
echo "Generate libwebrtc.a Fail"
108+
fi
109+
110+
cd -
111+
112+

tools-woogeen/install.sh

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
#!/bin/bash
2+
3+
this=`dirname "$0"`
4+
this=`cd "$this"; pwd`
5+
6+
ROOT=`cd "${this}/../.."; pwd`
7+
SOURCE="${ROOT}/src"
8+
TOOLS="${ROOT}/src/tools-woogeen"
9+
10+
download_dir=${TOOLS}/tmp
11+
mkdir -p ${download_dir}
12+
13+
download_third_party_module() {
14+
local repo=https://chromium.googlesource.com/chromium/src/third_party
15+
local commit=ef69db4b743f832bd71de2ddc8d3e800e563c525
16+
local module_name=$1
17+
local dowmload_dir=$2
18+
local download_name=$3
19+
local dst=$4
20+
21+
wget ${repo}/+archive/${commit}/${module_name}.tar.gz -O ${download_dir}/${download_name}.${commit}.tar.gz
22+
mkdir -p ${dst}
23+
tar -zxf ${download_dir}/${download_name}.${commit}.tar.gz -C ${dst}
24+
}
25+
26+
download_project() {
27+
local repo=$1
28+
local commit=$2
29+
local dowmload_dir=$3
30+
local download_name=$4
31+
local dst=$5
32+
33+
wget ${repo}/+archive/${commit}.tar.gz -O ${download_dir}/${download_name}.${commit}.tar.gz
34+
mkdir -p ${dst}
35+
tar -zxf ${download_dir}/${download_name}.${commit}.tar.gz -C ${dst}
36+
}
37+
38+
# depto_tools
39+
repo=https://chromium.googlesource.com/chromium/tools/depot_tools.git
40+
commit=be812619bdaa990418316ca1cefac5de8bbd3adb
41+
name=depto_tools
42+
dst=depto_tools
43+
download_project ${repo} ${commit} ${download_dir} ${name} ${TOOLS}/${dst}
44+
45+
# third_party/yasm
46+
module_name=yasm
47+
name=yasm
48+
dst=third_party/yasm
49+
download_third_party_module ${module_name} ${download_dir} ${name} ${SOURCE}/${dst}
50+
51+
# third_party/libvpx
52+
module_name=libvpx
53+
name=libvpx
54+
dst=third_party/libvpx
55+
download_third_party_module ${module_name} ${download_dir} ${name} ${SOURCE}/${dst}
56+
57+
# third_party/opus
58+
module_name=opus
59+
name=opus
60+
dst=third_party/opus
61+
download_third_party_module ${module_name} ${download_dir} ${name} ${SOURCE}/${dst}
62+
63+
patch -d ${SOURCE}/${dst} -p1 < ${TOOLS}/opus-disable-test.patch
64+
65+
# build
66+
repo=https://chromium.googlesource.com/chromium/src/build
67+
commit=ab0b06d1c0554464933544734bf8b3d17084d263
68+
name=build
69+
dst=build
70+
download_project ${repo} ${commit} ${download_dir} ${name} ${SOURCE}/${dst}
71+
72+
# buildtools
73+
repo=https://chromium.googlesource.com/chromium/buildtools.git
74+
commit=d3074448541662f242bcee623049c13a231b5648
75+
name=buildtools
76+
dst=buildtools
77+
download_project ${repo} ${commit} ${download_dir} ${name} ${SOURCE}/${dst}
78+
79+
wget --no-check-certificate http://storage.googleapis.com/chromium-gn/a452edf26a551fef8a884496d143b7e56cbe2ad9 -O ${SOURCE}/${dst}/linux64/gn
80+
chmod +x ${SOURCE}/${dst}/linux64/gn
81+
82+
# base
83+
repo=https://chromium.googlesource.com/chromium/src/base
84+
commit=6f94118f9a7b502db8f6b73f8ff7b9d19153cb76
85+
name=base
86+
dst=base
87+
download_project ${repo} ${commit} ${download_dir} ${name} ${SOURCE}/${dst}
88+
89+
# third_party/yasm/source/patched-yasm
90+
repo=https://chromium.googlesource.com/chromium/deps/yasm/patched-yasm.git
91+
commit=7da28c6c7c6a1387217352ce02b31754deb54d2a
92+
name=patched-yasm
93+
dst=third_party/yasm/source/patched-yasm
94+
download_project ${repo} ${commit} ${download_dir} ${name} ${SOURCE}/${dst}
95+
96+
# third_party/libvpx/source/libvpx
97+
repo=https://chromium.googlesource.com/webm/libvpx.git
98+
commit=6af42f5102ad7c00d3fed389b186663a88d812ee
99+
name=libvpx_source
100+
dst=third_party/libvpx/source/libvpx
101+
download_project ${repo} ${commit} ${download_dir} ${name} ${SOURCE}/${dst}
102+
103+
# third_party/libyuv
104+
repo=https://chromium.googlesource.com/libyuv/libyuv.git
105+
commit=2adb84e39e360723d19c68f315d99e3e0f88318c
106+
name=libyuv
107+
dst=third_party/libyuv
108+
download_project ${repo} ${commit} ${download_dir} ${name} ${SOURCE}/${dst}
109+
110+
patch -d ${SOURCE}/${dst} -p1 < ${TOOLS}/libyuv-disable-jpeg.patch
111+
112+
# dump gni
113+
mkdir -p ${SOURCE}/testing
114+
touch ${SOURCE}/testing/test.gni
115+
116+
mkdir -p ${SOURCE}/third_party/protobuf
117+
touch ${SOURCE}/third_party/protobuf/proto_library.gni
118+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
diff --git a/BUILD.gn b/BUILD.gn
2+
index bcb66b6..5cd405b 100644
3+
--- a/BUILD.gn
4+
+++ b/BUILD.gn
5+
@@ -120,10 +120,10 @@ static_library("libyuv_internal") {
6+
defines = []
7+
deps = []
8+
9+
- if (!is_ios) {
10+
- defines += [ "HAVE_JPEG" ]
11+
- deps += [ "//third_party:jpeg" ]
12+
- }
13+
+ #if (!is_ios) {
14+
+ # defines += [ "HAVE_JPEG" ]
15+
+ # deps += [ "//third_party:jpeg" ]
16+
+ #}
17+
18+
if (libyuv_use_neon) {
19+
deps += [ ":libyuv_neon" ]

tools-woogeen/opus-disable-test.patch

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--- a/BUILD.gn 2017-06-02 22:17:57.999087165 +0800
2+
+++ b/BUILD.gn 2017-06-02 22:18:53.640090921 +0800
3+
@@ -441,6 +441,7 @@ executable("opus_demo") {
4+
]
5+
}
6+
7+
+if (false) {
8+
test("test_opus_api") {
9+
sources = [
10+
"src/tests/test_opus_api.c",
11+
@@ -518,3 +519,4 @@ test("test_opus_padding") {
12+
":opus",
13+
]
14+
}
15+
+}

0 commit comments

Comments
 (0)