[weston] ivi-shell: use install paths in example config

Submitted by Ucan, Emre (ADITG/ESB) on May 24, 2018, 1:44 p.m.

Details

Message ID 1527169480-3006-1-git-send-email-eucan@de.adit-jv.com
State New
Series "ivi-shell: use install paths in example config"
Headers show

Commit Message

Ucan, Emre (ADITG/ESB) May 24, 2018, 1:44 p.m.
The example weston.ini file uses source and build
directory paths. Therefore, it is only useful when
used on the same system that is used to build Weston.

We can use install paths instead of build/source paths
to fix this problem.

Reported-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
---
 Makefile.am             |  4 +---
 ivi-shell/weston.ini.in | 60 ++++++++++++++++++++++++-------------------------
 2 files changed, 31 insertions(+), 33 deletions(-)

Patch hide | download patch | download mbox

diff --git a/Makefile.am b/Makefile.am
index 69ca6cb..b5f29bc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -24,10 +24,8 @@  weston.ini : $(srcdir)/weston.ini.in
 ivi-shell/weston.ini : $(srcdir)/ivi-shell/weston.ini.in
 	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
 		-e 's|@bindir[@]|$(bindir)|g' \
-		-e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \
-		-e 's|@abs_top_srcdir[@]|$(abs_top_srcdir)|g' \
 		-e 's|@libexecdir[@]|$(libexecdir)|g' \
-		-e 's|@plugin_prefix[@]||g' \
+		-e 's|@datadir[@]|$(datadir)|g' \
 		$< > $@
 
 all-local : weston.ini ivi-shell/weston.ini
diff --git a/ivi-shell/weston.ini.in b/ivi-shell/weston.ini.in
index 3f11e1c..51238e3 100644
--- a/ivi-shell/weston.ini.in
+++ b/ivi-shell/weston.ini.in
@@ -1,9 +1,9 @@ 
 [core]
-shell=@plugin_prefix@ivi-shell.so
-modules=@plugin_prefix@hmi-controller.so
+shell=ivi-shell.so
+modules=hmi-controller.so
 
 [ivi-shell]
-ivi-shell-user-interface=@abs_top_builddir@/weston-ivi-shell-user-interface
+ivi-shell-user-interface=@libexecdir@/weston-ivi-shell-user-interface
 
 #developermode=true
 
@@ -19,20 +19,20 @@  application-layer-id=4000
 
 transition-duration=300
 
-background-image=@abs_top_srcdir@/data/background.png
+background-image=@datadir@/weston/background.png
 background-id=1001
-panel-image=@abs_top_srcdir@/data/panel.png
+panel-image=@datadir@/weston/panel.png
 panel-id=1002
 surface-id-offset=10
-tiling-image=@abs_top_srcdir@/data/tiling.png
+tiling-image=@datadir@/weston/tiling.png
 tiling-id=1003
-sidebyside-image=@abs_top_srcdir@/data/sidebyside.png
+sidebyside-image=@datadir@/weston/sidebyside.png
 sidebyside-id=1004
-fullscreen-image=@abs_top_srcdir@/data/fullscreen.png
+fullscreen-image=@datadir@/weston/fullscreen.png
 fullscreen-id=1005
-random-image=@abs_top_srcdir@/data/random.png
+random-image=@datadir@/weston/random.png
 random-id=1006
-home-image=@abs_top_srcdir@/data/home.png
+home-image=@datadir@/weston/home.png
 home-id=1007
 workspace-background-color=0x99000000
 workspace-background-id=2001
@@ -43,59 +43,59 @@  path=@libexecdir@/weston-keyboard
 [ivi-launcher]
 workspace-id=0
 icon-id=4001
-icon=@abs_top_srcdir@/data/icon_ivi_flower.png
-path=@abs_top_builddir@/weston-flower
+icon=@datadir@/weston/icon_ivi_flower.png
+path=@bindir@/weston-flower
 
 [ivi-launcher]
 workspace-id=0
 icon-id=4002
-icon=@abs_top_srcdir@/data/icon_ivi_clickdot.png
-path=@abs_top_builddir@/weston-clickdot
+icon=@datadir@/weston/icon_ivi_clickdot.png
+path=@bindir@/weston-clickdot
 
 [ivi-launcher]
 workspace-id=1
 icon-id=4003
-icon=@abs_top_srcdir@/data/icon_ivi_simple-egl.png
-path=@abs_top_builddir@/weston-simple-egl
+icon=@datadir@/weston/icon_ivi_simple-egl.png
+path=@bindir@/weston-simple-egl
 
 [ivi-launcher]
 workspace-id=1
 icon-id=4004
-icon=@abs_top_srcdir@/data/icon_ivi_simple-shm.png
-path=@abs_top_builddir@/weston-simple-shm
+icon=@datadir@/weston/icon_ivi_simple-shm.png
+path=@bindir@/weston-simple-shm
 
 [ivi-launcher]
 workspace-id=2
 icon-id=4005
-icon=@abs_top_srcdir@/data/icon_ivi_smoke.png
-path=@abs_top_builddir@/weston-smoke
+icon=@datadir@/weston/icon_ivi_smoke.png
+path=@bindir@/weston-smoke
 
 [ivi-launcher]
 workspace-id=3
 icon-id=4006
-icon=@abs_top_srcdir@/data/icon_ivi_flower.png
-path=@abs_top_builddir@/weston-flower
+icon=@datadir@/weston/icon_ivi_flower.png
+path=@bindir@/weston-flower
 
 [ivi-launcher]
 workspace-id=3
 icon-id=4007
-icon=@abs_top_srcdir@/data/icon_ivi_clickdot.png
-path=@abs_top_builddir@/weston-clickdot
+icon=@datadir@/weston/icon_ivi_clickdot.png
+path=@bindir@/weston-clickdot
 
 [ivi-launcher]
 workspace-id=3
 icon-id=4008
-icon=@abs_top_srcdir@/data/icon_ivi_simple-egl.png
-path=@abs_top_builddir@/weston-simple-egl
+icon=@datadir@/weston/icon_ivi_simple-egl.png
+path=@bindir@/weston-simple-egl
 
 [ivi-launcher]
 workspace-id=3
 icon-id=4009
-icon=@abs_top_srcdir@/data/icon_ivi_simple-shm.png
-path=@abs_top_builddir@/weston-simple-shm
+icon=@datadir@/weston/icon_ivi_simple-shm.png
+path=@bindir@/weston-simple-shm
 
 [ivi-launcher]
 workspace-id=3
 icon-id=4010
-icon=@abs_top_srcdir@/data/icon_ivi_smoke.png
-path=@abs_top_builddir@/weston-smoke
+icon=@datadir@/weston/icon_ivi_smoke.png
+path=@bindir@/weston-smoke

Comments

Michael Tretter May 24, 2018, 2:20 p.m.
On Thu, 24 May 2018 15:44:40 +0200, Emre Ucan wrote:
> The example weston.ini file uses source and build
> directory paths. Therefore, it is only useful when
> used on the same system that is used to build Weston.
> 
> We can use install paths instead of build/source paths
> to fix this problem.

The main weston.ini.in still uses @abs_top_srcdir@. Shouldn't
this be changed as well?

> 
> Reported-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
> ---
>  Makefile.am             |  4 +---
>  ivi-shell/weston.ini.in | 60 ++++++++++++++++++++++++-------------------------
>  2 files changed, 31 insertions(+), 33 deletions(-)
> 
> diff --git a/Makefile.am b/Makefile.am
> index 69ca6cb..b5f29bc 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -24,10 +24,8 @@ weston.ini : $(srcdir)/weston.ini.in
>  ivi-shell/weston.ini : $(srcdir)/ivi-shell/weston.ini.in
>  	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
>  		-e 's|@bindir[@]|$(bindir)|g' \
> -		-e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \
> -		-e 's|@abs_top_srcdir[@]|$(abs_top_srcdir)|g' \
>  		-e 's|@libexecdir[@]|$(libexecdir)|g' \
> -		-e 's|@plugin_prefix[@]||g' \
> +		-e 's|@datadir[@]|$(datadir)|g' \
>  		$< > $@
>  
>  all-local : weston.ini ivi-shell/weston.ini
> diff --git a/ivi-shell/weston.ini.in b/ivi-shell/weston.ini.in
> index 3f11e1c..51238e3 100644
> --- a/ivi-shell/weston.ini.in
> +++ b/ivi-shell/weston.ini.in
> @@ -1,9 +1,9 @@
>  [core]
> -shell=@plugin_prefix@ivi-shell.so
> -modules=@plugin_prefix@hmi-controller.so
> +shell=ivi-shell.so
> +modules=hmi-controller.so
>  
>  [ivi-shell]
> -ivi-shell-user-interface=@abs_top_builddir@/weston-ivi-shell-user-interface
> +ivi-shell-user-interface=@libexecdir@/weston-ivi-shell-user-interface
>  
>  #developermode=true
>  
> @@ -19,20 +19,20 @@ application-layer-id=4000
>  
>  transition-duration=300
>  
> -background-image=@abs_top_srcdir@/data/background.png
> +background-image=@datadir@/weston/background.png

This still duplicates the sub-directory "weston/" from Makefile.am.
Similar to my earlier patch, we should use @westondatadir@, which is
used as install location in Makefile.am, instead of
@datadir@/weston as path.

Michael

>  background-id=1001
> -panel-image=@abs_top_srcdir@/data/panel.png
> +panel-image=@datadir@/weston/panel.png
>  panel-id=1002
>  surface-id-offset=10
> -tiling-image=@abs_top_srcdir@/data/tiling.png
> +tiling-image=@datadir@/weston/tiling.png
>  tiling-id=1003
> -sidebyside-image=@abs_top_srcdir@/data/sidebyside.png
> +sidebyside-image=@datadir@/weston/sidebyside.png
>  sidebyside-id=1004
> -fullscreen-image=@abs_top_srcdir@/data/fullscreen.png
> +fullscreen-image=@datadir@/weston/fullscreen.png
>  fullscreen-id=1005
> -random-image=@abs_top_srcdir@/data/random.png
> +random-image=@datadir@/weston/random.png
>  random-id=1006
> -home-image=@abs_top_srcdir@/data/home.png
> +home-image=@datadir@/weston/home.png
>  home-id=1007
>  workspace-background-color=0x99000000
>  workspace-background-id=2001
> @@ -43,59 +43,59 @@ path=@libexecdir@/weston-keyboard
>  [ivi-launcher]
>  workspace-id=0
>  icon-id=4001
> -icon=@abs_top_srcdir@/data/icon_ivi_flower.png
> -path=@abs_top_builddir@/weston-flower
> +icon=@datadir@/weston/icon_ivi_flower.png
> +path=@bindir@/weston-flower
>  
>  [ivi-launcher]
>  workspace-id=0
>  icon-id=4002
> -icon=@abs_top_srcdir@/data/icon_ivi_clickdot.png
> -path=@abs_top_builddir@/weston-clickdot
> +icon=@datadir@/weston/icon_ivi_clickdot.png
> +path=@bindir@/weston-clickdot
>  
>  [ivi-launcher]
>  workspace-id=1
>  icon-id=4003
> -icon=@abs_top_srcdir@/data/icon_ivi_simple-egl.png
> -path=@abs_top_builddir@/weston-simple-egl
> +icon=@datadir@/weston/icon_ivi_simple-egl.png
> +path=@bindir@/weston-simple-egl
>  
>  [ivi-launcher]
>  workspace-id=1
>  icon-id=4004
> -icon=@abs_top_srcdir@/data/icon_ivi_simple-shm.png
> -path=@abs_top_builddir@/weston-simple-shm
> +icon=@datadir@/weston/icon_ivi_simple-shm.png
> +path=@bindir@/weston-simple-shm
>  
>  [ivi-launcher]
>  workspace-id=2
>  icon-id=4005
> -icon=@abs_top_srcdir@/data/icon_ivi_smoke.png
> -path=@abs_top_builddir@/weston-smoke
> +icon=@datadir@/weston/icon_ivi_smoke.png
> +path=@bindir@/weston-smoke
>  
>  [ivi-launcher]
>  workspace-id=3
>  icon-id=4006
> -icon=@abs_top_srcdir@/data/icon_ivi_flower.png
> -path=@abs_top_builddir@/weston-flower
> +icon=@datadir@/weston/icon_ivi_flower.png
> +path=@bindir@/weston-flower
>  
>  [ivi-launcher]
>  workspace-id=3
>  icon-id=4007
> -icon=@abs_top_srcdir@/data/icon_ivi_clickdot.png
> -path=@abs_top_builddir@/weston-clickdot
> +icon=@datadir@/weston/icon_ivi_clickdot.png
> +path=@bindir@/weston-clickdot
>  
>  [ivi-launcher]
>  workspace-id=3
>  icon-id=4008
> -icon=@abs_top_srcdir@/data/icon_ivi_simple-egl.png
> -path=@abs_top_builddir@/weston-simple-egl
> +icon=@datadir@/weston/icon_ivi_simple-egl.png
> +path=@bindir@/weston-simple-egl
>  
>  [ivi-launcher]
>  workspace-id=3
>  icon-id=4009
> -icon=@abs_top_srcdir@/data/icon_ivi_simple-shm.png
> -path=@abs_top_builddir@/weston-simple-shm
> +icon=@datadir@/weston/icon_ivi_simple-shm.png
> +path=@bindir@/weston-simple-shm
>  
>  [ivi-launcher]
>  workspace-id=3
>  icon-id=4010
> -icon=@abs_top_srcdir@/data/icon_ivi_smoke.png
> -path=@abs_top_builddir@/weston-smoke
> +icon=@datadir@/weston/icon_ivi_smoke.png
> +path=@bindir@/weston-smoke
Ucan, Emre (ADITG/ESB) May 24, 2018, 2:54 p.m.
Hi,

> -----Original Message-----
> From: Michael Tretter [mailto:m.tretter@pengutronix.de]
> Sent: Donnerstag, 24. Mai 2018 16:21
> To: Ucan, Emre (ADITG/ESB) <eucan@de.adit-jv.com>; wayland-
> devel@lists.freedesktop.org
> Subject: Re: [PATCH weston] ivi-shell: use install paths in example config
> 
> On Thu, 24 May 2018 15:44:40 +0200, Emre Ucan wrote:
> > The example weston.ini file uses source and build
> > directory paths. Therefore, it is only useful when
> > used on the same system that is used to build Weston.
> >
> > We can use install paths instead of build/source paths
> > to fix this problem.
> 
> The main weston.ini.in still uses @abs_top_srcdir@. Shouldn't
> this be changed as well?

This can be done. The reported issue was for ivi-shell. Therefore, I fixed that.
Furthermore, the main weston.ini has many hard coded paths, e.g.:
[launcher]
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
path=/usr/bin/gnome-terminal

Therefore, just changing src directories to install directories does not make it portable.

> 
> >
> > Reported-by: Michael Tretter <m.tretter@pengutronix.de>
> > Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
> > ---
> >  Makefile.am             |  4 +---
> >  ivi-shell/weston.ini.in | 60 ++++++++++++++++++++++++--------------------
> -----
> >  2 files changed, 31 insertions(+), 33 deletions(-)
> >
> > diff --git a/Makefile.am b/Makefile.am
> > index 69ca6cb..b5f29bc 100644
> > --- a/Makefile.am
> > +++ b/Makefile.am
> > @@ -24,10 +24,8 @@ weston.ini : $(srcdir)/weston.ini.in
> >  ivi-shell/weston.ini : $(srcdir)/ivi-shell/weston.ini.in
> >  	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
> >  		-e 's|@bindir[@]|$(bindir)|g' \
> > -		-e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \
> > -		-e 's|@abs_top_srcdir[@]|$(abs_top_srcdir)|g' \
> >  		-e 's|@libexecdir[@]|$(libexecdir)|g' \
> > -		-e 's|@plugin_prefix[@]||g' \
> > +		-e 's|@datadir[@]|$(datadir)|g' \
> >  		$< > $@
> >
> >  all-local : weston.ini ivi-shell/weston.ini
> > diff --git a/ivi-shell/weston.ini.in b/ivi-shell/weston.ini.in
> > index 3f11e1c..51238e3 100644
> > --- a/ivi-shell/weston.ini.in
> > +++ b/ivi-shell/weston.ini.in
> > @@ -1,9 +1,9 @@
> >  [core]
> > -shell=@plugin_prefix@ivi-shell.so
> > -modules=@plugin_prefix@hmi-controller.so
> > +shell=ivi-shell.so
> > +modules=hmi-controller.so
> >
> >  [ivi-shell]
> > -ivi-shell-user-interface=@abs_top_builddir@/weston-ivi-shell-user-
> interface
> > +ivi-shell-user-interface=@libexecdir@/weston-ivi-shell-user-interface
> >
> >  #developermode=true
> >
> > @@ -19,20 +19,20 @@ application-layer-id=4000
> >
> >  transition-duration=300
> >
> > -background-image=@abs_top_srcdir@/data/background.png
> > +background-image=@datadir@/weston/background.png
> 
> This still duplicates the sub-directory "weston/" from Makefile.am.
> Similar to my earlier patch, we should use @westondatadir@, which is
> used as install location in Makefile.am, instead of
> @datadir@/weston as path.

Fine, I will fix this and send a new patch.

Emre
> 
> Michael
> 
> >  background-id=1001
> > -panel-image=@abs_top_srcdir@/data/panel.png
> > +panel-image=@datadir@/weston/panel.png
> >  panel-id=1002
> >  surface-id-offset=10