xref: /aosp_15_r20/external/armnn/shim/sl/scripts/modify_aosp_libs.sh (revision 89c4ff92f2867872bb9e2354d150bf0c8c502810)
1#!/usr/bin/env bash
2
3#
4# Copyright © 2022 ARM Ltd and Contributors. All rights reserved.
5# SPDX-License-Identifier: MIT
6#
7
8AOSP_WORKING_DIR=$1
9
10if [ "$#" -ne 1 ]; then
11
12    echo "Usage: This script must be passed a single parameter which is a path "
13    echo "       to an existing directory where the AOSP repo's have been cloned."
14    echo "Error: No working directory path parameter provided."
15    exit 1
16fi
17if [ ! -d "$1" ]; then
18
19    echo "Usage: This script must be passed a single parameter which is a path "
20    echo "       to an existing directory where the AOSP repo's have been cloned."
21    echo "Error: Working directory path provided is not a directory."
22    exit 1
23fi
24
25SCRIPT_PATH=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
26echo "SCRIPT_PATH= ${SCRIPT_PATH}"
27
28pushd "${AOSP_WORKING_DIR}/system/libbase/"
29  echo "Applying libbase logging.cpp patch"
30  git apply "${SCRIPT_PATH}/libbase_logging_cpp.patch"
31popd
32
33pushd "${AOSP_WORKING_DIR}/packages/modules/NeuralNetworks/"
34  echo "Applying NeuralNetworks patch"
35  git apply "${SCRIPT_PATH}/NeuralNetworks.patch"
36popd
37