blob: 013ae23fb743af3c53831c2652c4c260fb732627 [file] [log] [blame]
Michael Bestas411537b2020-12-28 00:58:46 +02001#!/bin/bash
2#
Michael Bestas7830bc12024-08-27 22:51:30 +03003# SPDX-FileCopyrightText: 2016 The CyanogenMod Project
4# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
Michael Bestas411537b2020-12-28 00:58:46 +02005# SPDX-License-Identifier: Apache-2.0
6#
7
8set -e
9
Michael Bestas9e3d0d62024-05-28 03:47:26 +030010DEVICE=otter
11VENDOR=shift
Michael Bestas411537b2020-12-28 00:58:46 +020012
13# Load extract_utils and do some sanity checks
14MY_DIR="${BASH_SOURCE%/*}"
15if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
16
17ANDROID_ROOT="${MY_DIR}/../../.."
18
19HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
20if [ ! -f "${HELPER}" ]; then
21 echo "Unable to find helper script at ${HELPER}"
22 exit 1
23fi
24source "${HELPER}"
25
Aaron Kling7f92c8f2023-08-29 15:58:31 -050026function vendor_imports() {
27 cat <<EOF >>"$1"
Michael Bestas9e3d0d62024-05-28 03:47:26 +030028 "device/shift/otter",
Aaron Kling7f92c8f2023-08-29 15:58:31 -050029 "hardware/qcom-caf/sm8350",
30 "hardware/qcom-caf/wlan",
31 "vendor/qcom/opensource/commonsys/display",
32 "vendor/qcom/opensource/commonsys-intf/display",
33 "vendor/qcom/opensource/dataservices",
34 "vendor/qcom/opensource/display",
35EOF
36}
37
Cosmin Tanislav5c861732024-08-17 02:23:32 +030038function lib_to_package_fixup_vendor_variants() {
39 if [ "$2" != "vendor" ]; then
40 return 1
41 fi
42
43 case "$1" in
Cosmin Tanislav4aee5e32024-08-17 02:03:24 +030044 com.qualcomm.qti.dpm.api@1.0 | \
Michael Bestasf9cb2b42024-08-25 13:45:39 +030045 libmmosal | \
46 vendor.qti.hardware.wifidisplaysession@1.0 | \
Cosmin Tanislav4aee5e32024-08-17 02:03:24 +030047 vendor.qti.imsrtpservice@3.0)
Cosmin Tanislav5c861732024-08-17 02:23:32 +030048 echo "$1-vendor"
49 ;;
Cosmin Tanislavd3de9382024-08-18 09:52:31 +030050 libOmxCore | \
Cosmin Tanislavd3de9382024-08-18 09:52:31 +030051 libwpa_client) ;;
Cosmin Tanislav5c861732024-08-17 02:23:32 +030052 *)
53 return 1
54 ;;
55 esac
56}
57
58function lib_to_package_fixup() {
59 lib_to_package_fixup_clang_rt_ubsan_standalone "$1" ||
60 lib_to_package_fixup_proto_3_9_1 "$1" ||
61 lib_to_package_fixup_vendor_variants "$@"
62}
63
Michael Bestas411537b2020-12-28 00:58:46 +020064# Initialize the helper
65setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}"
66
67# Warning headers and guards
68write_headers
69
Michael Bestasc1e2b7b2024-09-10 02:07:58 +030070write_makefiles "${MY_DIR}/proprietary-files.txt"
Michael Bestas411537b2020-12-28 00:58:46 +020071
Michael Bestasbfccf732022-02-22 19:22:26 +020072append_firmware_calls_to_makefiles "${MY_DIR}/proprietary-firmware.txt"
73
Michael Bestas411537b2020-12-28 00:58:46 +020074# Finish
75write_footers