-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Tizen OS chip platform The platform supports the following features: - Bluetooth - WiFi - Mdns - Key/Value store The integration with network is made with the Tizen API * Add Tizen OS target config/build files * Add example build files based on Tizen OS * Integrate Tizen OS into chip build system * Add workflow to build Tizen OS examples * Add VSCode task to build Tizen OS examples * Add tizen.py to build Tizen OS examples replace gn_tizen_example.sh to build_exmaples.py remove unused gn_tizen_example.sh * Apply restyle script * Apply comments * Change tizen.py * Add tizen toolchain * Rename tizen_home to tizen_sdk and apply comments * Modify lib/ files full path * Modify sysroot setting logic
- Loading branch information
1 parent
5a9c063
commit e945d16
Showing
43 changed files
with
2,491 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Copyright (c) 2021 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. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
name: Build example - Tizen | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
tizen: | ||
name: Tizen | ||
env: | ||
BUILD_TYPE: tizen | ||
|
||
runs-on: ubuntu-latest | ||
if: github.actor != 'restyled-io[bot]' | ||
|
||
container: | ||
image: connectedhomeip/chip-build-tizen:latest | ||
options: --user root | ||
volumes: | ||
- "/tmp/bloat_reports:/tmp/bloat_reports" | ||
- "/tmp/output_binaries:/tmp/output_binaries" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
- name: Build example Tizen lighting app | ||
run: | ||
scripts/run_in_build_env.sh "./scripts/build/build_examples.py --platform tizen build" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -278,7 +278,8 @@ | |
"nrf", | ||
"qpg", | ||
"infineon", | ||
"telink" | ||
"telink", | ||
"tizen" | ||
], | ||
"default": "build" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright (c) 2021 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. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import("tizen_toolchain.gni") | ||
|
||
tizen_toolchain("tizen_arm") { | ||
toolchain_args = { | ||
current_cpu = "arm" | ||
arm_arch = "armv7-a" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright (c) 2021 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. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import("//build_overrides/build.gni") | ||
|
||
import("${build_root}/config/sysroot.gni") | ||
import("${build_root}/toolchain/gcc_toolchain.gni") | ||
|
||
template("tizen_toolchain") { | ||
_invoker_toolchain_args = invoker.toolchain_args | ||
|
||
_tizen_toolchain_args = { | ||
current_os = "tizen" | ||
is_clang = true | ||
|
||
forward_variables_from(_invoker_toolchain_args, "*") | ||
} | ||
|
||
gcc_toolchain(target_name) { | ||
toolchain_args = _tizen_toolchain_args | ||
ar = "$sysroot/bin/arm-linux-gnueabi-ar" | ||
cc = "$sysroot/bin/arm-linux-gnueabi-gcc" | ||
cxx = "$sysroot/bin/arm-linux-gnueabi-g++" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright (c) 2021 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. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import("//build_overrides/build.gni") | ||
import("//build_overrides/chip.gni") | ||
|
||
import("${build_root}/chip/tests.gni") | ||
|
||
assert(current_os == "tizen") | ||
|
||
declare_args() { | ||
chip_build_pw_rpc_lib = false | ||
} | ||
|
||
group("tizen") { | ||
deps = [ "${chip_root}/src/lib" ] | ||
|
||
if (chip_build_tests) { | ||
deps += [ "${chip_root}/src:tests" ] | ||
} | ||
} | ||
|
||
group("default") { | ||
deps = [ ":tizen" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright (c) 2021 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. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import("//build_overrides/chip.gni") | ||
|
||
declare_args() { | ||
# Location of the Tizen SDK. | ||
tizen_sdk_root = "" | ||
} | ||
|
||
chip_device_platform = "tizen" | ||
|
||
chip_build_tests = false | ||
|
||
chip_inet_config_enable_raw_endpoint = false | ||
chip_inet_config_enable_dns_resolver = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Copyright (c) 2021 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. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import("//build_overrides/build.gni") | ||
import("//build_overrides/chip.gni") | ||
import("//build_overrides/tizen.gni") | ||
import("${chip_root}/config/tizen/chip-gn/args.gni") | ||
|
||
import("${build_root}/config/linux/pkg_config.gni") | ||
import("${chip_root}/src/platform/device.gni") | ||
|
||
pkg_config("dlog") { | ||
packages = [ "dlog" ] | ||
} | ||
|
||
pkg_config("capi-appfw-preference") { | ||
packages = [ "capi-appfw-preference" ] | ||
} | ||
|
||
pkg_config("glib") { | ||
packages = [ | ||
"glib-2.0", | ||
"gio-unix-2.0", | ||
] | ||
} | ||
|
||
if (chip_mdns == "platform") { | ||
pkg_config("nsd-dns-sd") { | ||
packages = [ "nsd-dns-sd" ] | ||
} | ||
} | ||
|
||
if (chip_enable_wifi) { | ||
pkg_config("capi-network-wifi-manager") { | ||
packages = [ "capi-network-wifi-manager" ] | ||
} | ||
pkg_config("capi-network-softap") { | ||
packages = [ "capi-network-softap" ] | ||
} | ||
} | ||
|
||
if (chip_enable_ble) { | ||
pkg_config("capi-network-bluetooth") { | ||
packages = [ "capi-network-bluetooth" ] | ||
} | ||
} | ||
|
||
source_set("tizen") { | ||
public_configs = [ | ||
":dlog", | ||
":glib", | ||
":capi-appfw-preference", | ||
] | ||
|
||
if (chip_mdns == "platform") { | ||
public_configs += [ ":nsd-dns-sd" ] | ||
} | ||
|
||
if (chip_enable_wifi) { | ||
public_configs += [ | ||
":capi-network-wifi-manager", | ||
":capi-network-softap", | ||
] | ||
} | ||
|
||
if (chip_enable_ble) { | ||
public_configs += [ ":capi-network-bluetooth" ] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
#!/bin/bash | ||
|
||
ROOTSTRAP_PATH="$1" | ||
CHIPROOT=$(git rev-parse --show-toplevel) | ||
|
||
NSD_DNS_LIBS="libnsd-dns-sd.so*" | ||
|
||
echo "$ROOTSTRAP_PATH" | ||
|
||
if [ -z "$ROOTSTRAP_PATH" ]; then | ||
echo "ROOTSTRAP_PATH should be input" | ||
exit 1 | ||
fi | ||
|
||
if [[ ! -d $ROOTSTRAP_PATH ]]; then | ||
echo "Can't find the rootstrap dir, please make dir and run this script again" | ||
exit 1 | ||
fi | ||
|
||
cd "$ROOTSTRAP_PATH" | ||
|
||
# Get Tizen rootstrap | ||
if [[ ! -f mobile-6.0-rs-device.core_0.0.123_ubuntu-64.zip ]]; then | ||
echo "Getting tizen rootstrap..." | ||
wget http://download.tizen.org/sdk/tizenstudio/official/binary/mobile-6.0-rs-device.core_0.0.123_ubuntu-64.zip | ||
fi | ||
unzip mobile-6.0-rs-device.core_0.0.123_ubuntu-64.zip | ||
mv data/platforms/tizen-6.0/mobile/rootstraps/mobile-6.0-device.core/usr . | ||
mv data/platforms/tizen-6.0/mobile/rootstraps/mobile-6.0-device.core/lib . | ||
|
||
# Clean files | ||
rm -rf data | ||
rm -rf mobile-6.0-rs-device.* | ||
rm pkginfo.manifest | ||
|
||
# Copy internal dns-sd header into rootstrap | ||
# After finishing ACR for internal APIs, we will remove this. | ||
|
||
rm "$ROOTSTRAP_PATH/usr/lib/$NSD_DNS_LIBS" | ||
|
||
# Get tizen packages | ||
function download_pkg() { | ||
if [ "$2" = "snapshots" ]; then | ||
wget -r -nd --no-parent -A "$1" "http://download.tizen.org/snapshots/tizen/unified/latest/repos/standard/packages/armv7l/" | ||
else | ||
wget -r -nd --no-parent -A "$1" "http://download.tizen.org/releases/milestone/tizen/${2:-base}/latest/repos/standard/packages/armv7l/" | ||
fi | ||
} | ||
|
||
# Base package | ||
for pkg in 'pcre-devel-*.armv7l.rpm' 'libffi-devel-*.armv7l.rpm' 'libmount-devel-*.armv7l.rpm' \ | ||
'libblkid-devel-*.armv7l.rpm' 'libcap-*.armv7l.rpm' 'liblzma-*.armv7l.rpm'; do | ||
download_pkg "$pkg" | ||
done | ||
|
||
# Unified package | ||
for pkg in 'vconf-compat-*.armv7l.rpm' 'libcynara-commons-*.armv7l.rpm' 'cynara-devel-*.armv7l.rpm' \ | ||
'libcynara-client-*.armv7l.rpm' 'dbus-1*.armv7l.rpm' 'dbus-devel-*.armv7l.rpm' \ | ||
'dbus-libs-1*.armv7l.rpm' 'glib2-devel-2*.armv7l.rpm' 'libdns_sd-*.armv7l.rpm' \ | ||
'buxton2-*.armv7l.rpm' 'libsystemd-*.armv7l.rpm'; do | ||
download_pkg "$pkg" unified | ||
done | ||
|
||
# Latest snapshots package (For nsd) | ||
for pkg in 'capi-network-nsd-0*.armv7l.rpm' 'capi-network-nsd-devel*.armv7l.rpm' 'libnsd-dns-sd*.armv7l.rpm' 'libdns_sd-*.armv7l.rpm'; do | ||
download_pkg "$pkg" snapshots | ||
done | ||
|
||
unrpm *.rpm | ||
|
||
cp usr/lib/pkgconfig/openssl1.1.pc usr/lib/pkgconfig/openssl.pc | ||
|
||
rm usr/lib/libdns_sd.so | ||
cp usr/lib/libdns_sd.so.878.* usr/lib/libdns_sd.so | ||
|
||
rm *.rpm | ||
|
||
# Get toolchain | ||
wget http://download.tizen.org/sdk/tizenstudio/official/binary/cross-arm-gcc-9.2_0.1.9_ubuntu-64.zip | ||
unzip cross-arm-gcc-9.2_0.1.9_ubuntu-64.zip | ||
|
||
cp -rf data/tools/arm-linux-gnueabi-gcc-9.2/* . | ||
|
||
rm pkginfo.manifest | ||
rm changelog | ||
rm -rf data | ||
|
||
rm cross-arm-gcc-9.2_0.1.9_ubuntu-64.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright (c) 2021 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. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
declare_args() { | ||
# Root directory for tizen. | ||
tizen_root = "//third_party/connectedhomeip/config/tizen/chip-gn/platform" | ||
} |
Oops, something went wrong.