Michael Bestas | 411537b | 2020-12-28 00:58:46 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
Michael Bestas | 7830bc1 | 2024-08-27 22:51:30 +0300 | [diff] [blame] | 3 | # SPDX-FileCopyrightText: 2016 The CyanogenMod Project |
| 4 | # SPDX-FileCopyrightText: 2017-2024 The LineageOS Project |
Michael Bestas | 411537b | 2020-12-28 00:58:46 +0200 | [diff] [blame] | 5 | # SPDX-License-Identifier: Apache-2.0 |
| 6 | # |
| 7 | |
| 8 | set -e |
| 9 | |
Michael Bestas | 9e3d0d6 | 2024-05-28 03:47:26 +0300 | [diff] [blame] | 10 | DEVICE=otter |
| 11 | VENDOR=shift |
Michael Bestas | 411537b | 2020-12-28 00:58:46 +0200 | [diff] [blame] | 12 | |
| 13 | # Load extract_utils and do some sanity checks |
| 14 | MY_DIR="${BASH_SOURCE%/*}" |
| 15 | if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi |
| 16 | |
| 17 | ANDROID_ROOT="${MY_DIR}/../../.." |
| 18 | |
| 19 | HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" |
| 20 | if [ ! -f "${HELPER}" ]; then |
| 21 | echo "Unable to find helper script at ${HELPER}" |
| 22 | exit 1 |
| 23 | fi |
| 24 | source "${HELPER}" |
| 25 | |
Aaron Kling | 7f92c8f | 2023-08-29 15:58:31 -0500 | [diff] [blame] | 26 | function vendor_imports() { |
| 27 | cat <<EOF >>"$1" |
Michael Bestas | 9e3d0d6 | 2024-05-28 03:47:26 +0300 | [diff] [blame] | 28 | "device/shift/otter", |
Aaron Kling | 7f92c8f | 2023-08-29 15:58:31 -0500 | [diff] [blame] | 29 | "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", |
| 35 | EOF |
| 36 | } |
| 37 | |
Cosmin Tanislav | 5c86173 | 2024-08-17 02:23:32 +0300 | [diff] [blame] | 38 | function lib_to_package_fixup_vendor_variants() { |
| 39 | if [ "$2" != "vendor" ]; then |
| 40 | return 1 |
| 41 | fi |
| 42 | |
| 43 | case "$1" in |
Cosmin Tanislav | 4aee5e3 | 2024-08-17 02:03:24 +0300 | [diff] [blame] | 44 | com.qualcomm.qti.dpm.api@1.0 | \ |
Michael Bestas | f9cb2b4 | 2024-08-25 13:45:39 +0300 | [diff] [blame] | 45 | libmmosal | \ |
| 46 | vendor.qti.hardware.wifidisplaysession@1.0 | \ |
Cosmin Tanislav | 4aee5e3 | 2024-08-17 02:03:24 +0300 | [diff] [blame] | 47 | vendor.qti.imsrtpservice@3.0) |
Cosmin Tanislav | 5c86173 | 2024-08-17 02:23:32 +0300 | [diff] [blame] | 48 | echo "$1-vendor" |
| 49 | ;; |
Cosmin Tanislav | d3de938 | 2024-08-18 09:52:31 +0300 | [diff] [blame] | 50 | libOmxCore | \ |
Cosmin Tanislav | d3de938 | 2024-08-18 09:52:31 +0300 | [diff] [blame] | 51 | libwpa_client) ;; |
Cosmin Tanislav | 5c86173 | 2024-08-17 02:23:32 +0300 | [diff] [blame] | 52 | *) |
| 53 | return 1 |
| 54 | ;; |
| 55 | esac |
| 56 | } |
| 57 | |
| 58 | function 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 Bestas | 411537b | 2020-12-28 00:58:46 +0200 | [diff] [blame] | 64 | # Initialize the helper |
| 65 | setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" |
| 66 | |
| 67 | # Warning headers and guards |
| 68 | write_headers |
| 69 | |
Michael Bestas | c1e2b7b | 2024-09-10 02:07:58 +0300 | [diff] [blame] | 70 | write_makefiles "${MY_DIR}/proprietary-files.txt" |
Michael Bestas | 411537b | 2020-12-28 00:58:46 +0200 | [diff] [blame] | 71 | |
Michael Bestas | bfccf73 | 2022-02-22 19:22:26 +0200 | [diff] [blame] | 72 | append_firmware_calls_to_makefiles "${MY_DIR}/proprietary-firmware.txt" |
| 73 | |
Michael Bestas | 411537b | 2020-12-28 00:58:46 +0200 | [diff] [blame] | 74 | # Finish |
| 75 | write_footers |