https://github.com/endlessm/grunt-electron-installer-flatpak
Create a flatpak for your Electron app.
https://github.com/endlessm/grunt-electron-installer-flatpak
Last synced: about 1 year ago
JSON representation
Create a flatpak for your Electron app.
- Host: GitHub
- URL: https://github.com/endlessm/grunt-electron-installer-flatpak
- Owner: endlessm
- License: mit
- Created: 2016-09-30T23:36:04.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-17T00:25:57.000Z (over 9 years ago)
- Last Synced: 2025-04-03T19:51:18.385Z (about 1 year ago)
- Language: JavaScript
- Size: 794 KB
- Stars: 2
- Watchers: 24
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# grunt-electron-installer-flatpak [](https://www.npmjs.com/package/grunt-electron-installer-flatpak) [](http://travis-ci.org/endlessm/grunt-electron-installer-flatpak)
Create a Flatpak package for your Electron app. This is based off the
[grunt-electron-installer-debian](https://github.com/unindented/grunt-electron-installer-debian)
tool.
Not a fan of [Grunt](http://gruntjs.com/)? Use the vanilla module [`electron-installer-flatpak`](https://github.com/endlessm/electron-installer-flatpak)!
## Requirements
This tool requires `flatpak` >= 0.6.13 to be installed on your system and
Grunt `~0.4.0`
## Getting Started
If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
```shell
npm install grunt-electron-installer-flatpak --save-dev
```
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
```js
grunt.loadNpmTasks('grunt-electron-installer-flatpak')
```
*This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that [you upgrade](http://gruntjs.com/upgrading-from-0.3-to-0.4), but in case you can't please use [v0.3.2](https://github.com/gruntjs/grunt-contrib-copy/tree/grunt-0.3-stable).*
## Installer task
_Run this task with the `grunt electron-installer-flatpak` command._
Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide.
### Usage
Say your Electron app lives in `path/to/app`, and has a structure like this:
```
.
├── LICENSE
├── README.md
├── node_modules
│ ├── electron-packager
│ └── electron-prebuilt
├── package.json
├── resources
│ ├── Icon.png
│ ├── IconTemplate.png
│ └── IconTemplate@2x.png
└── src
├── index.js
├── main
│ └── index.js
└── renderer
├── index.html
└── index.js
```
You now run `electron-packager` to build the app for Flatpak:
```
$ electron-packager . app --platform linux --arch x64 --out dist/
```
And you end up with something like this in your `dist` folder:
```
.
└── dist
└── app-linux-x64
├── LICENSE
├── LICENSES.chromium.html
├── content_shell.pak
├── app
├── icudtl.dat
├── libgcrypt.so.11
├── libnode.so
├── locales
├── natives_blob.bin
├── resources
├── snapshot_blob.bin
└── version
```
In order to create a flatpak for your app, the configuration for your Grunt task would look like this:
```js
'electron-installer-flatpak': {
app: {
options: {
arch: 'x64'
},
src: 'path/to/app/dist/app-linux-x64',
dest: 'path/to/app/dist/installers/'
}
}
```
The task will try to extract all necessary information from your `package.json`, and then generate your package at `path/to/app/dist/installers/`.
You can also create different packages for different architectures, while manually overriding certain options:
```js
'electron-installer-flatpak': {
options: {
productName: 'Foo',
categories: [
'Utility'
],
},
linux32: {
options: {
arch: 'ia32'
},
src: 'path/to/app/dist/app-linux-ia32',
dest: 'path/to/app/dist/installers/'
},
linux64: {
options: {
arch: 'x64'
},
src: 'path/to/app/dist/app-linux-x64',
dest: 'path/to/app/dist/installers/'
}
}
```
### Options
See the options supported by [`electron-installer-flatpak`](https://github.com/endlessm/electron-installer-flatpak#options).
## Meta
* Code: `git clone git://github.com/endlessm/grunt-electron-installer-flatpak.git`
* Home:
## Contributors
* Daniel Perez Alvarez ([unindented@gmail.com](mailto:unindented@gmail.com))
* Matt Watson ([mattdangerw@gmail.com](mailto:mattdangerw@gmail.com))
## License
Copyright (c) 2016 Daniel Perez Alvarez ([unindented.org](https://unindented.org/)). This is free software, and may be redistributed under the terms specified in the LICENSE file.