From 0230692c75cc22c021909edbba234284ddda64cc Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Sun, 3 Nov 2024 11:05:48 +0100 Subject: [PATCH] a71: Switch to py extract utils Change-Id: I8870e45e429fd651892f2da1bfc2452ba4fb545a --- extract-files.py | 37 +++++++++++++++++++++++++++++++++++++ extract-files.sh | 20 -------------------- setup-makefiles.py | 1 + setup-makefiles.sh | 14 -------------- 4 files changed, 38 insertions(+), 34 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 diff --git a/extract-files.py b/extract-files.py new file mode 100755 index 0000000..94a4d6a --- /dev/null +++ b/extract-files.py @@ -0,0 +1,37 @@ +#!/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_fixup_vendorcompat, + lib_fixups_user_type, + libs_proto_3_9_1, +) +from extract_utils.main import ( + ExtractUtils, + ExtractUtilsModule, +) + +namespace_imports = [ + 'vendor/samsung/a71-common', +] + +lib_fixups: lib_fixups_user_type = { + libs_proto_3_9_1: lib_fixup_vendorcompat, +} + +module = ExtractUtilsModule( + 'a71', + 'samsung', + lib_fixups=lib_fixups, + namespace_imports=namespace_imports, + check_elf=True, +) + +if __name__ == '__main__': + utils = ExtractUtils.device_with_common( + module, 'a71-common', module.vendor + ) + utils.run() diff --git a/extract-files.sh b/extract-files.sh deleted file mode 100755 index 264dfd5..0000000 --- a/extract-files.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# -# Copyright (C) 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=a71 -export DEVICE_COMMON=a71-common -export VENDOR=samsung - -"./../../${VENDOR}/${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 0f37760..0000000 --- a/setup-makefiles.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# -# Copyright (C) 2024 The LineageOS Project -# -# SPDX-License-Identifier: Apache-2.0 -# - -set -e - -export DEVICE=a71 -export DEVICE_COMMON=a71-common -export VENDOR=samsung - -"./../../${VENDOR}/${DEVICE_COMMON}/setup-makefiles.sh" "$@"