Adriana Kobylak | 2ca101c | 2016-01-30 08:53:35 -0600 | [diff] [blame] | 1 | SUMMARY = "Settings DBUS object" |
| 2 | DESCRIPTION = "Settings DBUS object" |
| 3 | HOMEPAGE = "http://github.com/openbmc/phosphor-settingsd" |
| 4 | PR = "r1" |
| 5 | |
Brad Bishop | 677be98 | 2016-09-15 09:54:10 -0400 | [diff] [blame] | 6 | inherit allarch |
Adriana Kobylak | 2ca101c | 2016-01-30 08:53:35 -0600 | [diff] [blame] | 7 | inherit obmc-phosphor-license |
Adriana Kobylak | 79841ae | 2016-08-25 10:07:34 -0500 | [diff] [blame] | 8 | inherit setuptools |
Brad Bishop | 677be98 | 2016-09-15 09:54:10 -0400 | [diff] [blame] | 9 | inherit obmc-phosphor-dbus-service |
Xo Wang | 51a53f0 | 2017-03-17 18:15:10 -0700 | [diff] [blame] | 10 | inherit pythonnative |
Brad Bishop | 677be98 | 2016-09-15 09:54:10 -0400 | [diff] [blame] | 11 | |
| 12 | DBUS_SERVICE_${PN} = "org.openbmc.settings.Host.service" |
Adriana Kobylak | 2ca101c | 2016-01-30 08:53:35 -0600 | [diff] [blame] | 13 | |
Adriana Kobylak | 79841ae | 2016-08-25 10:07:34 -0500 | [diff] [blame] | 14 | DEPENDS += "python-pyyaml-native" |
Adriana Kobylak | 2ca101c | 2016-01-30 08:53:35 -0600 | [diff] [blame] | 15 | RDEPENDS_${PN} += "python-dbus python-pygobject" |
Adriana Kobylak | 79841ae | 2016-08-25 10:07:34 -0500 | [diff] [blame] | 16 | PROVIDES += "virtual/obmc-settings-mgmt" |
| 17 | RPROVIDES_${PN} += "virtual-obmc-settings-mgmt" |
Adriana Kobylak | 2ca101c | 2016-01-30 08:53:35 -0600 | [diff] [blame] | 18 | |
| 19 | SRC_URI += "git://github.com/openbmc/phosphor-settingsd" |
Xo Wang | 51a53f0 | 2017-03-17 18:15:10 -0700 | [diff] [blame] | 20 | SRC_URI += "file://merge_settings.py" |
Adriana Kobylak | 2ca101c | 2016-01-30 08:53:35 -0600 | [diff] [blame] | 21 | |
Patrick Williams | 6d18d35 | 2017-04-06 14:40:04 -0500 | [diff] [blame] | 22 | SRCREV = "3b8d055ca761a68c74dad01a306f238674d71878" |
Adriana Kobylak | 2ca101c | 2016-01-30 08:53:35 -0600 | [diff] [blame] | 23 | |
| 24 | S = "${WORKDIR}/git" |
Xo Wang | 51a53f0 | 2017-03-17 18:15:10 -0700 | [diff] [blame] | 25 | |
| 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. |
| 30 | python 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 |
| 51 | addtask merge_settings after do_configure before do_compile |