Skip to content

Commit

Permalink
Use flatpak-spawn to run Google Chrome
Browse files Browse the repository at this point in the history
This allows us to make a self-contained extra-data flatpak that does
not need to rely on anything on the host to work.
  • Loading branch information
cosimoc committed Aug 8, 2018
1 parent 3abce45 commit 546b7f4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 210 deletions.
9 changes: 6 additions & 3 deletions com.google.Chrome.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"runtime": "org.freedesktop.Platform",
"runtime-version": "1.6",
"sdk": "org.freedesktop.Sdk",
"command": "/app/bin/eos-google-chrome-app",
"command": "google-chrome-launcher",
"finish-args": [
"--talk-name=org.freedesktop.Flatpak"
],
"cleanup": [
"/etc",
"/include",
Expand All @@ -22,7 +25,7 @@
"sources": [
{
"type": "file",
"path": "eos-google-chrome-app"
"path": "google-chrome-launcher"
},
{
"type": "file",
Expand All @@ -47,7 +50,7 @@
],
"build-commands": [
"install -d /app/bin",
"install eos-google-chrome-app /app/bin/eos-google-chrome-app",
"install google-chrome-launcher /app/bin/google-chrome-launcher",

"install -d /app/share/appdata",
"install -m644 com.google.Chrome.appdata.xml /app/share/appdata/com.google.Chrome.appdata.xml",
Expand Down
207 changes: 0 additions & 207 deletions eos-google-chrome-app

This file was deleted.

6 changes: 6 additions & 0 deletions google-chrome-launcher
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

chrome_flatpak_dir=`flatpak-spawn --host flatpak info -l com.google.Chrome`
chrome_binary=${chrome_flatpak_dir}/files/extra/opt/google/chrome/google-chrome

exec flatpak-spawn --host --env=LD_LIBRARY_PATH=${chrome_flatpak_dir}/files/lib ${chrome_binary}

0 comments on commit 546b7f4

Please sign in to comment.