• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash -e
2# Copyright (c) 2021 Huawei Device Co., Ltd.
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15# When public OpenHarmony source tree is available:
16# * List all required third party components in a manifest:
17#
18#      library-1      remote-url-1
19#      library-2      remote-url-2
20#      <...>
21#
22# * Clone each component separately, based on the manifest
23# * Enable this script to work with custom manifests to allow
24#   avoid depenencies on OpenHarmony infrastructure
25# * Remove dependency on private GitLab (and, eventually, GITLAB_PULL_TOKEN)
26# * If we need to apply patches to third party libs,
27#   need to support according machinery as well.
28
29MSG_PREFIX="[ARK THIRD PARTY]"
30SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"
31PANDA_ROOT=$SCRIPT_DIR/..
32PANDA_THIRD_PARTY_DIR=$PANDA_ROOT/ark-third-party
33
34if [[ -d "$PANDA_THIRD_PARTY_DIR" ]] ; then
35    echo "$MSG_PREFIX Third-party dependencies are found in $PANDA_THIRD_PARTY_DIR"
36    exit 0
37fi
38
39echo "$MSG_PREFIX Third-party dependencies are not found in $PANDA_THIRD_PARTY_DIR"
40
41SECUREC_URL="https://gitee.com/openharmony/utils_native.git"
42echo "$MSG_PREFIX Cloning securec from $SECUREC_URL"
43
44git clone --verbose "$SECUREC_URL" "$PANDA_THIRD_PARTY_DIR/utils_native"
45mkdir "$PANDA_THIRD_PARTY_DIR/securec"
46ln -s "$PANDA_THIRD_PARTY_DIR/utils_native/base/src/securec" "$PANDA_THIRD_PARTY_DIR/securec/src"
47ln -s "$PANDA_THIRD_PARTY_DIR/utils_native/base/include" "$PANDA_THIRD_PARTY_DIR/securec/include"
48
49GOOGLETEST_URL="https://gitee.com/openharmony/third_party_googletest.git"
50echo "$MSG_PREFIX Cloning googletest from $GOOGLETEST_URL"
51
52git clone --verbose "$GOOGLETEST_URL" "$PANDA_THIRD_PARTY_DIR/googletest"
53
54MINIZ_URL="https://gitee.com/openharmony/third_party_miniz.git"
55echo "$MSG_PREFIX Cloning miniz from $MINIZ_URL"
56
57git clone --verbose "$MINIZ_URL" "$PANDA_THIRD_PARTY_DIR/miniz"
58
59echo "$MSG_PREFIX Third-party dependencies cloned"
60exit 0
61
62