blob: d03eca86d5efd324d481bc753f1671c3a755b71a [file] [log] [blame]
Adriana Kobylak2ca101c2016-01-30 08:53:35 -06001SUMMARY = "Settings DBUS object"
2DESCRIPTION = "Settings DBUS object"
3HOMEPAGE = "http://github.com/openbmc/phosphor-settingsd"
4PR = "r1"
5
Brad Bishop677be982016-09-15 09:54:10 -04006inherit allarch
Adriana Kobylak2ca101c2016-01-30 08:53:35 -06007inherit obmc-phosphor-license
Adriana Kobylak79841ae2016-08-25 10:07:34 -05008inherit setuptools
Brad Bishop677be982016-09-15 09:54:10 -04009inherit obmc-phosphor-dbus-service
Xo Wang51a53f02017-03-17 18:15:10 -070010inherit pythonnative
Brad Bishop677be982016-09-15 09:54:10 -040011
12DBUS_SERVICE_${PN} = "org.openbmc.settings.Host.service"
Adriana Kobylak2ca101c2016-01-30 08:53:35 -060013
Adriana Kobylak79841ae2016-08-25 10:07:34 -050014DEPENDS += "python-pyyaml-native"
Adriana Kobylak2ca101c2016-01-30 08:53:35 -060015RDEPENDS_${PN} += "python-dbus python-pygobject"
Adriana Kobylak79841ae2016-08-25 10:07:34 -050016PROVIDES += "virtual/obmc-settings-mgmt"
17RPROVIDES_${PN} += "virtual-obmc-settings-mgmt"
Adriana Kobylak2ca101c2016-01-30 08:53:35 -060018
19SRC_URI += "git://github.com/openbmc/phosphor-settingsd"
Xo Wang51a53f02017-03-17 18:15:10 -070020SRC_URI += "file://merge_settings.py"
Adriana Kobylak2ca101c2016-01-30 08:53:35 -060021
Patrick Williams6d18d352017-04-06 14:40:04 -050022SRCREV = "3b8d055ca761a68c74dad01a306f238674d71878"
Adriana Kobylak2ca101c2016-01-30 08:53:35 -060023
24S = "${WORKDIR}/git"
Xo Wang51a53f02017-03-17 18:15:10 -070025
26# Collect files in SRC_URI that end in ".override.yml" and call a script that
27# writes their contents over that of settings.yaml, which is then updated to
28# the merged data values.
29# This doesn't correctly handle globs in ".override.yml" entries in SRC_URI.
30python do_merge_settings () {
31 import subprocess
32
33 # TODO: Perform the merge in a temporary directory?
34 workdir = d.getVar('WORKDIR', True)
35 cmd = []
36 cmd.append(os.path.join(workdir, 'merge_settings.py'))
37 cmd.append(os.path.join(d.getVar('S', True), 'settings.yaml'))
38
39 fetch = bb.fetch2.Fetch([], d)
40 override_urls = filter(lambda f: f.endswith('.override.yml'), fetch.urls)
41 for url in override_urls:
42 bb.debug(2, 'Overriding with source: ' + url)
43 local_base = os.path.basename(fetch.localpath(url))
44 filename = os.path.join(workdir, local_base)
45 cmd.append(filename)
46
47 # Invoke the script and don't catch any resulting exception.
48 subprocess.check_call(cmd)
49}
50# python-pyyaml-native is installed by do_configure, so put this task after
51addtask merge_settings after do_configure before do_compile