-
Notifications
You must be signed in to change notification settings - Fork 30
/
webos_system_bus.bbclass
101 lines (85 loc) · 3.77 KB
/
webos_system_bus.bbclass
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Copyright (c) 2012-2023 LG Electronics, Inc.
#
# webos_system_bus
# This class is to be inherited by the recipe for every component that offers
# Luna System Bus services.
#
# Variables that control this bbclass's behavior:
#
# WEBOS_SYSTEM_BUS_FILES_LOCATION
# - The location of the system bus files to be installed. Defaults to
# ${S}/service. Set to "" to skip.
#
# WEBOS_SYSTEM_BUS_SKIP_DO_TASKS
# - If "1", all do_*() tasks or additions to them defined in this bbclass are
# skipped.
#
inherit webos_configure_manifest
inherit webos_filesystem_paths
webos_system_bus_install_files () {
local _LS_PRV_DIR="${D}$1" # destination directory for private hub files
local _LS_PUB_DIR="${D}$2" # destination directory for public hub files
local _LS_PRV_FILE="$3" # match string for private hub files
local _LS_PUB_FILE="$4" # match string for public hub files
local _LS_TREE="$5" # tree under which to search for the files
local i
_LS_PUB=`find $_LS_TREE -name "$_LS_PUB_FILE"`
_LS_PRV=`find $_LS_TREE -name "$_LS_PRV_FILE"`
if [ -n "${_LS_PUB}" ]; then
install -d $_LS_PUB_DIR
for i in $_LS_PUB; do
_LS_PUB_DEST=`basename $i .pub`
bbnote "PUBLIC: $_LS_PUB_DIR/$_LS_PUB_DEST"
install -v -m 0644 $i $_LS_PUB_DIR/$_LS_PUB_DEST
done
fi
if [ -n "${_LS_PRV}" ]; then
install -d $_LS_PRV_DIR
for i in $_LS_PRV; do
_LS_PRV_DEST=`basename $i .prv`
bbnote "PRIVATE: $_LS_PRV_DIR/$_LS_PRV_DEST"
install -v -m 0644 $i $_LS_PRV_DIR/$_LS_PRV_DEST
done
fi
}
# - Can't assume our current directory is still ${S}
# - Default to the pre webOS OSE location (because it's intended everything in
# webOS OSE is not require installation by the recipe).
WEBOS_SYSTEM_BUS_FILES_LOCATION ?= "${S}/service"
do_install:append () {
# Only want WEBOS_SYSTEM_BUS_SKIP_DO_TASKS to be expanded by bitbake => single quotes
if [ '${WEBOS_SYSTEM_BUS_SKIP_DO_TASKS}' != 1 ]; then
local tree=${WEBOS_SYSTEM_BUS_FILES_LOCATION}
if [ -n "$tree" -a -d "$tree" ]; then
webos_system_bus_install_files ${webos_sysbus_prvservicesdir} ${webos_sysbus_pubservicesdir} "*.service.prv" "*.service.pub" "$tree"
webos_system_bus_install_files ${webos_sysbus_prvrolesdir} ${webos_sysbus_pubrolesdir} "*.json.prv" "*.json.pub" "$tree"
# If the files don't have .prv/.pub suffixes, then the same file is meant to be used for both (and there's no suffix to be removed)
webos_system_bus_install_files ${webos_sysbus_prvservicesdir} ${webos_sysbus_pubservicesdir} "*.service" "*.service" "$tree"
webos_system_bus_install_files ${webos_sysbus_prvrolesdir} ${webos_sysbus_pubrolesdir} "*.json" "*.json" "$tree"
bbnote "$pkgname: Installing roles and services files from bitbake is deprecated - use cmake, qmake, etc."
fi
fi
}
WEBOS_SYSTEM_BUS_DIRS_LEGACY += " \
${webos_sysbus_prvservicesdir} \
${webos_sysbus_pubservicesdir} \
${webos_sysbus_prvrolesdir} \
${webos_sysbus_pubrolesdir} \
"
WEBOS_SYSTEM_BUS_DIRS += " \
${webos_sysbus_rolesdir} \
${webos_sysbus_servicedir} \
${webos_sysbus_permissionsdir} \
${webos_sysbus_apipermissionsdir} \
${webos_sysbus_groupsdir} \
${webos_sysbus_intentsdir} \
${webos_sysbus_intentfiltersdir} \
${webos_sysbus_manifestsdir} \
"
FILES:${PN} += "${WEBOS_SYSTEM_BUS_DIRS_LEGACY} ${WEBOS_SYSTEM_BUS_DIRS}"
sysroot_stage_dirs:append() {
# $to is 2nd parameter passed to sysroot_stage_dir, e.g. ${SYSROOT_DESTDIR} passed from sysroot_stage_all
for dir in ${WEBOS_SYSTEM_BUS_DIRS_LEGACY} ${WEBOS_SYSTEM_BUS_DIRS}; do
rm -rf $to$dir
done
}