0edc05d243077348e935d07f31a1811a5397d33a
[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 WESTONCORE[require-input]??="false"
15
16 WESTONSHELL[locking]="true"
17 # hide panel
18 WESTONSHELL[panel-location]="none"
19
20
21 WESTONOUTPUT1[agl_screen]??="DEFAULT_SCREEN"
22
23 WESTONSECTION[WESTONCORE]?="core"
24 WESTONSECTION[WESTONSHELL]?="shell"
25 WESTONSECTION[WESTONOUTPUT1]?="output"
26
27 python do_generate_weston_init() {
28     with open(d.getVar('WORKDIR', True)+"/weston.ini"  ,'w') as weston_ini:
29         dicoSection=d.getVarFlags('WESTONSECTION')
30         keysSection=list(dicoSection.keys())
31         keysSection.sort()
32         for section in keysSection:
33             weston_ini.writelines( "["+dicoSection[section]+"]\n")
34             dicoSectionValues=d.getVarFlags(section)
35             keysSectionValues=list(dicoSectionValues.keys())
36             keysSectionValues.sort()
37             for sectionValue in keysSectionValues:
38                 if (dicoSection[section] == "output" and sectionValue == "agl_screen"):
39                     screen=dicoSectionValues[sectionValue]
40                     dicoScreenConfig=d.getVarFlags(screen)
41                     keysScreenConfig=list(dicoScreenConfig.keys())
42                     keysScreenConfig.sort()
43                     for screenConfig in keysScreenConfig:
44                         weston_ini.writelines( screenConfig+"="+dicoScreenConfig[screenConfig]+"\n")
45                 else:
46                     weston_ini.writelines( str(sectionValue)+"="+str(dicoSectionValues[sectionValue])+"\n")
47
48             weston_ini.writelines( "\n")
49 }
50
51 #ar_src = d.getVarFlag('ARCHIVER_MODE', 'src', True)
52
53 addtask do_generate_weston_init after do_compile before do_install
54 do_generate_weston_init[vardeps] = "DEFAULT_SCREEN WESTONCORE WESTONSHELL WESTONOUTPUT1 WESTONSECTION"
55
56 do_install_append() {
57     WESTON_INI_CONFIG=${sysconfdir}/xdg/weston
58     install -d ${D}${WESTON_INI_CONFIG}
59     install -m 0644 ${WORKDIR}/weston.ini ${D}${WESTON_INI_CONFIG}/weston.ini
60 }