Permalink
Browse files

Work-around snap.yaml command line limitations

This makes the package conformant with other snaps by adding a command
wrapper script inside the root of the snap, which calls out to lsi-exec
to do the real job.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
  • Loading branch information...
1 parent 6412d58 commit 3cdf7f2d9f06187a76e26465551f470561be3de2 @ikeydoherty ikeydoherty committed Nov 15, 2017
Showing with 20 additions and 5 deletions.
  1. +5 −5 apps/linux-steam-integration/meta/snap.yaml
  2. +15 −0 mkapp.sh
@@ -50,7 +50,7 @@ apps:
- x11
settings:
- command: bin/linux-steam-integration.exec $SNAP/bin/linux-steam-integration.settings
+ command: command-linux-steam-integration.settings.wrapper
plugs:
- gsettings
- opengl
@@ -59,28 +59,28 @@ apps:
- x11
glxgears:
- command: bin/linux-steam-integration.exec $SNAP/bin/glxgears
+ command: command-glxgears.wrapper
plugs:
- opengl
- unity7
- x11
glxgears-32:
- command: bin/linux-steam-integration.exec $SNAP/bin/glxgears-32
+ command: command-glxgears-32.wrapper
plugs:
- opengl
- unity7
- x11
glxinfo:
- command: bin/linux-steam-integration.exec $SNAP/bin/glxinfo
+ command: command-glxinfo.wrapper
plugs:
- opengl
- unity7
- x11
glxinfo-32:
- command: bin/linux-steam-integration.exec $SNAP/bin/glxinfo-32
+ command: command-glxinfo-32.wrapper
plugs:
- opengl
- unity7
View
@@ -21,6 +21,17 @@ function init_root()
fi
}
+# Write a wrapper out that runs the named command via our lsi-exec handler
+# and accepts commands. This is so we pass review as we cannot have compound
+# command lines within snap.yaml
+function write_wrapper()
+{
+ local shfile="$ROOTDIR/command-$1.wrapper"
+ echo "#!/bin/sh" > "$shfile"
+ echo "exec \$SNAP/bin/linux-steam-integration.exec \$SNAP/bin/$1 \$*" >> "$shfile"
+ chmod 00755 $shfile
+}
+
# Cheap and dirty, copy the named runtime meta into the root and tell it to
# bake a snap for us
function cook_snap()
@@ -47,6 +58,10 @@ done
rm -rf "$PACKAGE_OUT_DIR"
+for wrap in "linux-steam-integration.settings" "glxgears" "glxgears-32" "glxinfo" "glxinfo-32" ; do
+ write_wrapper $wrap
+done
+
# Now lets cook a snap
cook_snap linux-steam-integration

0 comments on commit 3cdf7f2

Please sign in to comment.