hsinstall: Install Haskell software

[ library, program, utility ] [ Propose Tags ]

This is a tool for deploying software projects into directory structures suitable for installation on a system. It builds upon the `stack install` command and adds more features. It's also a tool for easier AppImage creation.

[Skip to Readme]
Versions [faq] 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1, 2.2
Change log changelog.md
Dependencies base (>=4.8 && <5.0), Cabal, directory, filepath, heredoc, hsinstall, process, safe-exceptions [details]
License ISC
Copyright 2016-2018 Dino Morelli
Author Dino Morelli
Maintainer Dino Morelli <dino@ui3.info>
Category Utility
Home page https://github.com/dino-/hsinstall#readme
Bug tracker https://github.com/dino-/hsinstall/issues
Source repo head: git clone https://github.com/dino-/hsinstall
Uploaded by DinoMorelli at Wed Nov 7 22:36:34 UTC 2018
Distributions LTSHaskell:2.2, NixOS:2.2, Stackage:2.2
Executables hsinstall
Downloads 2375 total (171 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2018-11-07 [all 1 reports]


[Index] [Quick Jump]


Maintainer's Corner

For package maintainers and hackage trustees

Readme for hsinstall-2.2

[back to package description]



Install Haskell software



hsinstall is a tool for deploying software projects into directory structures suitable for installation on a system. At this time this means Haskell software but possible future expansion could support other types of projects. It builds upon the stack install command and adds more features. Those are:

  • Copying the LICENSE file into the deployment directory
  • Copying the resources directory into the deployment directory so these files can be located using relative paths at runtime (more on this later in RESOURCES)
  • Building an AppDir directory structure for a project and producing an AppImage

It will be necessary to have the Haskell stack tool on your PATH:

If the AppImage features are desired, you must have these tools on your PATH:
linuxdeploy: https://github.com/linuxdeploy/linuxdeploy/releases
linuxdeploy-plugin-appimage: https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases


hsinstall operates in two modes. The first is a plain deployment with no AppImage creation. The PREFIX will default to AppDir/usr and all binaries in the project will be deployed to AppDir/usr/bin.

The second mode is intended to set up for AppImage creation and is triggered by specifying exactly one EXECUTABLE from the project in the arguments. This will change the PREFIX to AppDir_EXECUTABLE/usr. And only that single executable will be copied to the AppDir_EXECUTABLE/usr/bin directory.

Regardless of which mode is being used, the directory layout will be a standard FHS shape, common in UNIX-like operating systems. Like this:

    <PROJECT>-<VERSION>/  <-- this is the share directory

Be aware that when the --delete switch is used the binaries in <PREFIX>/bin WILL NOT be deleted, only the share directory: <PREFIX>/share/<PROJECT>-<VERSION>


Even for a first-time AppImaging, this tool should produce a working AppImage. If missing, it will create default .desktop and .svg files in util/resources/appimage. Customize or replace these to fit your project, and then check these two files into source control for future builds.

The default .desktop file Categories will be populated with 'Utility;'. We recommend adjusting this using the XDG list of registered categories: https://specifications.freedesktop.org/menu-spec/latest/apa.html

If your application is a command-line program, append this line to the end of the default .desktop file: 'Terminal=true'

If your application isn't a command-line tool, we recommend using a proper icon instead of the hsinstall default, which is a command shell icon.


If present, hsinstall will deploy a resources directory to <PREFIX>/share/PROJECT-VERSION/resources. In order to locate these files at runtime, the hsinstall project includes a library to construct paths relative to the executable. See this source code for help with integrating this into your app: https://github.com/dino-/hsinstall/blob/master/src/lib/HSInstall/Resources.hs


Browse the source

Get source with git and build

$ git clone https://github.com/dino-/hsinstall.git
$ cd hsinstall
$ stack build

If you have the abovementioned linuxdeploy-* programs on your path, we can do something really cool. Use this freshly-built hsinstall to package itself into an AppImage:

$ stack exec hsinstall -- --mk-appimage hsinstall

And you should see an hsinstall-x86_64.AppImage binary in .



Dino Morelli dino@ui3.info