gapps: Misc script fixes
* Point to vendor/lineage * Add initial copyright year * Remove arg for target, it's unneeded * Remove arg for path, it's unneeded * Cleanup sed'ding of makefiles
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright (C) 2016 The CyanogenMod Project
|
# Copyright (C) 2016 The CyanogenMod Project
|
||||||
# Copyright (C) 2017 The LineageOS Project
|
# Copyright (C) 2017-2018 The LineageOS Project
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@@ -25,44 +25,25 @@ export VENDOR=gapps
|
|||||||
MY_DIR="${BASH_SOURCE%/*}"
|
MY_DIR="${BASH_SOURCE%/*}"
|
||||||
if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
|
if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
|
||||||
|
|
||||||
CM_ROOT="$MY_DIR"/../..
|
LINEAGE_ROOT="$MY_DIR"/../..
|
||||||
|
|
||||||
HELPER="$CM_ROOT"/vendor/cm/build/tools/extract_utils.sh
|
HELPER="$LINEAGE_ROOT"/vendor/lineage/build/tools/extract_utils.sh
|
||||||
if [ ! -f "$HELPER" ]; then
|
if [ ! -f "$HELPER" ]; then
|
||||||
echo "Unable to find helper script at $HELPER"
|
echo "Unable to find helper script at $HELPER"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
. "$HELPER"
|
. "$HELPER"
|
||||||
|
|
||||||
while [ "$1" != "" ]; do
|
|
||||||
case $1 in
|
|
||||||
-p | --path ) shift
|
|
||||||
SRC=$1
|
SRC=$1
|
||||||
;;
|
|
||||||
-t | --target ) shift
|
|
||||||
export TARGET=$1
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -z "$SRC" ]; then
|
if [ -z "$SRC" ]; then
|
||||||
echo "Path to system dump not specified! Specify one with --path"
|
echo "Path to system dump not specified! Specify one with --path"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$TARGET" ]; then
|
|
||||||
echo "Architecture for extraction not specified! Specify one with --target"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Initialize the helper for common gapps
|
# Initialize the helper for common gapps
|
||||||
setup_vendor "$GAPPS_COMMON" "$VENDOR" "$CM_ROOT"
|
setup_vendor "$GAPPS_COMMON" "$VENDOR" "$LINEAGE_ROOT"
|
||||||
|
|
||||||
extract "$MY_DIR"/proprietary-files-common.txt "$SRC"
|
extract "$MY_DIR"/proprietary-files-common.txt "$SRC"
|
||||||
|
|
||||||
# Reinitialize the helper for target gapps
|
"$MY_DIR"/setup-makefiles.sh
|
||||||
setup_vendor "$TARGET" "$VENDOR" "$CM_ROOT"
|
|
||||||
|
|
||||||
extract "$MY_DIR"/proprietary-files-$TARGET.txt "$SRC"
|
|
||||||
|
|
||||||
"$MY_DIR"/setup-makefiles.sh -t $TARGET
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright (C) 2016 The CyanogenMod Project
|
# Copyright (C) 2016 The CyanogenMod Project
|
||||||
# Copyright (C) 2017 The LineageOS Project
|
# Copyright (C) 2017-2018 The LineageOS Project
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
export INITIAL_COPYRIGHT_YEAR=2017
|
||||||
|
|
||||||
export GAPPS_COMMON=common
|
export GAPPS_COMMON=common
|
||||||
export VENDOR=gapps
|
export VENDOR=gapps
|
||||||
|
|
||||||
@@ -25,30 +27,17 @@ export VENDOR=gapps
|
|||||||
MY_DIR="${BASH_SOURCE%/*}"
|
MY_DIR="${BASH_SOURCE%/*}"
|
||||||
if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
|
if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
|
||||||
|
|
||||||
CM_ROOT="$MY_DIR"/../..
|
LINEAGE_ROOT="$MY_DIR"/../..
|
||||||
|
|
||||||
HELPER="$CM_ROOT"/vendor/cm/build/tools/extract_utils.sh
|
HELPER="$LINEAGE_ROOT"/vendor/lineage/build/tools/extract_utils.sh
|
||||||
if [ ! -f "$HELPER" ]; then
|
if [ ! -f "$HELPER" ]; then
|
||||||
echo "Unable to find helper script at $HELPER"
|
echo "Unable to find helper script at $HELPER"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
. "$HELPER"
|
. "$HELPER"
|
||||||
|
|
||||||
while [ "$1" != "" ]; do
|
|
||||||
case $1 in
|
|
||||||
-t | --target ) shift
|
|
||||||
export TARGET=$1
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -z "$TARGET" ]; then
|
|
||||||
echo "Architecture for makefile setup not specified! Specify one with --target"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Initialize the helper for common gapps
|
# Initialize the helper for common gapps
|
||||||
setup_vendor "$GAPPS_COMMON" "$VENDOR" "$CM_ROOT" true
|
setup_vendor "$GAPPS_COMMON" "$VENDOR" "$LINEAGE_ROOT" true
|
||||||
|
|
||||||
# Copyright headers
|
# Copyright headers
|
||||||
write_headers "arm arm64 x86"
|
write_headers "arm arm64 x86"
|
||||||
@@ -59,8 +48,10 @@ write_makefiles "$MY_DIR"/proprietary-files-common.txt
|
|||||||
# We are done with common
|
# We are done with common
|
||||||
write_footers
|
write_footers
|
||||||
|
|
||||||
|
for TARGET in arm arm64 x86; do
|
||||||
|
|
||||||
# Reinitialize the helper for target gapps
|
# Reinitialize the helper for target gapps
|
||||||
setup_vendor "$TARGET" "$VENDOR" "$CM_ROOT" true
|
setup_vendor "$TARGET" "$VENDOR" "$LINEAGE_ROOT" true
|
||||||
|
|
||||||
# Copyright headers and guards
|
# Copyright headers and guards
|
||||||
write_headers "$TARGET"
|
write_headers "$TARGET"
|
||||||
@@ -69,7 +60,9 @@ write_makefiles "$MY_DIR"/proprietary-files-$TARGET.txt
|
|||||||
|
|
||||||
printf '\n%s\n' "\$(call inherit-product, vendor/gapps/common/common-vendor.mk)" >> "$PRODUCTMK"
|
printf '\n%s\n' "\$(call inherit-product, vendor/gapps/common/common-vendor.mk)" >> "$PRODUCTMK"
|
||||||
|
|
||||||
|
sed -i 's/TARGET_DEVICE/TARGET_ARCH/g' "$ANDROIDMK"
|
||||||
|
|
||||||
# We are done with target
|
# We are done with target
|
||||||
write_footers
|
write_footers
|
||||||
|
|
||||||
find "$MY_DIR" -type f -name Android.mk -exec sed -i 's/TARGET_DEVICE/TARGET_ARCH/g' {} \;
|
done
|
||||||
|
Reference in New Issue
Block a user