Haskell package guidelines

This document aims to cover standards and guidelines for producing good Haskell packages on Arch.

Arch package guidelines

32-bitCLRCMakeCrossDKMSEclipseElectronFontFree PascalGNOMEGoHaskellJavaKDEKernelLispMesonMinGWNode.jsNonfreeOCamlPerlPHPPythonRRubyRustShellVCSWebWine

Until this document is written, contact User:Felixonmars.

Package naming

For Haskell libraries, use haskell-libraryname usually the same name as on hackage.

Note: The package name should be entirely lowercase.

Architecture

See PKGBUILD#arch.

Every Haskell library or program is architecture-dependent.

Source

The preferred source of a Haskell program or library is from hackage. PKGBUILD#source source=() array should use the following URL template:

https://hackage.haskell.org/packages/archive/$_hkgname/$pkgver/$_hkgname-$pkgver.tar.gz

Note that a custom _hkgname variable is used instead of pkgname since Haskell packages are generally prefixed with haskell-. This variable can generically be defined as follows:

_hkgname=stm-delay

Rebuild order

When a Haskell library changes its build flags or is updated, all dependent packages need to be rebuilt. The genrebuild tool can be used to find out what needs rebuilding and how. Example usage:

$ ./genrebuild -H haskell-basement

Using arch-hs

arch-hs is provided to automate PKGBUILD generation and maintenance.

To generate a series of PKGBUILDs for a Hackage package (and its unpackaged dependencies):

$ arch-hs -o /path/to/workdir library_name

To compare dependencies and other packaging metadata for updating an existing package:

$ arch-hs-diff library_name old_version new_version

To compare Arch [community] package versions and their corresponding Hackage package versions:

$ arch-hs-sync check

Note that arch-hs uses cabal-install to maintain Hackage databases, so please update your cabal-install database regularly to keep them fresh:

$ cabal update

PKGBUILD library example

Packaging a Haskell library is different from packaging a Haskell program, the libraries packaged in Arch Linux are meant to be used by packaged Haskell programs.

gollark: Yes. Keep up.
gollark: (things without them implicitly just have the bits interleaved)
gollark: If you access a fractional index, it mixes together the adjacent values using their Mix trait.
gollark: This is also how 2D arrays work.
gollark: And they are all mandatorily grouped in pairs to form complex numbers.
This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.