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]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1, 2.2, 2.5, 2.6, 2.7, 2.8
Change log changelog.md
Dependencies base (>=4.8 && <5.0), Cabal, directory, filepath, here, hsinstall, process [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 2018-10-22T12:36:34Z
Distributions LTSHaskell:2.8, NixOS:2.8
Executables hsinstall
Downloads 7123 total (41 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-10-22 [all 1 reports]

Readme for hsinstall-2.0

[back to package description]

hsinstall

Synopsis

Install Haskell software

Description

OVERVIEW

hsinstall 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. 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:
https://docs.haskellstack.org/en/stable/README/

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

MODES

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.

The directory layout will be a standard FHS shape, common in UNIX-like operating systems. Like this:

<PREFIX>/
  bin/...
  share/
    <PROJECT>-<VERSION>/  <-- this is the share directory
      doc/LICENSE
      resources/...

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>

APPIMAGE CREATION

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.

RESOURCES

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 build filesystem-portable relative paths. See this source code for help on integrating this into your app: https://github.com/dino-/hsinstall/blob/master/src/lib/HSInstall/Resources.hs

Development

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 .

Contact

Authors

Dino Morelli dino@ui3.info