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 | 1037453 | 2023-08-29 19:41:38 +0300 | [diff] [blame] | 10 | DEVICE=FP5 |
merothh | fb168c8 | 2022-01-02 18:18:04 +0530 | [diff] [blame] | 11 | VENDOR=fairphone |
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 | |
Aaron Kling | 6411f24 | 2024-08-14 01:44:45 -0500 | [diff] [blame] | 19 | export TARGET_ENABLE_CHECKELF=true |
| 20 | |
Michael Bestas | 411537b | 2020-12-28 00:58:46 +0200 | [diff] [blame] | 21 | HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" |
| 22 | if [ ! -f "${HELPER}" ]; then |
| 23 | echo "Unable to find helper script at ${HELPER}" |
| 24 | exit 1 |
| 25 | fi |
| 26 | source "${HELPER}" |
| 27 | |
Aaron Kling | 7f92c8f | 2023-08-29 15:58:31 -0500 | [diff] [blame] | 28 | function vendor_imports() { |
| 29 | cat <<EOF >>"$1" |
| 30 | "device/fairphone/FP5", |
| 31 | "hardware/qcom-caf/sm8350", |
| 32 | "hardware/qcom-caf/wlan", |
| 33 | "vendor/qcom/opensource/commonsys/display", |
| 34 | "vendor/qcom/opensource/commonsys-intf/display", |
| 35 | "vendor/qcom/opensource/dataservices", |
| 36 | "vendor/qcom/opensource/display", |
| 37 | EOF |
| 38 | } |
| 39 | |
Cosmin Tanislav | 5c86173 | 2024-08-17 02:23:32 +0300 | [diff] [blame] | 40 | function lib_to_package_fixup_vendor_variants() { |
| 41 | if [ "$2" != "vendor" ]; then |
| 42 | return 1 |
| 43 | fi |
| 44 | |
| 45 | case "$1" in |
Cosmin Tanislav | 4aee5e3 | 2024-08-17 02:03:24 +0300 | [diff] [blame^] | 46 | com.qualcomm.qti.dpm.api@1.0 | \ |
| 47 | vendor.qti.imsrtpservice@3.0) |
Cosmin Tanislav | 5c86173 | 2024-08-17 02:23:32 +0300 | [diff] [blame] | 48 | echo "$1-vendor" |
| 49 | ;; |
| 50 | *) |
| 51 | return 1 |
| 52 | ;; |
| 53 | esac |
| 54 | } |
| 55 | |
| 56 | function lib_to_package_fixup() { |
| 57 | lib_to_package_fixup_clang_rt_ubsan_standalone "$1" || |
| 58 | lib_to_package_fixup_proto_3_9_1 "$1" || |
| 59 | lib_to_package_fixup_vendor_variants "$@" |
| 60 | } |
| 61 | |
Michael Bestas | 411537b | 2020-12-28 00:58:46 +0200 | [diff] [blame] | 62 | # Initialize the helper |
| 63 | setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" |
| 64 | |
| 65 | # Warning headers and guards |
| 66 | write_headers |
| 67 | |
| 68 | write_makefiles "${MY_DIR}/proprietary-files.txt" true |
| 69 | |
Michael Bestas | bfccf73 | 2022-02-22 19:22:26 +0200 | [diff] [blame] | 70 | append_firmware_calls_to_makefiles "${MY_DIR}/proprietary-firmware.txt" |
| 71 | |
Michael Bestas | 411537b | 2020-12-28 00:58:46 +0200 | [diff] [blame] | 72 | # Finish |
| 73 | write_footers |