Skip to content

Commit

Permalink
Add Tizen OS target config/build files
Browse files Browse the repository at this point in the history
  • Loading branch information
wootak-jung committed Aug 21, 2021
1 parent fb02c62 commit f66f408
Show file tree
Hide file tree
Showing 5 changed files with 256 additions and 0 deletions.
18 changes: 18 additions & 0 deletions build_overrides/tizen.gni
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 = "//config/tizen/chip-gn/platform"
}
36 changes: 36 additions & 0 deletions config/tizen/chip-gn/BUILD.gn
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" ]
}
28 changes: 28 additions & 0 deletions config/tizen/chip-gn/args.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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
84 changes: 84 additions & 0 deletions config/tizen/chip-gn/platform/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# 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")

config("tizen_sdk_config") {
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 != "none") {
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 = [ ":tizen_sdk_config" ]

public_configs += [
":dlog",
":glib",
":capi-appfw-preference",
]

if (chip_mdns != "none") {
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" ]
}
}
90 changes: 90 additions & 0 deletions config/tizen/scripts/install_sdk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#!/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

0 comments on commit f66f408

Please sign in to comment.