Skip to content

Commit

Permalink
Enhance build script for webOS example
Browse files Browse the repository at this point in the history
* Do not use 'sudo' when installing webOS NDK, but use '-d'
  to designate the install path as non-root path.
* Do not 'wget' webOS SDK, but include it as git submodule
  • Loading branch information
cabin15 committed Feb 2, 2022
1 parent 0fa1323 commit ca4cdd4
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions scripts/examples/webos_example.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env bash

#
# Copyright (c) 2021 Project CHIP Authors
# Copyright (c) 2022 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,26 +15,22 @@
# limitations under the License.
#

# Download webOS OSE NDK
echo "##### Download webOS OSE NDK #####"
wget https://sourceforge.net/projects/webos-iotivity-patches/files/webos-sdk-x86_64-cortexa7t2hf-neon-vfpv4-toolchain-2.14.1.g.sh
wget https://sourceforge.net/projects/webos-iotivity-patches/files/webos-sdk-x86_64-cortexa7t2hf-neon-vfpv4-toolchain-2.14.1.g.host.manifest
wget https://sourceforge.net/projects/webos-iotivity-patches/files/webos-sdk-x86_64-cortexa7t2hf-neon-vfpv4-toolchain-2.14.1.g.target.manifest
wget https://sourceforge.net/projects/webos-iotivity-patches/files/webos-sdk-x86_64-cortexa7t2hf-neon-vfpv4-toolchain-2.14.1.g.testdata.json
# Activating connectedhomeip build environment
source scripts/activate.sh

# Extract webOS SDK
cat third_party/webos_sdk/v2.14.1/webos_sdk.tar* | (cd third_party/webos_sdk/v2.14.1/;tar xvzf -)

# Grant execute permission for NDK install script
chmod 555 webos-sdk-x86_64-cortexa7t2hf-neon-vfpv4-toolchain-2.14.1.g.sh
chmod 555 third_party/webos_sdk/v2.14.1/webos-sdk-x86_64-cortexa7t2hf-neon-vfpv4-toolchain-2.14.1.g.sh

# Install webOS OSE NDK
echo "##### Install webOS OSE NDK #####"
sudo ./webos-sdk-x86_64-cortexa7t2hf-neon-vfpv4-toolchain-2.14.1.g.sh

# Activating connectedhomeip build environment
source scripts/activate.sh
third_party/webos_sdk/v2.14.1/webos-sdk-x86_64-cortexa7t2hf-neon-vfpv4-toolchain-2.14.1.g.sh -d third_party/webos_sdk/v2.14.1 -y

# Activating webOS NDK build environment
echo "##### Activating webOS NDK build environment #####"
source /opt/webos-sdk-x86_64/environment-setup-cortexa7t2hf-neon-vfpv4-webos-linux-gnueabi
source third_party/webos_sdk/v2.14.1/environment-setup-cortexa7t2hf-neon-vfpv4-webos-linux-gnueabi
echo ""

# Build webos example
Expand All @@ -45,9 +40,3 @@ gn gen out/host --args="is_debug=false target_os=\"webos\" target_cpu=\"arm\" ch

echo "##### Building by ninja #####"
ninja -C out/host

# Remove webOS OSE NDK archive
rm -rf webos-sdk-x86_64-cortexa7t2hf-neon-vfpv4-toolchain-2.14.1.g.host.manifest
rm -rf webos-sdk-x86_64-cortexa7t2hf-neon-vfpv4-toolchain-2.14.1.g.sh
rm -rf webos-sdk-x86_64-cortexa7t2hf-neon-vfpv4-toolchain-2.14.1.g.target.manifest
rm -rf webos-sdk-x86_64-cortexa7t2hf-neon-vfpv4-toolchain-2.14.1.g.testdata.json

0 comments on commit ca4cdd4

Please sign in to comment.