archlinux-0.2: Support for working with Arch Linux packages

MaintainerDon Stewart <>






data PkgBuild Source

A data type to represent PKGBUILD files




arch_pkgname :: String

The name of the package. This has be a unix-friendly name as it will be used in the package filename.

arch_pkgver :: Version

The version of the software as released from the authorii (e.g. 2.7.1).

arch_pkgrel :: !Int

This is the release number specific to the Arch Linux release. This allows package maintainers to make updates to the packages configure flags, for example. A pkgrel of 1 is typically used for each upstream software release and is incremented for intermediate PKGBUILD updates.

arch_pkgdesc :: String

This should be a brief description of the package and its functionality. Try to keep the description to one line of text.

arch_arch :: ArchList ArchArch

Defines on which architectures the given package is available (e.g. arch=(i686 x86_64)).

arch_url :: String

This field contains a URL that is associated with the software being packaged. This is typically the projects website.

arch_license :: ArchList License

This field specifies the license(s) that apply to the package. Commonly-used licenses are found in usrsharelicensescommon. If you see the packages license there, simply reference it in the license field (e.g. license=(GPL)). If the package provides a license not found in usrsharelicensescommon, then you should include the license in the package itself and set license=(custom) or license=(custom:LicenseName). The license should be placed in $pkgdirusrsharelicenses$pkgname when building the package. If multiple licenses are applicable for a package, list all of them: license=(GPL FDL).

arch_makedepends :: ArchList ArchDep

An array of packages that this package depends on to build, but are not needed at runtime. Packages in this list follow the same format as depends.

arch_depends :: ArchList ArchDep

An array of packages that this package depends on to run. Packages in this list should be surrounded with single quotes and contain at least the package name. Entries can also include a version requirement of the form nameversion, where is one of five comparisons: >= (greater than or equal to), <= (less than or equal to), = (equal to), > (greater than), or < (less than).

arch_source :: ArchList String

An array of source files required to build the package. Source files must either reside in the same directory as the PKGBUILD file, or be a fully-qualified URL that makepkg will use to download the file. In order to make the PKGBUILD as useful as possible, use the $pkgname and $pkgver variables if possible when specifying the download location. Any files that are compressed will automatically be extracted, unless found in the noextract array listed below.

arch_md5sum :: ArchList String

This array contains an MD5 hash for every source file specified in the source array (in the same order). makepkg will use this to verify source file integrity during subsequent builds. To easily generate md5sums, run makepkg -g >> PKGBUILD. If desired, move the md5sums line to an appropriate location. NOTE: makepkg supports multiple integrity algorithms and their corresponding arrays (i.e. sha1sums for the SHA1 algorithm); however, official packages use only md5sums for the time being.

arch_build :: [String]

The build hook

arch_install :: Maybe String

Specifies a special install script that is to be included in the package. This file should reside in the same directory as the PKGBUILD, and will be copied into the package by makepkg. It does not need to be included in the source array (e.g. install=pkgname.install).

arch_options :: ArchList ArchOptions

This array allows you to override some of makepkgs default behavior when building packages. To set an option, just include the option name in the options array. To reverse the default behavior, place an ! at the front of the option. Only specify the options you specifically want to override, the rest will be taken from makepkg.conf(5). NOTE: force is a special option only used in a PKGBUILD(5), do not use it unless you know what you are doing.


emptyPkgBuild :: PkgBuildSource


newtype ArchDep Source


ArchDep Dependency 

data ArchArch Source

Valid linux platforms



newtype ArchList a Source


ArchList [a] 


Functor ArchList 
Eq a => Eq (ArchList a) 
Show a => Show (ArchList a) 
Text a => Text (ArchList a) 
Monoid (ArchList a) 

dispNoQuotes :: Text a => ArchList a -> DocSource

Printing with no quotes

data AnnotatedPkgBuild Source

A PKGBUILD data structure with additional metadata



contents of pkgbuild file


pkgBuiltWith :: Maybe Version

version of cabal2arch used, if any

pkgHeader :: String

header strings

pkgBody :: PkgBuild

emptyPkg :: AnnotatedPkgBuildSource

Empty state structure

type ResultP a = Either String aSource

Result type for pkgbuild parsers

newtype GetPKG a Source

The type of pkgbuild parsers for String




un :: String -> Either String (a, String)

runGetPKG :: GetPKG a -> String -> ResultP aSource

Run a PKG reader on an input String, returning a PKGBUILD

(<$>) :: Functor f => (a -> b) -> f a -> f bSource

readPackage :: AnnotatedPkgBuild -> GetPKG AnnotatedPkgBuildSource

Recursively parse the pkgbuild

oldCabal2Arch :: AnnotatedPkgBuild -> BoolSource

Look for problems in the PKGBUILD