{{Article summary text|Writing [[PKGBUILD]]s for for software written in [[Wikipedia:Haskell|Haskell]].}}

{{Package Guidelines}}

{{Package Guidelines}}

−

{{Article summary end}}

−

Haskell is well supported on Arch Linux, with GHC and other key tools available via the [[Official Repositories|official repositories]], a growing number of packages made available by the ArchHaskell group, and a large part of [http://hackage.haskell.org hackage.haskell.org]'s library database [https://aur.archlinux.org/packages.php?O=0&K=haskell- available in the AUR].

+

[[Wikipedia:Haskell_(programming_language)|Haskell]] is well supported on Arch Linux.

+

GHC and a few core packages are available in the [[Official Repositories|official repositories]].

+

For more serious Haskellers, the [[ArchHaskell]] community project provides many packages from [http://hackage.haskell.org Hackage], and the number is growing.

−

The community around Haskell on Arch is active and well organized, but your help is always welcome.

+

See the [[ArchHaskell]] community page for contact details and ways to help.

−

== Community ==

+

== Haskell packages ==

+

To use Haskell on Arch Linux, you have two mutually exclusive options:

+

# Use packages from the official Arch Linux repositories. These are a well maintained small subset of all Haskell packages. Just install them the way you would install anything else on Arch Linux. Examples of what is available: in the [https://www.archlinux.org/packages/?arch=x86_64&repo=Extra&q=haskell&last_update=&limit=50 extra] and [https://www.archlinux.org/packages/?arch=x86_64&repo=Community&q=haskell&last_update=&limit=50 community] repositories. The packages here should satisfy people who just want to use the Haskell Platform. You may also combine this option with other packages from unofficial sources like the AUR.

+

# Use the ArchHaskell project's unofficial repositories. These contain a much larger subset of what's available on Hackage. As a community effort, we often need volunteers to help maintain and add more packages to these repositories. Read on for information about using them. A note for [[xmonad]] users: if you switch to this option, you need to install the '''haskell-xmonad''' package instead of {{Pkg|xmonad}} (which is in the official community repo and has different dependencies).

−

All the details on the [[ArchHaskell]] group is available on its own page.

+

=== [haskell-core] ===

+

The [haskell-core] repository is the base repository of packages maintained by the ArchHaskell team.

+

[haskell-core] can be accessed by adding the following entry to {{ic|/etc/pacman.conf}} (above [extra]):

The set of packages in the [haskell-core] repository is derived from the '''habs''' tree officially located [https://github.com/archhaskell/habs here]. A tool called [https://github.com/magthe/cblrepo cblrepo] is used to keep the '''habs''' tree synchronized with the official Haskell packages from [http://hackage.haskell.org/packages/hackage.html Hackage].

−

Our policy for [extra] is to provide the Haskell platform, and popular Haskell applications.

+

Putting [haskell-core] above [extra] will ensure that the packages from [haskell-core] take precedence, in case of duplicate packages in the two repositories.

−

==== [community] ====

+

The repositories provide both file listings (by using {{ic|repo-add --files}}), package deltas ({{ic|repo-add --delta}}), and both packages and the database are signed. The fingerprint of the key used for signing is:

−

* [https://www.archlinux.org/packages/?arch=x86_64&repo=Community&q=haskell&last_update=&limit=50 other popular Haskell packages]

+

pub 2048D/4209170B 2012-12-26

+

Key fingerprint = F310 4992 EBF2 4EB8 72B9 7B9C 32B0 B453 4209 170B

+

uid ArchHaskell (Magnus Therning) <magnus@therning.org>

+

sub 2048D/A418C0FE 2012-12-26

−

[community] provides additional packages that are popular and not part of the Haskell platform, such as [[xmonad]].

+

If you use {{ic|SigLevel &#61; Required TrustedOnly}} in {{ic|/etc/pacman.conf}} for [haskell-core], then you need to do the following to add Magnus Therning's key:

+

# sudo pacman-key -r 4209170B

+

# sudo pacman-key --lsign-key 4209170B

−

==== [haskell] ====

+

Force a refresh of all package lists:

+

# sudo pacman -Syy

−

The [haskell] repository is the official repository of packages maintained by the ArchHaskell team. This repository represents the last tier of stability, before resorting to the packages in the AUR, or perhaps building packages yourself with cabal2arch. [haskell] can be accessed by adding the following entry to {{ic|/etc/pacman.conf}}:

+

=== [haskell-happstack] ===

+

The [haskell-happstack] repository contains packages for web development based on the [http://happstack.com/ Happstack] framework. It requires [[Haskell_Package_Guidelines#.5Bhaskell-core.5D|[haskell-core]]], and includes most of the Happstack packages in [http://hackage.haskell.org/ HackageDB], plus [http://gitit.net/ Gitit] and [http://clckwrks.com/ clckwrks], all their dependencies not in [haskell-core] and some other not web related packages. To enable the repository, add the following entry to {{ic|/etc/pacman.conf}}:

−

[haskell]

+

[haskell-happstack]

−

Server = http://xsounds.org/~haskell/$arch

+

Server = ftp://noaxiom.org/$repo/$arch

−

The set of packages in the [haskell] repository is derived from the '''habs''' tree officially located [https://github.com/archhaskell/habs here]. A tool called [https://github.com/magthe/cblrepo cblrepo] is used to keep the '''habs''' tree synchronized with the official Haskell packages from [http://hackage.haskell.org/packages/hackage.html Hackage].

Anything not found here can be installed via {{pkg|cabal-install}} directly from Hackage.

+

* cabal-install directly

−

−

Unfortunately, many of the packages in the AUR are outdated due to a lack of resources. In practice, one uses the cabal2arch program to create PKGBUILDs directly from Hackage.

−

−

== Guidelines ==

−

−

In almost all cases, cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool. It is strongly recommended that you use the latest released version of this tool, as it implements the packaging policy for Haskell packages. You can get it in several ways:

−

−

* Add the [haskell] repository to {{ic|/etc/pacman.conf}} and use [[pacman]] to install the latest release.

−

* Download and build the {{AUR|cabal2arch}} package from the [[Arch User Repository|AUR]].

This example illustrates how to create a new package with cabal2arch. We will make a new package for the delimited continuations library, CC-delcont:

−

−

First, set the name and email address to be used in the generated [[PKGBUILD]]:

−

−

export ARCH_HASKELL='My Name <my.name@domain.org>'

−

−

Second, find [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/CC-delcont the hackage page for CC-delcont], then identify the link to the .cabal file. Use this link as an argument to cabal2arch:

Unfortunately, many of the packages in the AUR are outdated due to a lack of resources.

−

* All libraries that the package depend on are listed (libraries shipped with GHC are dealt with by having the {{pkg|ghc}} package provide them)

+

If you have the time, it is recommended to use cblrepo and create something like [haskell-web], which can then be added to the collection of haskell-providing repositories.

−

* It uses cabal to generate a post-install register/unregister script, with a standard name.

−

* We use haddock to build the documentation.

−

All Haskell libraries should follow these naming conventions, and using the latest release of cabal2arch will ensure this is the case.

+

=== Tips ===

−

{{Note|Beginning with {{AUR|cabal2arch}} 1.1-2, a new environment variable, {{ic|PKGBUILD_HASKELL_ENABLE_PROFILING}}, is generated into the PKGBUILD. If this variable is of non-zero length, such as "1" or "true", then profiling builds will occur. Thus, if a user desires profiling, then it is advised to export this environment variable in a file such as {{ic|~/.bashrc}} or {{ic|~/.zshrc}}.}}

+

==== Haskell-Platform ====

+

The haskell platform is a stabalised package set, and is in writing moment not available in the repos.

+

A close equal would be to install GHC, cabal-install, haddock, happy and alex. So with [haskell-core] you would do "pacman -S ghc cabal-install haskell-haddock happy alex"

−

===Guidelines for Libraries===

+

Note: for official repos only, install "haddock" instead of "haskell-haddock"

−

In general, each .cabal file should map to one PKGBUILD. The following conventions hold:

+

== Improving ArchHaskell ==

−

* libraries have their cabal names prefixed with {{ic|haskell-}}

+

=== Community ===

−

* all libraries have a dependency on {{pkg|ghc}}

+

See the [[ArchHaskell]] community page and get in touch via the mailing list or the IRC channel.

−

* all libraries that are depended on must be listed in the {{ic|depends}} array in the [[PKGBUILD]]

−

* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the {{pkg|gtk2hs}} package, not , e.g. "haskell-cairo"

−

Registering Haskell libraries is done via a register hook, see above.

+

=== Overview ===

+

The plan is to have one user-facing repository, [haskell], which merges the packages available in various satellite repositories (like [haskell-web]), thereby distributing the maintenance load.

+

One satellite repo is special, the [haskell-core] repository, which provides packages that are dependencies of all the other satellites.

−

===Guidelines for Programs ===

+

=== [haskell-core] maintenance ===

+

Ensure:

+

* [haskell-core] is an Arch repo hosted at kiwilight and xsounds.

+

* [haskell-core] is in sync with the [https://github.com/archhaskell/habs habs] cblrepo database.

−

* Have their normal name. Examples: hmp3, xmonad, ghc, cabal-install

+

=== Other repo maintenance ===

+

For example, for haskell-foo, ensure:

+

* haskell-foo is a cblrepo database, possibly using packages from [haskell-core] as DistroPkgs.

+

* Whenever [haskell-core] is updated, haskell-foo's database is updated to match within a reasonable time.

−

* Be careful about dynamically linked run-time dependencies on C. For example, all GHC-produced binaries have a run-time dependency on 'gmp'. OpenGL or GtT-based binaries will have additional 'depends'. cabal2arch will attempt to work out the C dependencies, but there may be others implied by Haskell dependencies that are missed.

+

=== Creating another repo ===

−

* Use executable stripping, {{ic|--enable-executable-stripping}}. cabal2arch will do this automatically.

+

=== List of satellite repos ===

Revision as of 18:11, 18 December 2013

Haskell is well supported on Arch Linux.
GHC and a few core packages are available in the official repositories.
For more serious Haskellers, the ArchHaskell community project provides many packages from Hackage, and the number is growing.

See the ArchHaskell community page for contact details and ways to help.

Haskell packages

To use Haskell on Arch Linux, you have two mutually exclusive options:

Use packages from the official Arch Linux repositories. These are a well maintained small subset of all Haskell packages. Just install them the way you would install anything else on Arch Linux. Examples of what is available: in the extra and community repositories. The packages here should satisfy people who just want to use the Haskell Platform. You may also combine this option with other packages from unofficial sources like the AUR.

Use the ArchHaskell project's unofficial repositories. These contain a much larger subset of what's available on Hackage. As a community effort, we often need volunteers to help maintain and add more packages to these repositories. Read on for information about using them. A note for xmonad users: if you switch to this option, you need to install the haskell-xmonad package instead of xmonad (which is in the official community repo and has different dependencies).

[haskell-core]

The [haskell-core] repository is the base repository of packages maintained by the ArchHaskell team.
[haskell-core] can be accessed by adding the following entry to /etc/pacman.conf (above [extra]):

The set of packages in the [haskell-core] repository is derived from the habs tree officially located here. A tool called cblrepo is used to keep the habs tree synchronized with the official Haskell packages from Hackage.

Putting [haskell-core] above [extra] will ensure that the packages from [haskell-core] take precedence, in case of duplicate packages in the two repositories.

The repositories provide both file listings (by using repo-add --files), package deltas (repo-add --delta), and both packages and the database are signed. The fingerprint of the key used for signing is:

If you use SigLevel = Required TrustedOnly in /etc/pacman.conf for [haskell-core], then you need to do the following to add Magnus Therning's key:

# sudo pacman-key -r 4209170B
# sudo pacman-key --lsign-key 4209170B

Force a refresh of all package lists:

# sudo pacman -Syy

[haskell-happstack]

The [haskell-happstack] repository contains packages for web development based on the Happstack framework. It requires [haskell-core], and includes most of the Happstack packages in HackageDB, plus Gitit and clckwrks, all their dependencies not in [haskell-core] and some other not web related packages. To enable the repository, add the following entry to /etc/pacman.conf:

[haskell-web]

The [haskell-web] repository is not maintained anymore. If you wish to help, please send a mail to the list or use the IRC channel.
The repository was built on [haskell-core], providing several more packages, especially those useful for web applications.

Last resorts

Unfortunately, many of the packages in the AUR are outdated due to a lack of resources.
If you have the time, it is recommended to use cblrepo and create something like [haskell-web], which can then be added to the collection of haskell-providing repositories.

Tips

Haskell-Platform

The haskell platform is a stabalised package set, and is in writing moment not available in the repos.
A close equal would be to install GHC, cabal-install, haddock, happy and alex. So with [haskell-core] you would do "pacman -S ghc cabal-install haskell-haddock happy alex"

Note: for official repos only, install "haddock" instead of "haskell-haddock"

Improving ArchHaskell

Community

See the ArchHaskell community page and get in touch via the mailing list or the IRC channel.

Overview

The plan is to have one user-facing repository, [haskell], which merges the packages available in various satellite repositories (like [haskell-web]), thereby distributing the maintenance load.
One satellite repo is special, the [haskell-core] repository, which provides packages that are dependencies of all the other satellites.