Skip to content

Commit

Permalink
fix(snap): reduce deps #509
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Dec 24, 2016
1 parent a2ca818 commit 1fc26a5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions .idea/dictionaries/develar.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/targets/fpm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default class FpmTarget extends Target {
let depends = options.depends
if (depends == null) {
if (target === "deb") {
depends = ["libappindicator1", "libnotify-bin"]
depends = ["libnotify4", "libnss3"]
}
else {
depends = []
Expand Down
14 changes: 7 additions & 7 deletions src/targets/snap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export default class SnapTarget extends Target {
await copy(this.helper.maxIconPath, path.join(snapDir, "setup", "gui", "icon.png"))
}

await this.helper.computeDesktopEntry(this.options, `${snap.name}`, path.join(snapDir, "setup", "gui", `${snap.name}.desktop`), {
"Icon": "${SNAP}/meta/gui/icon.png"
})

if (options.assumes != null) {
if (!Array.isArray(options.assumes)) {
throw new Error("snap.assumes must be an array of strings")
Expand All @@ -53,20 +57,16 @@ export default class SnapTarget extends Target {
[snap.name]: {
command: `desktop-launch $SNAP/${packager.executableName}`,
plugs: [
"home", "unity7", "x11", "browser-support", "network", "gsettings", "pulseaudio", "opengl",
"home", "x11", "unity7", "unity8", "browser-support", "network", "gsettings", "pulseaudio", "opengl",
]
}
}

await this.helper.computeDesktopEntry(this.options, `${snap.name}`, path.join(snapDir, "setup", "gui", `${snap.name}.desktop`), {
"Icon": "${SNAP}/meta/gui/icon.png"
})

const isUseDocker = process.platform !== "linux"
snap.parts = {
app: {
plugin: "dump",
"stage-packages": ["libappindicator1", "libdbusmenu-glib4", "libnotify4", "libunity9", "libgconf-2-4", "libnss3", "libxss1", "fontconfig-config", "libnotify-bin"],
"stage-packages": ["libnotify4", "libnss3", "fontconfig-config"],
source: isUseDocker ? `/out/${path.basename(snapDir)}` : appOutDir,
filesets: {
app: [`${appOutDir}/*`],
Expand All @@ -76,7 +76,7 @@ export default class SnapTarget extends Target {
}

const snapcraft = path.join(snapDir, "snapcraft.yaml")
await writeFile(snapcraft, safeDump(snap))
await writeFile(snapcraft, safeDump(snap, {lineWidth: 160}))

// const args = ["snapcraft", path.relative(snapDir)]
// snap /out/${path.basename(snapDir)} --output /out/${path.basename(resultFile)}
Expand Down

0 comments on commit 1fc26a5

Please sign in to comment.