weston-ini-conf: Make this track variables correctly for signatures
[AGL/meta-agl.git] / meta-agl / recipes-graphics / wayland / weston-ini-conf.bb
1 SUMMARY = "Startup script and systemd unit file for the Weston Wayland compositor"
2 LICENSE = "MIT"
3 LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"
4
5 S = "${WORKDIR}"
6
7 require weston-ini-conf/screen.inc
8
9 DEFAULT_SCREEN[transform]?="270"
10 DEFAULT_SCREEN[name]?="HDMI-A-1"
11
12 WESTONCORE[shell]??="desktop-shell.so"
13 WESTONCORE[backend]??="drm-backend.so"
14
15 WESTONSHELL[locking]="true"
16 # hide panel
17 WESTONSHELL[panel-location]="none"
18
19
20 WESTONOUTPUT1[agl_screen]??="DEFAULT_SCREEN"
21
22 WESTONSECTION[WESTONCORE]?="core"
23 WESTONSECTION[WESTONSHELL]?="shell"
24 WESTONSECTION[WESTONOUTPUT1]?="output"
25
26 python do_generate_weston_init() {
27     with open(d.getVar('WORKDIR', True)+"/weston.ini"  ,'w') as weston_ini:
28         dicoSection=d.getVarFlags('WESTONSECTION')
29         keysSection=list(dicoSection.keys())
30         keysSection.sort()
31         for section in keysSection:
32             weston_ini.writelines( "["+dicoSection[section]+"]\n")
33             dicoSectionValues=d.getVarFlags(section)
34             keysSectionValues=list(dicoSectionValues.keys())
35             keysSectionValues.sort()
36             for sectionValue in keysSectionValues:
37                 if (dicoSection[section] == "output" and sectionValue == "agl_screen"):
38                     screen=dicoSectionValues[sectionValue]
39                     dicoScreenConfig=d.getVarFlags(screen)
40                     keysScreenConfig=list(dicoScreenConfig.keys())
41                     keysScreenConfig.sort()
42                     for screenConfig in keysScreenConfig:
43                         weston_ini.writelines( screenConfig+"="+dicoScreenConfig[screenConfig]+"\n")
44                 else:
45                     weston_ini.writelines( str(sectionValue)+"="+str(dicoSectionValues[sectionValue])+"\n")
46
47             weston_ini.writelines( "\n")
48 }
49
50 #ar_src = d.getVarFlag('ARCHIVER_MODE', 'src', True)
51
52 addtask do_generate_weston_init after do_compile before do_install
53 do_generate_weston_init[vardeps] = "DEFAULT_SCREEN WESTONCORE WESTONSHELL WESTONOUTPUT1 WESTONSECTION"
54
55 do_install_append() {
56     WESTON_INI_CONFIG=${sysconfdir}/xdg/weston
57     install -d ${D}${WESTON_INI_CONFIG}
58     install -m 0644 ${WORKDIR}/weston.ini ${D}${WESTON_INI_CONFIG}/weston.ini
59 }