From 4eabe83fdac93fc9609a923455102436de185341 Mon Sep 17 00:00:00 2001 From: chaptsand Date: Mon, 30 Dec 2024 16:28:13 -0300 Subject: [PATCH] dm3q: Switch to python extract_utils Change-Id: Idbd280e769725b326512590abd2fc8d684fab4dd --- extract-files.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ extract-files.sh | 30 ------------------------------ setup-makefiles.py | 1 + setup-makefiles.sh | 21 --------------------- sort-blobs-list.py | 0 5 files changed, 45 insertions(+), 51 deletions(-) create mode 100755 extract-files.py delete mode 100755 extract-files.sh create mode 100755 setup-makefiles.py delete mode 100755 setup-makefiles.sh mode change 100755 => 100644 sort-blobs-list.py diff --git a/extract-files.py b/extract-files.py new file mode 100755 index 0000000..670d731 --- /dev/null +++ b/extract-files.py @@ -0,0 +1,44 @@ +#!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3 +# +# SPDX-FileCopyrightText: 2024 The LineageOS Project +# SPDX-License-Identifier: Apache-2.0 +# + +from extract_utils.fixups_lib import ( + lib_fixups, + lib_fixups_user_type, +) + +from extract_utils.main import ( + ExtractUtils, + ExtractUtilsModule, +) + +namespace_imports = [ + 'device/samsung/sm8550-common', + 'hardware/qcom-caf/sm8550', + 'vendor/qcom/opensource/commonsys-intf/display', + 'vendor/samsung/sm8550-common', +] + +def lib_fixup_vendor_suffix(lib: str, partition: str, *args, **kwargs): + return f'{lib}_{partition}' if partition == 'vendor' else None + + +lib_fixups: lib_fixups_user_type = { + **lib_fixups, + ( + 'libsecril-client', + ): lib_fixup_vendor_suffix, +} + +module = ExtractUtilsModule( + 'dm3q', + 'samsung', + lib_fixups=lib_fixups, + namespace_imports=namespace_imports, +) + +if __name__ == '__main__': + utils = ExtractUtils.device_with_common(module, 'sm8550-common', module.vendor) + utils.run() diff --git a/extract-files.sh b/extract-files.sh deleted file mode 100755 index f37ce89..0000000 --- a/extract-files.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# -# SPDX-FileCopyrightText: 2016 The CyanogenMod Project -# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project -# SPDX-License-Identifier: Apache-2.0 -# - -function blob_fixup() { - case "${1}" in - esac -} - -function blob_fixup_dry() { - blob_fixup "$1" "" -} - -# If we're being sourced by the common script that we called, -# stop right here. No need to go down the rabbit hole. -if [ "${BASH_SOURCE[0]}" != "${0}" ]; then - return -fi - -set -e - -export DEVICE=dm3q -export DEVICE_COMMON=sm8550-common -export VENDOR=samsung -export VENDOR_COMMON=${VENDOR} - -"./../../${VENDOR_COMMON}/${DEVICE_COMMON}/extract-files.sh" "$@" diff --git a/setup-makefiles.py b/setup-makefiles.py new file mode 100755 index 0000000..32947cf --- /dev/null +++ b/setup-makefiles.py @@ -0,0 +1 @@ +#!./extract-files.py --regenerate_makefiles diff --git a/setup-makefiles.sh b/setup-makefiles.sh deleted file mode 100755 index 3c9bb5d..0000000 --- a/setup-makefiles.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# -# SPDX-FileCopyrightText: 2016 The CyanogenMod Project -# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project -# SPDX-License-Identifier: Apache-2.0 -# - -# If we're being sourced by the common script that we called, -# stop right here. No need to go down the rabbit hole. -if [ "${BASH_SOURCE[0]}" != "${0}" ]; then - return -fi - -set -e - -export DEVICE=dm3q -export DEVICE_COMMON=sm8550-common -export VENDOR=samsung -export VENDOR_COMMON=${VENDOR} - -"./../../${VENDOR_COMMON}/${DEVICE_COMMON}/setup-makefiles.sh" "$@" diff --git a/sort-blobs-list.py b/sort-blobs-list.py old mode 100755 new mode 100644