Update recipes generation.
[scm/bb/meta-tizen.git] / recipes-tizen / weston-common / weston-common.inc
1 DESCRIPTION = "Tizen Common Weston configuration and set-up"
2 HOMEPAGE = "http://nohomepage.org"
3 SECTION = "Base/Configuration"
4 LICENSE = "MIT"
5
6 SRC_URI = ""
7
8 S = "${WORKDIR}/git"
9
10 inherit autotools-brokensep
11
12 BBCLASSEXTEND += ""
13 PROVIDES = ""
14
15 #PROVIDES by weston-common 
16 # the PROVIDES rules is ignore "weston-startup  "
17 PROVIDES += "weston-startup"
18 RPROVIDES_weston-common += "weston-startup"
19
20
21 #PROVIDES by weston-common-config 
22
23
24 #PROVIDES by weston-common-tz-launcher 
25
26
27 RDEPENDS = ""
28 #RDEPENDS of weston-common (${PN})
29 RDEPENDS_${PN} += "weston"
30 RDEPENDS_${PN} += "eglibc"
31 RDEPENDS_${PN} += "pwdutils"
32
33
34 DEPENDS = ""
35 #DEPENDS of weston-common 
36 DEPENDS += "weston"
37 DEPENDS += "libxkbcommon"
38 DEPENDS += "cairo"
39 DEPENDS += "glib-2.0"
40 DEPENDS_append_class-native = " pkgconfig-native"
41 DEPENDS_append_class-target = " pkgconfig-native"
42 DEPENDS += "jpeg"
43 DEPENDS_append_class-native = " automake-native"
44 DEPENDS_append_class-target = " automake-native"
45 DEPENDS += "xz"
46 DEPENDS += "wayland"
47 DEPENDS_append_class-native = " libtool"
48 DEPENDS_append_class-target = " libtool-cross"
49 DEPENDS += "libpng"
50 DEPENDS += "mesa"
51 DEPENDS_append_class-native = " autoconf-native"
52 DEPENDS_append_class-target = " autoconf-native"
53 DEPENDS += "vconf"
54 DEPENDS += "pixman"
55
56 do_prep() {
57  cd ${S}
58  chmod -Rf a+rX,u+w,g-w,o-w ${S}
59  #setup -q
60  cp ${S}/packaging/weston-common.manifest .
61  
62  
63 }
64 do_patch_append() {
65     bb.build.exec_func('do_prep', d)
66 }
67
68 do_configure() {
69 }
70
71 do_compile() {
72  cd ${S}
73  LANG=C
74  export LANG
75  unset DISPLAY
76  CFLAGS="-O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables" ; export CFLAGS ; 
77  CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ; 
78  FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir}" ; export FFLAGS ; 
79  LD_AS_NEEDED=1; export LD_AS_NEEDED ; 
80  
81  cd tz-launcher
82  
83    CFLAGS="${CFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CFLAGS ; 
84    CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ; 
85    FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir}" ; export FFLAGS ; 
86    autotools_do_configure --build=${TARGET_SYS} --host=${HOST_SYS} \
87          --target=x86_64-tizen-linux \
88          --program-prefix= \
89          --prefix=${prefix} \
90          --exec-prefix=${prefix} \
91          --bindir=${prefix}/bin \
92          --sbindir=${prefix}/sbin \
93          --sysconfdir=${sysconfdir} \
94          --datadir=${prefix}/share \
95          --includedir=${prefix}/include \
96          --libdir=${prefix}/lib \
97          --libexecdir=${prefix}/libexec \
98          --localstatedir=${localstatedir} \
99          --sharedstatedir=${prefix}/com \
100          --mandir=${mandir} \
101          --infodir=${infodir}
102  make -j16
103  
104  
105  
106 }
107
108 do_install() {
109  echo export RPM_BUILD_ROOT=${D}
110  cd ${S}
111  LANG=C
112  export LANG
113  unset DISPLAY
114  rm -rf ${D} 
115  mkdir -p ${D} 
116  
117  
118  #install tz-launcher
119  cd tz-launcher
120  
121    oe_runmake \
122          DESTDIR=${D} \
123          INSTALL_ROOT=${D} \
124          BINDIR=${prefix}/bin \
125    install  
126    rm -f ${D}${infodir}/dir 
127    find ${D} -regex ".*\.la$" | xargs rm -f -- 
128    find ${D} -regex ".*\.a$" | xargs rm -f --
129  cd ..
130  
131  # install weston service as 'display-manager.service' as it's the one wanted by graphical.target
132  mkdir -p ${D}/lib/systemd/system
133  install -m 644 display-manager-run.service ${D}/lib/systemd/system/display-manager-run.service
134  install -m 644 display-manager.service ${D}/lib/systemd/system/display-manager.service
135  install -m 644 display-manager.path ${D}/lib/systemd/system/display-manager.path
136  
137  # install Environment file for weston service and weston-user.service
138  mkdir -p ${D}${sysconfdir}/sysconfig
139  install -m 0644 weston.sysconfig ${D}${sysconfdir}/sysconfig/weston
140  install -m 0644 weston-user.sysconfig ${D}${sysconfdir}/sysconfig/weston-user
141  
142  # install tmpfiles.d(5) conf
143  mkdir -p ${D}${prefix}/lib/tmpfiles.d
144  install -m 0644 weston_tmpfiles.conf ${D}${prefix}/lib/tmpfiles.d/weston.conf
145  
146  # install weston-user service in user session
147  mkdir -p ${D}/lib/systemd/user
148  install -m 644 weston-user.service ${D}/lib/systemd/user/
149  
150  # install weston.sh
151  mkdir -p ${D}${sysconfdir}/profile.d/
152  install -m 0644 weston.sh ${D}${sysconfdir}/profile.d/
153  
154  # install weston.ini
155  mkdir -p ${D}${sysconfdir}/xdg/weston
156  install -m 0644 weston.ini ${D}${sysconfdir}/xdg/weston
157  
158  # Add a rule to ensure the 'display' user has permissions to
159  # open the graphics device
160  mkdir -p ${D}${sysconfdir}/udev/rules.d
161  cat >${D}${sysconfdir}/udev/rules.d/99-dri.rules <<'EOF'
162  SUBSYSTEM=="drm", MODE="0660", GROUP="display", SMACK="*"
163 EOF
164  
165  # user 'display' must own /dev/tty7 for weston to start correctly
166  cat >${D}${sysconfdir}/udev/rules.d/99-tty.rules <<'EOF'
167  SUBSYSTEM=="tty", KERNEL=="tty7", OWNER="display", SMACK="^"
168 EOF
169  
170  # user 'display' must also be able to access /dev/input/event*
171  cat >${D}${sysconfdir}/udev/rules.d/99-input.rules <<'EOF'
172  SUBSYSTEM=="input", KERNEL=="event*", MODE="0660", GROUP="input", SMACK="^"
173 EOF
174  
175  # install desktop file
176  mkdir -p ${D}${prefix}/share/applications
177  install -m 0644 weston-terminal.desktop ${D}${prefix}/share/applications
178  
179  
180 }
181
182 PACKAGES += " weston-common-tz-launcher "
183 PACKAGES += " weston-common-config "
184
185 weston-common-tz-launcher_files = ""
186 weston-common-tz-launcher_files += "weston-common.manifest"
187 weston-common-tz-launcher_files += "${prefix}/bin/tz-launcher"
188 weston-common-tz-launcher_files += "${prefix}/bin/wl-pre"
189
190 weston-common_files = ""
191 weston-common_files += "weston-common.manifest"
192 weston-common_files += "/lib/systemd/system/display-manager-run.service"
193 weston-common_files += "/lib/systemd/system/display-manager.service"
194 weston-common_files += "/lib/systemd/system/display-manager.path"
195 weston-common_files += "${sysconfdir}/sysconfig/*"
196 weston-common_files += "${prefix}/lib/tmpfiles.d/weston.conf"
197 weston-common_files += "/lib/systemd/user/weston-user.service"
198 weston-common_files += "${sysconfdir}/profile.d/*"
199 weston-common_files += "${sysconfdir}/udev/rules.d/*"
200 weston-common_files += "${prefix}/share/applications/*.desktop"
201
202 weston-common-config_files = ""
203 weston-common-config_files += "weston-common.manifest"
204 weston-common-config_files += "${sysconfdir}/xdg/weston/weston.ini"
205
206 FILES_${PN}-tz-launcher = "${weston-common-tz-launcher_files}"
207 FILES_${PN} = "${weston-common_files}"
208 FILES_${PN}-config = "${weston-common-config_files}"
209
210 PKG_weston-common-tz-launcher= "weston-common-tz-launcher"
211 PKG_weston-common= "weston-common"
212 PKG_weston-common-config= "weston-common-config"
213
214 require weston-common-extraconf.inc
215