By Richard Szibele
31 August, 2018
After reading David Lettier's great post on How to Flatpak a Haskell App into Flathub, I thought about generalizing his approach for Haskell stack projects and have written stackpak.
It's quite simple: you give stackpak a base Flatpak manifest on how to build only your Haskell project and the path to your projects' directory and stackpak spits out a new Flatpak manifest with all Haskell dependencies included.
You would accomplish that by running the following command after installing stackpak:
$ stackpak --output=my-new-manifest.json /path/to/base-manifest.json /path/to/stack-project
To be able to generate your manifest for you, stackpak does the following:
A few things to note:
A base flatpak manifest for stackpak is as follows:
{
"app-id": "com.mysite.myapp",
"runtime": "org.freedesktop.Platform",
"runtime-version": "1.6",
"sdk": "org.freedesktop.Sdk",
"command": "my-haskell-exe",
"finish-args": [],
"cleanup": [],
"cleanup-commands": [],
"modules": [
{
"name": "my-haskell-exe",
"only-arches": [],
"buildsystem": "simple",
"builddir": true,
"build-commands": [
"ghc -threaded --make Setup",
"./Setup configure --prefix=/app",
"./Setup build",
"./Setup install"
],
"cleanup": [],
"cleanup-commands": [],
"sources": [
{
"type": "archive",
"url": "https://gitlab.com/myusername/myapp/-/archive/1.0.0/myapp-1.0.0.tar.gz",
"sha256": "4c4176d77d25e51df686bc1c30fa774e25132e45b787f3ce377ad92cd4562a2f"
}
]
}
]
}
An example project using stackpak is e-juice-calc, a calculator which allows you to calculate a recipe for mixing your own e-liquids.
Check out the base Flatpak manifest of E-Jucie-Calc and the generated Flatpak manifest
← back