https://wiki.archlinux.org/api.php?action=feedcontributions&user=Dons&feedformat=atomArchWiki - User contributions [en]2024-03-28T11:55:24ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=114178Haskell package guidelines2010-08-15T21:37:54Z<p>Dons: </p>
<hr />
<div>[[Category:Guidelines (English)]][[Category:Package development (English)]]<br />
'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and 87% percent of [http://hackage.haskell.org hackage.haskell.org] library database [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go available via AUR]. <br />
<br />
'''[http://code.haskell.org/arch/arch-haskell-status.html The status of all Haskell packages in Arch Linux]'''<br />
<br />
The community around Haskell on Arch is also active and well organized.<br />
<br />
== Community ==<br />
<br />
The main resources for the Arch/Haskell community to interact and discuss are:<br />
<br />
* [http://www.gogloom.com/FreeNode/arch-haskell <nowiki>#arch-haskell</nowiki>] irc channel @ freenode.org<br />
** Good for quick discussion and planning<br />
* [http://haskell.org/mailman/listinfo/arch-haskell arch-haskell@haskell.org] mailing list<br />
** Broader announcements, and automated updates<br />
* [http://archhaskell.wordpress.com/ Arch Haskell Weekly News]<br />
** A blog announcing our progress to the outside world.<br />
<br />
== Haskell Packages ==<br />
<br />
The core Haskell tools are available in the core system (extra):<br />
<br />
==== <nowiki>[Extra]</nowiki> ====<br />
* [http://www.archlinux.org/packages/?arch=x86_64&repo=Extra&q=haskell&last_update=&limit=50 Haskell packages in the core system]<br />
<br />
Our [http://haskell.org/haskellwiki/Arch_Linux/Policy policy] is for [extra] to provide the Haskell platform, and popular Haskell applications.<br />
<br />
==== <nowiki>AUR</nowiki> ====<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go Haskell packages in AUR]<br />
<br />
A huge number (almost 2000) packages built from http://hackage.haskell.org<br />
<br />
These generally improve on installing directly from Hackage as they resolve required C libraries. They can be installed as, for example:<br />
<br />
sudo paktahn -S haskell-csv<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
== Direction and strategy ==<br />
<br />
The strategy for Haskell on Arch Linux is to support the Haskell platform suite in [extra], and to track Hackage via AUR. This has been adopted as an [http://haskell.org/haskellwiki/Arch_Linux/Policy official policy document].<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool.<br />
<br />
* [http://aur.archlinux.org/packages.php?ID=17471 Get the latest cabal2arch]<br />
<br />
It is strongly recommended that you use this tool, as it implements the packaging policy for Haskell packages.<br />
These packages are primarily managed by Don Stewart. <br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
Most things on http://hackage.haskell.org that are packageable, are already in AUR.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
The .tar.gz is a zipped PKGBUILD ready to upload to AUR.<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Arch Haskell Team <arch-haskell@haskell.org><br />
# Package generated by cabal2arch 0.6.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://hackage.haskell.org/package/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=()<br />
depends=('ghc' 'haskell-cabal')<br />
options=('strip')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd ${srcdir}/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr --docdir=/usr/share/doc/${pkgname} || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup haddock || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh<br />
install -d -m755 $pkgdir/usr/share/doc/ghc/libraries<br />
ln -s /usr/share/doc/${pkgname}/html ${pkgdir}/usr/share/doc/ghc/libraries/CC-delcont<br />
runhaskell Setup copy --destdir=${pkgdir} || return 1<br />
install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1<br />
rm -f ${pkgdir}/usr/share/doc/${pkgname}/LICENSE<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* Maintainer is by default the Arch Haskell team.<br />
* Libraries are prefixed with "haskell-"<br />
* "core" and "extra" Haskell libraries are not included as explicit dependencies, since ghc provides them<br />
* It uses cabal to generate a post-install register/unregister script, with a standard name.<br />
* We use haddock to build the documentation.<br />
* Profiling versions of the library aren't currently installed (''TODO'')<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
=== "Provides" ===<br />
<br />
[http://haskell.org/haskellwiki/Arch_Linux/Preferred_Package_Tools See the discussion on the use of "provides" here].<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
'''This section is out of date'''<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Guidelines for Libraries===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set. cabal2arch solves all these constraints for us.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd ${srcdir}/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=${pkgdir} || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Guidelines for Programs ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
* http://www.galois.com/~dons/arch-haskell-status.html<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= > 550 Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=114117Haskell package guidelines2010-08-14T21:31:09Z<p>Dons: Updates</p>
<hr />
<div>[[Category:Guidelines (English)]][[Category:Package development (English)]]<br />
'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and 87% percent of [http://hackage.haskell.org hackage.haskell.org] library database [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go available via AUR]. <br />
<br />
'''[http://www.galois.com/~dons/arch-haskell-status.html The status of all Haskell packages in Arch Linux]'''<br />
<br />
The community around Haskell on Arch is also active and well organized.<br />
<br />
== Community ==<br />
<br />
The main resources for the Arch/Haskell community to interact and discuss are:<br />
<br />
* [http://www.gogloom.com/FreeNode/arch-haskell <nowiki>#arch-haskell</nowiki>] irc channel @ freenode.org<br />
** Good for quick discussion and planning<br />
* [http://haskell.org/mailman/listinfo/arch-haskell arch-haskell@haskell.org] mailing list<br />
** Broader announcements, and automated updates<br />
* [http://archhaskell.wordpress.com/ Arch Haskell Weekly News]<br />
** A blog announcing our progress to the outside world.<br />
<br />
== Haskell Packages ==<br />
<br />
The core Haskell tools are available in the core system (extra):<br />
<br />
==== <nowiki>[Extra]</nowiki> ====<br />
* [http://www.archlinux.org/packages/?arch=x86_64&repo=Extra&q=haskell&last_update=&limit=50 Haskell packages in the core system]<br />
<br />
Our [http://haskell.org/haskellwiki/Arch_Linux/Policy policy] is for [extra] to provide the Haskell platform, and popular Haskell applications.<br />
<br />
==== <nowiki>AUR</nowiki> ====<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go Haskell packages in AUR]<br />
<br />
A huge number (almost 2000) packages built from http://hackage.haskell.org<br />
<br />
These generally improve on installing directly from Hackage as they resolve required C libraries. They can be installed as, for example:<br />
<br />
sudo paktahn -S haskell-csv<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
== Direction and strategy ==<br />
<br />
The strategy for Haskell on Arch Linux is to support the Haskell platform suite in [extra], and to track Hackage via AUR. This has been adopted as an [http://haskell.org/haskellwiki/Arch_Linux/Policy official policy document].<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool.<br />
<br />
* [http://aur.archlinux.org/packages.php?ID=17471 Get the latest cabal2arch]<br />
<br />
It is strongly recommended that you use this tool, as it implements the packaging policy for Haskell packages.<br />
These packages are primarily managed by Don Stewart. <br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
Most things on http://hackage.haskell.org that are packageable, are already in AUR.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
The .tar.gz is a zipped PKGBUILD ready to upload to AUR.<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Arch Haskell Team <arch-haskell@haskell.org><br />
# Package generated by cabal2arch 0.6.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://hackage.haskell.org/package/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=()<br />
depends=('ghc' 'haskell-cabal')<br />
options=('strip')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd ${srcdir}/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr --docdir=/usr/share/doc/${pkgname} || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup haddock || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh<br />
install -d -m755 $pkgdir/usr/share/doc/ghc/libraries<br />
ln -s /usr/share/doc/${pkgname}/html ${pkgdir}/usr/share/doc/ghc/libraries/CC-delcont<br />
runhaskell Setup copy --destdir=${pkgdir} || return 1<br />
install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1<br />
rm -f ${pkgdir}/usr/share/doc/${pkgname}/LICENSE<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* Maintainer is by default the Arch Haskell team.<br />
* Libraries are prefixed with "haskell-"<br />
* "core" and "extra" Haskell libraries are not included as explicit dependencies, since ghc provides them<br />
* It uses cabal to generate a post-install register/unregister script, with a standard name.<br />
* We use haddock to build the documentation.<br />
* Profiling versions of the library aren't currently installed (''TODO'')<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
=== "Provides" ===<br />
<br />
[http://haskell.org/haskellwiki/Arch_Linux/Preferred_Package_Tools See the discussion on the use of "provides" here].<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
'''This section is out of date'''<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Guidelines for Libraries===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set. cabal2arch solves all these constraints for us.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd ${srcdir}/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=${pkgdir} || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Guidelines for Programs ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
* http://www.galois.com/~dons/arch-haskell-status.html<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= > 550 Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=93548Haskell package guidelines2010-01-25T07:22:30Z<p>Dons: </p>
<hr />
<div>[[Category:Guidelines (English)]][[Category:Package development (English)]]<br />
'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and 87% percent of [http://hackage.haskell.org hackage.haskell.org] library database [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go available via AUR]. <br />
<br />
'''[http://www.galois.com/~dons/arch-haskell-status.html The status of all Haskell packages in Arch Linux]'''<br />
<br />
The community around Haskell on Arch is also active and well organized.<br />
<br />
== Community ==<br />
<br />
The main resources for the Arch/Haskell community to interact and discuss are:<br />
<br />
* [http://www.gogloom.com/FreeNode/arch-haskell <nowiki>#arch-haskell</nowiki>] irc channel @ freenode.org<br />
** Good for quick discussion and planning<br />
* [http://haskell.org/mailman/listinfo/arch-haskell arch-haskell@haskell.org] mailing list<br />
** Broader announcements, and automated updates<br />
* [http://archhaskell.wordpress.com/ Arch Haskell Weekly News]<br />
** A blog announcing our progress to the outside world.<br />
<br />
== Haskell Packages ==<br />
<br />
The core Haskell tools are available in the core system (extra):<br />
<br />
==== <nowiki>[Extra]</nowiki> ====<br />
* [http://www.archlinux.org/packages/?arch=x86_64&repo=Extra&q=haskell&last_update=&limit=50 Haskell packages in the core system]<br />
<br />
Our [http://haskell.org/haskellwiki/Arch_Linux/Policy policy] is for [extra] to provide the Haskell platform, and popular Haskell applications.<br />
<br />
==== <nowiki>[Community]</nowiki> ====<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=3&C=0&K=haskell&SB=v&SO=d&PP=25&SeB=nd&do_Orphans= Haskell packages in community]<br />
<br />
The start of the Haskell platform, a set of core libraries for building more things.<br />
<br />
==== <nowiki>AUR</nowiki> ====<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go Haskell packages in AUR]<br />
<br />
A huge number (almost 2000) packages built from http://hackage.haskell.org<br />
<br />
These generally improve on installing directly from Hackage as they resolve required C libraries. They can be installed as, for example:<br />
<br />
yaourt --aur -S --noconfirm cabal2arch<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
== Direction and strategy ==<br />
<br />
The strategy for Haskell on Arch Linux is to support the Haskell platform suite in [extra]. This has been adopted as an [http://haskell.org/haskellwiki/Arch_Linux/Policy official policy document].<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool.<br />
<br />
* [http://aur.archlinux.org/packages.php?ID=17471 Get the latest cabal2arch]<br />
<br />
These packages are primarily managed by Don Stewart. <br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
Most things on http://hackage.haskell.org that are packageable, are already in AUR.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
The .tar.gz is a zipped PKGBUILD ready to upload to AUR.<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Arch Haskell Team <arch-haskell@haskell.org><br />
# Package generated by cabal2arch 0.6.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://hackage.haskell.org/package/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=()<br />
depends=('ghc' 'haskell-cabal')<br />
options=('strip')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd ${srcdir}/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr --docdir=/usr/share/doc/${pkgname} || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup haddock || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh<br />
install -d -m755 $pkgdir/usr/share/doc/ghc/libraries<br />
ln -s /usr/share/doc/${pkgname}/html ${pkgdir}/usr/share/doc/ghc/libraries/CC-delcont<br />
runhaskell Setup copy --destdir=${pkgdir} || return 1<br />
install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1<br />
rm -f ${pkgdir}/usr/share/doc/${pkgname}/LICENSE<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* Maintainer is by default the Arch Haskell team.<br />
* Libraries are prefixed with "haskell-"<br />
* "core" and "extra" Haskell libraries are not included as explicit dependencies, since ghc provides them<br />
* It uses cabal to generate a post-install register/unregister script, with a standard name.<br />
* We use haddock to build the documentation.<br />
* Profiling versions of the library aren't currently installed (''TODO'')<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
=== "Provides" ===<br />
<br />
[http://haskell.org/haskellwiki/Arch_Linux/Preferred_Package_Tools See the discussion on the use of "provides" here].<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
'''This section is out of date'''<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Guidelines for Libraries===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set. cabal2arch solves all these constraints for us.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd ${srcdir}/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=${pkgdir} || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Guidelines for Programs ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
* http://www.galois.com/~dons/arch-haskell-status.html<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= > 550 Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=74394Haskell package guidelines2009-08-22T18:20:27Z<p>Dons: </p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and 87% percent of [http://hackage.haskell.org hackage.haskell.org] library database [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go available via AUR]. <br />
<br />
'''[http://www.galois.com/~dons/arch-haskell-status.html The status of all Haskell packages in Arch Linux]'''<br />
<br />
The community around Haskell on Arch is also active and well organized.<br />
<br />
== Community ==<br />
<br />
The main resources for the Arch/Haskell community to interact and discuss are:<br />
<br />
* [http://www.gogloom.com/FreeNode/arch-haskell <nowiki>#arch-haskell</nowiki>] irc channel @ freenode.org<br />
** Good for quick discussion and planning<br />
* [http://haskell.org/mailman/listinfo/arch-haskell arch-haskell@haskell.org] mailing list<br />
** Broader announcements, and automated updates<br />
* [http://archhaskell.wordpress.com/ Arch Haskell Weekly News]<br />
** A blog announcing our progress to the outside world.<br />
<br />
== Haskell Packages ==<br />
<br />
The core Haskell tools are available in the core system (extra):<br />
<br />
==== <nowiki>[Extra]</nowiki> ====<br />
* [http://www.archlinux.org/packages/?arch=x86_64&repo=Extra&q=haskell&last_update=&limit=50 Haskell packages in the core system]<br />
<br />
Currently just the compilers<br />
<br />
==== <nowiki>[Community]</nowiki> ====<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=3&C=0&K=haskell&SB=v&SO=d&PP=25&SeB=nd&do_Orphans= Haskell packages in community]<br />
<br />
The start of the Haskell platform, a set of core libraries for building more things.<br />
<br />
==== <nowiki>AUR</nowiki> ====<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go Haskell packages in AUR]<br />
<br />
A huge number (almost 1000) packages built from http://hackage.haskell.org<br />
<br />
These generally improve on installing directly from Hackage as they resolve required C libraries. They can be installed as, for example:<br />
<br />
yaourt --aur -S --noconfirm cabal2arch<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
== Direction and strategy ==<br />
<br />
The strategy for Haskell on Arch Linux is to support the Haskell platform suite in [community].<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment of of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to migrate the [http://www.haskell.org/haskellwiki/Haskell_Platform Haskell Platform] into community.<br />
<br />
Other key libraries can be determined based on use and votes.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool.<br />
<br />
* [http://aur.archlinux.org/packages.php?ID=17471 Get the latest cabal2arch]<br />
<br />
We strongly recommend its use, as it creates very good packages, that are consistent with the other 1000 AUR Haskell packages. <br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
Most things on http://hackage.haskell.org that are packageable, are already in AUR.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
The .tar.gz is a zipped PKGBUILD ready to upload to AUR.<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Arch Haskell Team <arch-haskell@haskell.org><br />
# Package generated by cabal2arch 0.6.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://hackage.haskell.org/package/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=()<br />
depends=('ghc' 'haskell-cabal')<br />
options=('strip')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd ${srcdir}/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr --docdir=/usr/share/doc/${pkgname} || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup haddock || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh<br />
install -d -m755 $pkgdir/usr/share/doc/ghc/libraries<br />
ln -s /usr/share/doc/${pkgname}/html ${pkgdir}/usr/share/doc/ghc/libraries/CC-delcont<br />
runhaskell Setup copy --destdir=${pkgdir} || return 1<br />
install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1<br />
rm -f ${pkgdir}/usr/share/doc/${pkgname}/LICENSE<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* Maintainer is by default the Arch Haskell team.<br />
* Libraries are prefixed with "haskell-"<br />
* "core" and "extra" Haskell libraries are not included as explicit dependencies, since ghc provides them<br />
* It uses cabal to generate a post-install register/unregister script, with a standard name.<br />
* We use haddock to build the documentation.<br />
* Profiling versions of the library aren't currently installed (''TODO'')<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
'''This section is out of date'''<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Guidelines for Libraries===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set. cabal2arch solves all these constraints for us.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd ${srcdir}/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=${pkgdir} || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Guidelines for Programs ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
* http://www.galois.com/~dons/arch-haskell-status.html<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= > 550 Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=AUR_helpers&diff=73935AUR helpers2009-08-14T23:06:54Z<p>Dons: /* autoaur */</p>
<hr />
<div>[[Category:Utilities (English)]]<br />
[[Category:AUR]]<br />
<br />
<!--<br />
<br />
Please use this template when adding entries to the AUR Helpers page:<br />
<br />
=== AUR Helper foo ===<br />
<br />
Description bar<br />
<br />
*Homepage: <br />
*AUR Package Details:<br />
*Screenshots: <br />
<br />
--><br />
<br />
''' Overview '''<br />
----<br />
<br />
This is a list of AUR helper command line tools that search and/or build packages from the Arch User Repository. None of these tools are officially supported.<br />
<br />
A list of GUI pacman frontends, some of which also work with the AUR, may be found on the [http://wiki.archlinux.org/index.php/Pacman_GUI_Frontends Pacman GUI Frontends wikipage].<br />
<br />
=== arson ===<br />
<br />
Arson is an AUR searcher and downloader, written in Ruby. It allows you to search the AUR for a package you want, and download it. It does NOT automatically install the downloaded package. It can extract it, but not install. Searching for a package also searches through pacman's db cache (rather than going to each mirror and querying those).<br />
<br />
*Homepage: http://evaryont.github.com/arson/<br />
*AUR Package Details: http://aur.archlinux.org/packages.php?ID=16021<br />
*Screenshots: <br />
<br />
=== aurbuild ===<br />
<br />
AURBuild is a tool written in Python to download and build packages from the AUR.<br />
<br />
*Homepage: http://aurbuild.berlios.de/<br />
*AUR Package Details: http://aur.archlinux.org/packages.php?ID=1775<br />
*Screenshots: <br />
<br />
=== AurGet ===<br />
<br />
AurGet is a bash script aimed at quickly searching and installing from aur. visually designed to mimic pacman-color, aurget accepts -u to check for and install updates to your installed aur packages, -s to search the aur, -d and -b to download the tarball or build the package respectively, and finally run option-less to install the passed targets.<br />
<br />
*Homepage: http://pbrisbin.com:8080/bin/aurget<br />
*AUR Package Details:<br />
*Screenshots: http://pbrisbin.com:8080/screenshots/aurget_0906130038.png<br />
<br />
=== aurploader ===<br />
<br />
Aurploader prompts the user for an AUR name and password and will then upload passed AUR tarballs to the AUR. Before uploading each package, the user is prompted to select a category. When the uploads have completed, the user is asked if the cookie file should be kept so that the script can be run again without needing the AUR name and password to be re-entered.<br />
<br />
*Homepage: http://xyne.archlinux.ca/info/aurploader<br />
*AUR Package Details: http://aur.archlinux.org/packages.php?ID=23393<br />
*Screenshots: <br />
<br />
=== aurshell ===<br />
<br />
Aurshell is a shell written in Python. With plugins included, it's possible to use AUR, ABS and even wrap pacman.<br />
<br />
*Homepage: http://husio.homelinux.com/static/aurshell/<br />
*AUR Package Details: http://aur.archlinux.org/packages.php?ID=16656<br />
*Screenshots: http://xs128.xs.to/xs128/08231/2008-06-02_13-46-33_screenshot_scrot754.png<br />
<br />
=== autoaur ===<br />
<br />
Autoaur is a script for automatic mass downloading, updating, building, and installing groups of AUR packages.<br />
<br />
*Homepage: http://wiki.archlinux.org/index.php/AUTOAUR<br />
*AUR Package Details: http://aur.archlinux.org/packages.php?ID=6390<br />
*Screenshots:<br />
<br />
=== haskell-archlinux ===<br />
<br />
haskell-archlinux is a library to programmatically access AUR and package metadata from the Haskell programming language.<br />
<br />
*http://hackage.haskell.org/package/archlinux<br />
*AUR Package Details: http://aur.archlinux.org/packages.php?ID=29267<br />
<br />
=== makeaur ===<br />
<br />
Makeaur is is a wrapper for pacman and makepkg that allows users to easily install packages from the Arch User Repository.<br />
<br />
*Homepage:<br />
*AUR Package Details: http://aur.archlinux.org/packages.php?ID=23678<br />
*Screenshots: <br />
<br />
=== makerepo ===<br />
<br />
Makerepo is a tool to simplify building and maintaining a repository. A simple configuration file is use to specify the basic arguments such as database name and directory, package lists, etc. Makerepo is able to build packages from the AUR and from local PKG‐BUILDS such as the ABS tree. It can even build pkgs from CPAN modules if pacpan is installed.<br />
<br />
*Homepage: http://xyne.archlinux.ca/info/makerepo<br />
*AUR Package Details: http://aur.archlinux.org/packages.php?ID=23500<br />
*Screenshots: <br />
<br />
=== pbget ===<br />
<br />
Pbget is a simple command-line tool for retrieving PKGBUILDs and local source files for Arch Linux. It is able to retrieve files from the official SVN and CVS web interface, the AUR and the ABS rsync server.<br />
<br />
*Homepage: http://xyne.archlinux.ca/info/pbget<br />
*AUR Package Details: http://aur.archlinux.org/packages.php?ID=23848<br />
*Screenshots: <br />
<br />
=== qpkg ===<br />
<br />
Qpkg is a tool written in python for searching in all known repositories and on AUR. It can install and automatically update packages from AUR and it also can install all needed dependencies of a package from AUR.<br />
<br />
*Homepage: http://qpkg.berlios.de/<br />
*AUR Package Details:<br />
*Screenshots:<br />
<br />
=== yaourt === <br />
<br />
Yet Another User Repository Tool. Yaourt is a community-contributed wrapper for pacman which adds seamless access to the AUR, allowing and automating package compilation and installation from your choice of the 11,000+ PKGBUILDs in the AUR, in addition to the many thousands of available Arch binary packages. Yaourt uses the same exact syntax as pacman, which saves you from relearning an entirely new method of system maintenance, but also adds new options. Yaourt expands the power and simplicity of pacman by adding even more useful features and provides pleasing, colorized output, interactive search mode, and much more.<br />
<br />
*Homepage: http://wiki.archlinux.org/index.php/Yaourt<br />
*AUR Package Details: http://aur.archlinux.org/packages.php?ID=5863<br />
*Screenshots: http://archlinux.fr/yaourt-en#Utilisation<br />
<br />
=== yogurt ===<br />
<br />
Yogurt is an ArchLinux related tool useful in building packages for unsupported software which is only provided by the PKGBUILD in the Archlinux User Repository. Yogurt features a rudimental dependency support both for standard repositories and AUR.<br />
<br />
*Homepage: http://wikilinux.altervista.org/dokuwiki/doku.php?id=scriptseprogrammi:yogurt<br />
*AUR Package Details:<br />
*Screenshots: http://wikilinux.altervista.org/dokuwiki/lib/exe/fetch.php?cache=cache&media=scriptseprogrammi%3Ashot_yogurt.jpg</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=62194Haskell package guidelines2009-02-16T17:37:39Z<p>Dons: /* Guidelines */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and 86% percent of [http://hackage.haskell.org hackage.haskell.org] library database [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go available via AUR]. <br />
<br />
The community around Haskell on Arch is also active and well organized.<br />
<br />
== Community ==<br />
<br />
The main resources for the Arch/Haskell community to interact and discuss are:<br />
<br />
* [http://www.gogloom.com/FreeNode/arch-haskell <nowiki>#arch-haskell</nowiki>] irc channel @ freenode.org<br />
** Good for quick discussion and planning<br />
* [http://haskell.org/mailman/listinfo/arch-haskell arch-haskell@haskell.org] mailing list<br />
** Broader announcements, and automated updates<br />
* [http://archhaskell.wordpress.com/ Arch Haskell Weekly News]<br />
** A blog announcing our progress to the outside world.<br />
* [http://code.haskell.org/arch/x86_64/haskell.xml RSS feed] of new packages as they're uploaded<br />
<br />
== Haskell Packages ==<br />
<br />
The core Haskell tools are available in the core system (extra):<br />
<br />
==== <nowiki>[Extra]</nowiki> ====<br />
* [http://www.archlinux.org/packages/?arch=x86_64&repo=Extra&q=haskell&last_update=&limit=50 Haskell packages in the core system]<br />
<br />
Currently just the compilers<br />
<br />
==== <nowiki>[Community]</nowiki> ====<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=3&C=0&K=haskell&SB=v&SO=d&PP=25&SeB=nd&do_Orphans= Haskell packages in community]<br />
<br />
The start of the Haskell platform, a set of core libraries for building more things.<br />
<br />
==== <nowiki>AUR</nowiki> ====<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go Haskell packages in AUR]<br />
<br />
A huge number (almost 1000) packages built from http://hackage.haskell.org<br />
<br />
These generally improve on installing directly from Hackage as they resolve required C libraries. They can be installed as, for example:<br />
<br />
yaourt --aur -S --noconfirm cabal2arch<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
== Direction and strategy ==<br />
<br />
The strategy for Haskell on Arch Linux is to support the Haskell platform suite in [community].<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment of of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to migrate the [http://www.haskell.org/haskellwiki/Haskell_Platform Haskell Platform] into community.<br />
<br />
Other key libraries can be determined based on use and votes.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool.<br />
<br />
* [http://aur.archlinux.org/packages.php?ID=17471 Get the latest cabal2arch]<br />
<br />
We strongly recommend its use, as it creates very good packages, that are consistent with the other 1000 AUR Haskell packages. <br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
Most things on http://hackage.haskell.org that are packageable, are already in AUR.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
The .tar.gz is a zipped PKGBUILD ready to upload to AUR.<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
<br />
# Contributor: Arch Haskell Team <arch-haskell@haskell.org><br />
# Package generated by cabal2arch 0.3.6<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
depends=()<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd ${srcdir}/CC-delcont-0.2<br />
runhaskell Setup configure --enable-executable-stripping --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=${pkgdir} || return 1<br />
install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* Maintainer is by default the Arch Haskell team.<br />
* Libraries are prefixed with "haskell-"<br />
* "core" and "extra" Haskell libraries are not included as explicit dependencies, since ghc provides them<br />
* since Haskell libraries are statically linked, the package only has makedepends requirements, and no runtime requirements.<br />
* It uses cabal to generate a post-install register/unregister script, with a standard name.<br />
* Executable stripping is employed (to reduce binary size for executables).<br />
* Profiling versions of the library aren't currently installed (''TODO'')<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
'''This section is out of date'''<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Guidelines for Libraries===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set. cabal2arch solves all these constraints for us.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd ${srcdir}/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=${pkgdir} || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Guidelines for Programs ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= > 550 Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=62193Haskell package guidelines2009-02-16T17:35:08Z<p>Dons: /* Short term improvements */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and 86% percent of [http://hackage.haskell.org hackage.haskell.org] library database [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go available via AUR]. <br />
<br />
The community around Haskell on Arch is also active and well organized.<br />
<br />
== Community ==<br />
<br />
The main resources for the Arch/Haskell community to interact and discuss are:<br />
<br />
* [http://www.gogloom.com/FreeNode/arch-haskell <nowiki>#arch-haskell</nowiki>] irc channel @ freenode.org<br />
** Good for quick discussion and planning<br />
* [http://haskell.org/mailman/listinfo/arch-haskell arch-haskell@haskell.org] mailing list<br />
** Broader announcements, and automated updates<br />
* [http://archhaskell.wordpress.com/ Arch Haskell Weekly News]<br />
** A blog announcing our progress to the outside world.<br />
* [http://code.haskell.org/arch/x86_64/haskell.xml RSS feed] of new packages as they're uploaded<br />
<br />
== Haskell Packages ==<br />
<br />
The core Haskell tools are available in the core system (extra):<br />
<br />
==== <nowiki>[Extra]</nowiki> ====<br />
* [http://www.archlinux.org/packages/?arch=x86_64&repo=Extra&q=haskell&last_update=&limit=50 Haskell packages in the core system]<br />
<br />
Currently just the compilers<br />
<br />
==== <nowiki>[Community]</nowiki> ====<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=3&C=0&K=haskell&SB=v&SO=d&PP=25&SeB=nd&do_Orphans= Haskell packages in community]<br />
<br />
The start of the Haskell platform, a set of core libraries for building more things.<br />
<br />
==== <nowiki>AUR</nowiki> ====<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go Haskell packages in AUR]<br />
<br />
A huge number (almost 1000) packages built from http://hackage.haskell.org<br />
<br />
These generally improve on installing directly from Hackage as they resolve required C libraries. They can be installed as, for example:<br />
<br />
yaourt --aur -S --noconfirm cabal2arch<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
== Direction and strategy ==<br />
<br />
The strategy for Haskell on Arch Linux is to support the Haskell platform suite in [community].<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment of of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to migrate the [http://www.haskell.org/haskellwiki/Haskell_Platform Haskell Platform] into community.<br />
<br />
Other key libraries can be determined based on use and votes.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool.<br />
<br />
* [http://aur.archlinux.org/packages.php?ID=17471 Get the latest cabal2arch]<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Creating new Haskell packages===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it [http://code.haskell.org/arch/ the overlay].<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on http://hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
The .tar.gz is a zipped PKGBUILD ready to upload to AUR.<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
<br />
# Contributor: Arch Haskell Team <arch-haskell@haskell.org><br />
# Package generated by cabal2arch 0.3.6<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
depends=()<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd ${srcdir}/CC-delcont-0.2<br />
runhaskell Setup configure --enable-executable-stripping --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=${pkgdir} || return 1<br />
install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* Maintainer is by default the Arch Haskell team.<br />
* Libraries are prefixed with "haskell-"<br />
* "core" and "extra" Haskell libraries are not included as explicit dependencies, since ghc provides them<br />
* since Haskell libraries are statically linked, the package only has makedepends requirements, and no runtime requirements.<br />
* It uses cabal to generate a post-install register/unregister script, with a standard name.<br />
* Executable stripping is employed (to reduce binary size for executables).<br />
* Profiling versions of the library aren't currently installed (''TODO'')<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Guidelines for Libraries===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd ${srcdir}/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=${pkgdir} || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Guidelines for Programs ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= > 550 Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=62192Haskell package guidelines2009-02-16T17:34:07Z<p>Dons: /* Haskell on Arch */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and 86% percent of [http://hackage.haskell.org hackage.haskell.org] library database [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go available via AUR]. <br />
<br />
The community around Haskell on Arch is also active and well organized.<br />
<br />
== Community ==<br />
<br />
The main resources for the Arch/Haskell community to interact and discuss are:<br />
<br />
* [http://www.gogloom.com/FreeNode/arch-haskell <nowiki>#arch-haskell</nowiki>] irc channel @ freenode.org<br />
** Good for quick discussion and planning<br />
* [http://haskell.org/mailman/listinfo/arch-haskell arch-haskell@haskell.org] mailing list<br />
** Broader announcements, and automated updates<br />
* [http://archhaskell.wordpress.com/ Arch Haskell Weekly News]<br />
** A blog announcing our progress to the outside world.<br />
* [http://code.haskell.org/arch/x86_64/haskell.xml RSS feed] of new packages as they're uploaded<br />
<br />
== Haskell Packages ==<br />
<br />
The core Haskell tools are available in the core system (extra):<br />
<br />
==== <nowiki>[Extra]</nowiki> ====<br />
* [http://www.archlinux.org/packages/?arch=x86_64&repo=Extra&q=haskell&last_update=&limit=50 Haskell packages in the core system]<br />
<br />
Currently just the compilers<br />
<br />
==== <nowiki>[Community]</nowiki> ====<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=3&C=0&K=haskell&SB=v&SO=d&PP=25&SeB=nd&do_Orphans= Haskell packages in community]<br />
<br />
The start of the Haskell platform, a set of core libraries for building more things.<br />
<br />
==== <nowiki>AUR</nowiki> ====<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go Haskell packages in AUR]<br />
<br />
A huge number (almost 1000) packages built from http://hackage.haskell.org<br />
<br />
These generally improve on installing directly from Hackage as they resolve required C libraries. They can be installed as, for example:<br />
<br />
yaourt --aur -S --noconfirm cabal2arch<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment of of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to migrate the [http://www.haskell.org/haskellwiki/Haskell_Platform Haskell Platform] into community.<br />
<br />
<sup>1</sup>: There is problem with upgrading gtk2hs package at the moment and to register it properly, please, uninstall gtk2hs first and then install it!<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool.<br />
<br />
* [http://aur.archlinux.org/packages.php?ID=17471 Get the latest cabal2arch]<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Creating new Haskell packages===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it [http://code.haskell.org/arch/ the overlay].<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on http://hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
The .tar.gz is a zipped PKGBUILD ready to upload to AUR.<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
<br />
# Contributor: Arch Haskell Team <arch-haskell@haskell.org><br />
# Package generated by cabal2arch 0.3.6<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
depends=()<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd ${srcdir}/CC-delcont-0.2<br />
runhaskell Setup configure --enable-executable-stripping --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=${pkgdir} || return 1<br />
install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* Maintainer is by default the Arch Haskell team.<br />
* Libraries are prefixed with "haskell-"<br />
* "core" and "extra" Haskell libraries are not included as explicit dependencies, since ghc provides them<br />
* since Haskell libraries are statically linked, the package only has makedepends requirements, and no runtime requirements.<br />
* It uses cabal to generate a post-install register/unregister script, with a standard name.<br />
* Executable stripping is employed (to reduce binary size for executables).<br />
* Profiling versions of the library aren't currently installed (''TODO'')<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Guidelines for Libraries===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd ${srcdir}/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=${pkgdir} || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Guidelines for Programs ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= > 550 Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=62191Haskell package guidelines2009-02-16T17:33:20Z<p>Dons: /* Community */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and 86% percent of [http://hackage.haskell.org hackage.haskell.org] library database [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go available via AUR]. <br />
<br />
The community around Haskell on Arch is also active and well organized.<br />
<br />
== Community ==<br />
<br />
The main resources for the Arch/Haskell community to interact and discuss are:<br />
<br />
* [http://www.gogloom.com/FreeNode/arch-haskell <nowiki>#arch-haskell</nowiki>] irc channel @ freenode.org<br />
** Good for quick discussion and planning<br />
* [http://haskell.org/mailman/listinfo/arch-haskell arch-haskell@haskell.org] mailing list<br />
** Broader announcements, and automated updates<br />
* [http://archhaskell.wordpress.com/ Arch Haskell Weekly News]<br />
** A blog announcing our progress to the outside world.<br />
* [http://code.haskell.org/arch/x86_64/haskell.xml RSS feed] of new packages as they're uploaded<br />
<br />
=== Haskell on Arch ===<br />
<br />
The core Haskell tools are available in the core system (extra):<br />
<br />
==== <nowiki>[Extra]</nowiki> ====<br />
* [http://www.archlinux.org/packages/?arch=x86_64&repo=Extra&q=haskell&last_update=&limit=50 Haskell packages in the core system]<br />
<br />
Currently just the compilers<br />
<br />
==== <nowiki>[Community]</nowiki> ====<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=3&C=0&K=haskell&SB=v&SO=d&PP=25&SeB=nd&do_Orphans= Haskell packages in community] -- just what is needed for xmonad and pandoc.<br />
<br />
The start of the Haskell platform, a set of core libraries for building more things.<br />
<br />
==== <nowiki>AUR</nowiki> ====<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go Haskell packages in AUR]<br />
<br />
A huge number (almost 1000) packages built from http://hackage.haskell.org<br />
<br />
These generally improve on installing directly from Hackage as they resolve required C libraries. They can be installed as, for example:<br />
<br />
yaourt --aur -S --noconfirm cabal2arch<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment of of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to migrate the [http://www.haskell.org/haskellwiki/Haskell_Platform Haskell Platform] into community.<br />
<br />
<sup>1</sup>: There is problem with upgrading gtk2hs package at the moment and to register it properly, please, uninstall gtk2hs first and then install it!<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool.<br />
<br />
* [http://aur.archlinux.org/packages.php?ID=17471 Get the latest cabal2arch]<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Creating new Haskell packages===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it [http://code.haskell.org/arch/ the overlay].<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on http://hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
The .tar.gz is a zipped PKGBUILD ready to upload to AUR.<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
<br />
# Contributor: Arch Haskell Team <arch-haskell@haskell.org><br />
# Package generated by cabal2arch 0.3.6<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
depends=()<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd ${srcdir}/CC-delcont-0.2<br />
runhaskell Setup configure --enable-executable-stripping --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=${pkgdir} || return 1<br />
install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* Maintainer is by default the Arch Haskell team.<br />
* Libraries are prefixed with "haskell-"<br />
* "core" and "extra" Haskell libraries are not included as explicit dependencies, since ghc provides them<br />
* since Haskell libraries are statically linked, the package only has makedepends requirements, and no runtime requirements.<br />
* It uses cabal to generate a post-install register/unregister script, with a standard name.<br />
* Executable stripping is employed (to reduce binary size for executables).<br />
* Profiling versions of the library aren't currently installed (''TODO'')<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Guidelines for Libraries===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd ${srcdir}/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=${pkgdir} || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Guidelines for Programs ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= > 550 Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=62190Haskell package guidelines2009-02-16T17:32:55Z<p>Dons: updates</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and 86% percent of [http://hackage.haskell.org hackage.haskell.org] library database [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go available via AUR]. <br />
<br />
The community around Haskell on Arch is also active and well organized.<br />
<br />
== Community ==<br />
<br />
The main resources for the Arch/Haskell community to interact and discuss are:<br />
<br />
* [http://www.gogloom.com/FreeNode/arch-haskell <nowiki>#arch-haskell</nowiki>] irc channel @ freenode.org<br />
** Good for quick discussion and planning<br />
* [http://haskell.org/mailman/listinfo/arch-haskell arch-haskell@haskell.org] mailing list<br />
** Broader announcements, and automated updates<br />
* [http://archhaskell.wordpress.com/ Arch Haskell Weekly News]<br />
** A blog announcing our progress to the outside world.<br />
* [http://code.haskell.org/arch/x86_64/haskell.xml RSS feed] of new packages as they're uploaded<br />
<br />
=== Haskell on Arch ===<br />
<br />
The core Haskell tools are available in the core system (extra):<br />
<br />
==== <nowiki>[Extra]</nowiki> ====<br />
* [http://www.archlinux.org/packages/?arch=x86_64&repo=Extra&q=haskell&last_update=&limit=50 Haskell packages in the core system]<br />
<br />
Currently just the compilers<br />
<br />
==== <nowiki>[Community]</nowiki> ====<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=3&C=0&K=haskell&SB=v&SO=d&PP=25&SeB=nd&do_Orphans= Haskell packages in community] -- just what is needed for xmonad and pandoc.<br />
<br />
The start of the Haskell platform, a set of core libraries for building more things.<br />
<br />
==== <nowiki>AUR</nowiki> ====<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go Haskell packages in AUR]<br />
<br />
A huge number (almost 1000) packages built from http://hackage.haskell.org<br />
<br />
These generally improve on installing directly from Hackage as they resolve required C libraries. They can be installed as, for example:<br />
<br />
yaourt --aur -S --noconfirm cabal2arch<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment of of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to migrate the [http://www.haskell.org/haskellwiki/Haskell_Platform Haskell Platform] into community.<br />
<br />
<sup>1</sup>: There is problem with upgrading gtk2hs package at the moment and to register it properly, please, uninstall gtk2hs first and then install it!<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool.<br />
<br />
* [http://aur.archlinux.org/packages.php?ID=17471 Get the latest cabal2arch]<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Creating new Haskell packages===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it [http://code.haskell.org/arch/ the overlay].<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on http://hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
The .tar.gz is a zipped PKGBUILD ready to upload to AUR.<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
<br />
# Contributor: Arch Haskell Team <arch-haskell@haskell.org><br />
# Package generated by cabal2arch 0.3.6<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
depends=()<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd ${srcdir}/CC-delcont-0.2<br />
runhaskell Setup configure --enable-executable-stripping --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=${pkgdir} || return 1<br />
install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* Maintainer is by default the Arch Haskell team.<br />
* Libraries are prefixed with "haskell-"<br />
* "core" and "extra" Haskell libraries are not included as explicit dependencies, since ghc provides them<br />
* since Haskell libraries are statically linked, the package only has makedepends requirements, and no runtime requirements.<br />
* It uses cabal to generate a post-install register/unregister script, with a standard name.<br />
* Executable stripping is employed (to reduce binary size for executables).<br />
* Profiling versions of the library aren't currently installed (''TODO'')<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Guidelines for Libraries===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd ${srcdir}/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=${pkgdir} || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Guidelines for Programs ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= > 550 Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=50639Haskell package guidelines2008-10-04T19:25:38Z<p>Dons: </p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR.. There is an active<br />
community on the #arch-haskell IRC channel working to improve the<br />
support yet further, with two Arch core devs working on the project.<br />
<br />
== Community ==<br />
<br />
The community is active and well organised. The main resources for the Arch/Haskell community are:<br />
<br />
* <nowiki>#arch-haskell</nowiki> irc channel on freenode.<br />
* [http://haskell.org/mailman/listinfo/arch-haskell arch-haskell@haskell.org] mailing list<br />
* [http://archhaskell.wordpress.com/ Arch Haskell Weekly News]<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 600 binary builds of libraries and tools in Haskell are here as of Oct 2008. New additions to the overlay are announced in the IRC channel.<br />
<br />
===Haskell Overlay ===<br />
<br />
'''This section is out of date: the overlay is currently disused'''<br />
<br />
''A Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. The available packages can be seen with:<br />
<br />
$ pacman -Sl haskell<br />
<br />
There is an RSS feed of [http://code.haskell.org/arch/x86_64/haskell.xml the latest updates] to the overlay.''<br />
<br />
=== Haskell on Arch ===<br />
<br />
The basic Haskell tools are available in the core system (extra):<br />
<br />
* [http://www.archlinux.org/packages/search/?arch=all&repo=all&q=haskell&limit=50 Haskell packages in the core system] -- currently just the compilers<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=3&C=0&K=haskell&SB=v&SO=d&PP=25&SeB=nd&do_Orphans= Haskell packages in community] -- just what is needed for xmonad and pandoc.<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=2&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go Haskell packages in AUR] -- a huge number (400+) of packages from http://hackage.haskell.org<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment of of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to migrate the <a href="http://www.haskell.org/haskellwiki/Haskell_Platform">Haskell Platform</a> into community.<br />
<br />
<sup>1</sup>: There is problem with upgrading gtk2hs package at the moment and to register it properly, please, uninstall gtk2hs first and then install it!<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool.<br />
<br />
* [http://aur.archlinux.org/packages.php?ID=17471 Get the latest cabal2arch]<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Creating new Haskell packages===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it [http://code.haskell.org/arch/ the overlay].<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on http://hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
The .tar.gz is a zipped PKGBUILD ready to upload to AUR.<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
<br />
# Contributor: Arch Haskell Team <arch-haskell@haskell.org><br />
# Package generated by cabal2arch 0.3.6<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
depends=()<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd ${srcdir}/CC-delcont-0.2<br />
runhaskell Setup configure --enable-executable-stripping --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=${pkgdir} || return 1<br />
install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* Maintainer is by default the Arch Haskell team.<br />
* Libraries are prefixed with "haskell-"<br />
* "core" and "extra" Haskell libraries are not included as explicit dependencies, since ghc provides them<br />
* since Haskell libraries are statically linked, the package only has makedepends requirements, and no runtime requirements.<br />
* It uses cabal to generate a post-install register/unregister script, with a standard name.<br />
* Executable stripping is employed (to reduce binary size for executables).<br />
* Profiling versions of the library aren't currently installed (''TODO'')<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Guidelines for Libraries===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd ${srcdir}/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=${pkgdir} || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Guidelines for Programs ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= > 550 Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=49039Haskell package guidelines2008-09-07T23:11:04Z<p>Dons: </p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR.. There is an active<br />
community on the #arch-haskell IRC channel working to improve the<br />
support yet further, with two Arch core devs working on the project.<br />
<br />
===Haskell Overlay ===<br />
<br />
'''This section is out of date: the overlay is currently disused'''<br />
<br />
A Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. The available packages can be seen with:<br />
<br />
$ pacman -Sl haskell<br />
<br />
There is an RSS feed of [http://code.haskell.org/arch/x86_64/haskell.xml the latest updates] to the overlay.<br />
<br />
=== Haskell on Arch ===<br />
<br />
The basic Haskell tools are available in the core system (extra):<br />
<br />
* [http://www.archlinux.org/packages/search/?arch=all&repo=all&q=haskell&limit=50 Haskell packages in the core system] -- currently just the compilers<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=3&C=0&K=haskell&SB=v&SO=d&PP=25&SeB=nd&do_Orphans= Haskell packages in community] -- just what is needed for xmonad and pandoc.<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=2&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go Haskell packages in AUR] -- a huge number (400+) of packages from http://hackage.haskell.org<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment of of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<sup>1</sup><br />
* cairo<br />
<br />
<sup>1</sup>: There is problem with upgrading gtk2hs package at the moment and to register it properly, please, uninstall gtk2hs first and then install it!<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
The community is organised in two locations:<br />
<br />
* <nowiki>#arch-haskell</nowiki> on freenode.<br />
* [http://haskell.org/mailman/listinfo/arch-haskell arch-haskell@haskell.org] mailing list<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 400 binary builds of libraries and tools in Haskell are here as of June 2008. New additions to the overlay are announced in the IRC channel.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool.<br />
<br />
* [http://aur.archlinux.org/packages.php?ID=17471 Get the latest cabal2arch]<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Creating new Haskell packages===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it [http://code.haskell.org/arch/ the overlay].<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on http://hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
The .tar.gz is a zipped PKGBUILD ready to upload to AUR.<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
<br />
# Contributor: Arch Haskell Team <arch-haskell@haskell.org><br />
# Package generated by cabal2arch 0.3.6<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
depends=()<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --enable-executable-stripping --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* Maintainer is by default the Arch Haskell team.<br />
* Libraries are prefixed with "haskell-"<br />
* "core" and "extra" Haskell libraries are not included as explicit dependencies, since ghc provides them<br />
* since Haskell libraries are statically linked, the package only has makedepends requirements, and no runtime requirements.<br />
* It uses cabal to generate a post-install register/unregister script, with a standard name.<br />
* Executable stripping is employed (to reduce binary size for executables).<br />
* Profiling versions of the library aren't currently installed (''TODO'')<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Guidelines for Libraries===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Guidelines for Programs ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= > 550 Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=44256Haskell package guidelines2008-07-05T22:47:49Z<p>Dons: </p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR, with binary packages<br />
available via pacman from the Haskell Overlay. There is an active<br />
community on the #arch-haskell IRC channel working to improve the<br />
support yet further, along with some core Arch developers.<br />
<br />
===Haskell Overlay ===<br />
<br />
A Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. The available packages can be seen with:<br />
<br />
$ pacman -Sl haskell<br />
<br />
There is an RSS feed of [http://code.haskell.org/arch/x86_64/haskell.xml the latest updates] to the overlay.<br />
<br />
=== Haskell on Arch ===<br />
<br />
The basic Haskell tools are available in the core system (extra):<br />
<br />
* [http://www.archlinux.org/packages/search/?arch=all&repo=all&q=haskell&limit=50 Haskell packages in the core system] -- currently just the compilers<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=3&C=0&K=haskell&SB=v&SO=d&PP=25&SeB=nd&do_Orphans= Haskell packages in community] -- just what is needed for xmonad and pandoc.<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=2&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go Haskell packages in AUR] -- a huge number (400+) of packages from http://hackage.haskell.org<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment of of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
The community is organised in two locations:<br />
<br />
* <nowiki>#arch-haskell</nowiki> on freenode.<br />
* [http://haskell.org/mailman/listinfo/arch-haskell arch-haskell@haskell.org] mailing list<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 400 binary builds of libraries and tools in Haskell are here as of June 2008. New additions to the overlay are announced in the IRC channel.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool.<br />
<br />
* [http://aur.archlinux.org/packages.php?ID=17471 Get the latest cabal2arch]<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Creating new Haskell packages===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it [http://code.haskell.org/arch/ the overlay].<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on http://hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
The .tar.gz is a zipped PKGBUILD ready to upload to AUR.<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
<br />
# Contributor: Arch Haskell Team <arch-haskell@haskell.org><br />
# Package generated by cabal2arch 0.3.6<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
depends=()<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --enable-executable-stripping --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* Maintainer is by default the Arch Haskell team.<br />
* Libraries are prefixed with "haskell-"<br />
* "core" and "extra" Haskell libraries are not included as explicit dependencies, since ghc provides them<br />
* since Haskell libraries are statically linked, the package only has makedepends requirements, and no runtime requirements.<br />
* It uses cabal to generate a post-install register/unregister script, with a standard name.<br />
* Executable stripping is employed (to reduce binary size for executables).<br />
* Profiling versions of the library aren't currently installed (''TODO'')<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Guidelines for Libraries===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Guidelines for Programs ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= 400+ Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43530Haskell package guidelines2008-06-23T01:07:25Z<p>Dons: </p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR, with binary packages<br />
available via pacman from the Haskell Overlay. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Haskell Overlay ===<br />
<br />
A Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. The available packages can be seen with:<br />
<br />
$ pacman -Sl haskell<br />
<br />
There is an RSS feed of [http://code.haskell.org/arch/x86_64/haskell.xml the latest updates] to the overlay.<br />
<br />
=== Haskell on Arch ===<br />
<br />
The basic Haskell tools are available in the core system (extra):<br />
<br />
* [http://www.archlinux.org/packages/search/?arch=all&repo=all&q=haskell&limit=50 Haskell packages in the core system] -- currently just the compilers<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=3&C=0&K=haskell&SB=v&SO=d&PP=25&SeB=nd&do_Orphans= Haskell packages in community] -- just what is needed for xmonad and pandoc.<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=2&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go Haskell packages in AUR] -- a huge number (400+) of packages from http://hackage.haskell.org<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment of of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
The community is organised in two locations:<br />
<br />
* <nowiki>#arch-haskell</nowiki> on freenode.<br />
* [http://haskell.org/mailman/listinfo/arch-haskell arch-haskell@haskell.org] mailing list<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 400 binary builds of libraries and tools in Haskell are here as of June 2008. New additions to the overlay are announced in the IRC channel.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool.<br />
<br />
* [http://aur.archlinux.org/packages.php?ID=17471 Get the latest cabal2arch]<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Creating new Haskell packages===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it [http://code.haskell.org/arch/ the overlay].<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on http://hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
The .tar.gz is a zipped PKGBUILD ready to upload to AUR.<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
<br />
# Contributor: Arch Haskell Team <arch-haskell@haskell.org><br />
# Package generated by cabal2arch 0.3.6<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
depends=()<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --enable-executable-stripping --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* Maintainer is by default the Arch Haskell team.<br />
* Libraries are prefixed with "haskell-"<br />
* "core" and "extra" Haskell libraries are not included as explicit dependencies, since ghc provides them<br />
* since Haskell libraries are statically linked, the package only has makedepends requirements, and no runtime requirements.<br />
* It uses cabal to generate a post-install register/unregister script, with a standard name.<br />
* Executable stripping is employed (to reduce binary size for executables).<br />
* Profiling versions of the library aren't currently installed (''TODO'')<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Guidelines for Libraries===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Guidelines for Programs ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= 400+ Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43444Haskell package guidelines2008-06-22T04:00:03Z<p>Dons: /* Community */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR, with binary packages<br />
available via pacman from the Haskell Overlay. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Haskell Overlay ===<br />
<br />
A Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. The available packages can be seen with:<br />
<br />
$ pacman -Sl haskell<br />
<br />
There is an RSS feed of [http://code.haskell.org/arch/x86_64/haskell.xml the latest updates] to the overlay.<br />
<br />
=== Haskell on Arch ===<br />
<br />
The basic Haskell tools are available in the core system (extra):<br />
<br />
* [http://www.archlinux.org/packages/search/?arch=all&repo=all&q=haskell&limit=50 Haskell packages in the core system] -- currently just the compilers<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=3&C=0&K=haskell&SB=v&SO=d&PP=25&SeB=nd&do_Orphans= Haskell packages in community] -- just what is needed for xmonad and pandoc.<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=2&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go Haskell packages in AUR] -- a huge number (300+) of packages from http://hackage.haskell.org<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment of of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
The community is organised in two locations:<br />
<br />
* <nowiki>#arch-haskell</nowiki> on freenode.<br />
* [http://haskell.org/mailman/listinfo/arch-haskell arch-haskell@haskell.org] mailing list<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 300 binary builds of libraries and tools in Haskell are here as of June 2008. New additions to the overlay are announced in the IRC channel.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool.<br />
<br />
* [http://aur.archlinux.org/packages.php?ID=17471 Get the latest cabal2arch]<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Creating new Haskell packages===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it [http://code.haskell.org/arch/ the overlay].<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on http://hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
The .tar.gz is a zipped PKGBUILD ready to upload to AUR.<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
<br />
# Contributor: Arch Haskell Team <arch-haskell@haskell.org><br />
# Package generated by cabal2arch 0.3.6<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
depends=()<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --enable-executable-stripping --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* Maintainer is by default the Arch Haskell team.<br />
* Libraries are prefixed with "haskell-"<br />
* "core" and "extra" Haskell libraries are not included as explicit dependencies, since ghc provides them<br />
* since Haskell libraries are statically linked, the package only has makedepends requirements, and no runtime requirements.<br />
* It uses cabal to generate a post-install register/unregister script, with a standard name.<br />
* Executable stripping is employed (to reduce binary size for executables).<br />
* Profiling versions of the library aren't currently installed (''TODO'')<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Guidelines for Libraries===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Guidelines for Programs ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= 300+ Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43425Haskell package guidelines2008-06-21T23:38:02Z<p>Dons: /* Executables: guidelines */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR, with binary packages<br />
available via pacman from the Haskell Overlay. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Haskell Overlay ===<br />
<br />
A Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. The available packages can be seen with:<br />
<br />
$ pacman -Sl haskell<br />
<br />
There is an RSS feed of [http://code.haskell.org/arch/x86_64/haskell.xml the latest updates] to the overlay.<br />
<br />
=== Haskell on Arch ===<br />
<br />
The basic Haskell tools are available in the core system (extra):<br />
<br />
* [http://www.archlinux.org/packages/search/?arch=all&repo=all&q=haskell&limit=50 Haskell packages in the core system] -- currently just the compilers<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=3&C=0&K=haskell&SB=v&SO=d&PP=25&SeB=nd&do_Orphans= Haskell packages in community] -- just what is needed for xmonad and pandoc.<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=2&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go Haskell packages in AUR] -- a huge number (300+) of packages from http://hackage.haskell.org<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment of of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 300 binary builds of libraries and tools in Haskell are here as of June 2008. New additions to the overlay are announced in the IRC channel.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool.<br />
<br />
* [http://aur.archlinux.org/packages.php?ID=17471 Get the latest cabal2arch]<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Creating new Haskell packages===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it [http://code.haskell.org/arch/ the overlay].<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on http://hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
The .tar.gz is a zipped PKGBUILD ready to upload to AUR.<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
<br />
# Contributor: Arch Haskell Team <arch-haskell@haskell.org><br />
# Package generated by cabal2arch 0.3.6<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
depends=()<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --enable-executable-stripping --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* Maintainer is by default the Arch Haskell team.<br />
* Libraries are prefixed with "haskell-"<br />
* "core" and "extra" Haskell libraries are not included as explicit dependencies, since ghc provides them<br />
* since Haskell libraries are statically linked, the package only has makedepends requirements, and no runtime requirements.<br />
* It uses cabal to generate a post-install register/unregister script, with a standard name.<br />
* Executable stripping is employed (to reduce binary size for executables).<br />
* Profiling versions of the library aren't currently installed (''TODO'')<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Guidelines for Libraries===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Guidelines for Programs ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= 300+ Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43424Haskell package guidelines2008-06-21T23:37:45Z<p>Dons: /* Libraries: guidelines */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR, with binary packages<br />
available via pacman from the Haskell Overlay. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Haskell Overlay ===<br />
<br />
A Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. The available packages can be seen with:<br />
<br />
$ pacman -Sl haskell<br />
<br />
There is an RSS feed of [http://code.haskell.org/arch/x86_64/haskell.xml the latest updates] to the overlay.<br />
<br />
=== Haskell on Arch ===<br />
<br />
The basic Haskell tools are available in the core system (extra):<br />
<br />
* [http://www.archlinux.org/packages/search/?arch=all&repo=all&q=haskell&limit=50 Haskell packages in the core system] -- currently just the compilers<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=3&C=0&K=haskell&SB=v&SO=d&PP=25&SeB=nd&do_Orphans= Haskell packages in community] -- just what is needed for xmonad and pandoc.<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=2&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go Haskell packages in AUR] -- a huge number (300+) of packages from http://hackage.haskell.org<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment of of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 300 binary builds of libraries and tools in Haskell are here as of June 2008. New additions to the overlay are announced in the IRC channel.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool.<br />
<br />
* [http://aur.archlinux.org/packages.php?ID=17471 Get the latest cabal2arch]<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Creating new Haskell packages===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it [http://code.haskell.org/arch/ the overlay].<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on http://hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
The .tar.gz is a zipped PKGBUILD ready to upload to AUR.<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
<br />
# Contributor: Arch Haskell Team <arch-haskell@haskell.org><br />
# Package generated by cabal2arch 0.3.6<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
depends=()<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --enable-executable-stripping --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* Maintainer is by default the Arch Haskell team.<br />
* Libraries are prefixed with "haskell-"<br />
* "core" and "extra" Haskell libraries are not included as explicit dependencies, since ghc provides them<br />
* since Haskell libraries are statically linked, the package only has makedepends requirements, and no runtime requirements.<br />
* It uses cabal to generate a post-install register/unregister script, with a standard name.<br />
* Executable stripping is employed (to reduce binary size for executables).<br />
* Profiling versions of the library aren't currently installed (''TODO'')<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Guidelines for Libraries===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables: guidelines ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= 300+ Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43423Haskell package guidelines2008-06-21T23:35:11Z<p>Dons: walk through cabal2arch again</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR, with binary packages<br />
available via pacman from the Haskell Overlay. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Haskell Overlay ===<br />
<br />
A Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. The available packages can be seen with:<br />
<br />
$ pacman -Sl haskell<br />
<br />
There is an RSS feed of [http://code.haskell.org/arch/x86_64/haskell.xml the latest updates] to the overlay.<br />
<br />
=== Haskell on Arch ===<br />
<br />
The basic Haskell tools are available in the core system (extra):<br />
<br />
* [http://www.archlinux.org/packages/search/?arch=all&repo=all&q=haskell&limit=50 Haskell packages in the core system] -- currently just the compilers<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=3&C=0&K=haskell&SB=v&SO=d&PP=25&SeB=nd&do_Orphans= Haskell packages in community] -- just what is needed for xmonad and pandoc.<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=2&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go Haskell packages in AUR] -- a huge number (300+) of packages from http://hackage.haskell.org<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment of of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 300 binary builds of libraries and tools in Haskell are here as of June 2008. New additions to the overlay are announced in the IRC channel.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool.<br />
<br />
* [http://aur.archlinux.org/packages.php?ID=17471 Get the latest cabal2arch]<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Creating new Haskell packages===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it [http://code.haskell.org/arch/ the overlay].<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on http://hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
The .tar.gz is a zipped PKGBUILD ready to upload to AUR.<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
<br />
# Contributor: Arch Haskell Team <arch-haskell@haskell.org><br />
# Package generated by cabal2arch 0.3.6<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
depends=()<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --enable-executable-stripping --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* Maintainer is by default the Arch Haskell team.<br />
* Libraries are prefixed with "haskell-"<br />
* "core" and "extra" Haskell libraries are not included as explicit dependencies, since ghc provides them<br />
* since Haskell libraries are statically linked, the package only has makedepends requirements, and no runtime requirements.<br />
* It uses cabal to generate a post-install register/unregister script, with a standard name.<br />
* Executable stripping is employed (to reduce binary size for executables).<br />
* Profiling versions of the library aren't currently installed (''TODO'')<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Libraries: guidelines ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables: guidelines ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= 300+ Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43422Haskell package guidelines2008-06-21T23:29:09Z<p>Dons: /* Want to create a new Haskell package */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR, with binary packages<br />
available via pacman from the Haskell Overlay. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Haskell Overlay ===<br />
<br />
A Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. The available packages can be seen with:<br />
<br />
$ pacman -Sl haskell<br />
<br />
There is an RSS feed of [http://code.haskell.org/arch/x86_64/haskell.xml the latest updates] to the overlay.<br />
<br />
=== Haskell on Arch ===<br />
<br />
The basic Haskell tools are available in the core system (extra):<br />
<br />
* [http://www.archlinux.org/packages/search/?arch=all&repo=all&q=haskell&limit=50 Haskell packages in the core system] -- currently just the compilers<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=3&C=0&K=haskell&SB=v&SO=d&PP=25&SeB=nd&do_Orphans= Haskell packages in community] -- just what is needed for xmonad and pandoc.<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=2&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go Haskell packages in AUR] -- a huge number (300+) of packages from http://hackage.haskell.org<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment of of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 300 binary builds of libraries and tools in Haskell are here as of June 2008. New additions to the overlay are announced in the IRC channel.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool.<br />
<br />
* [http://aur.archlinux.org/packages.php?ID=17471 Get the latest cabal2arch]<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Creating new Haskell packages===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it [http://code.haskell.org/arch/ the overlay].<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on http://hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Libraries: guidelines ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables: guidelines ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= 300+ Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43421Haskell package guidelines2008-06-21T23:28:15Z<p>Dons: /* Guidelines */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR, with binary packages<br />
available via pacman from the Haskell Overlay. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Haskell Overlay ===<br />
<br />
A Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. The available packages can be seen with:<br />
<br />
$ pacman -Sl haskell<br />
<br />
There is an RSS feed of [http://code.haskell.org/arch/x86_64/haskell.xml the latest updates] to the overlay.<br />
<br />
=== Haskell on Arch ===<br />
<br />
The basic Haskell tools are available in the core system (extra):<br />
<br />
* [http://www.archlinux.org/packages/search/?arch=all&repo=all&q=haskell&limit=50 Haskell packages in the core system] -- currently just the compilers<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=3&C=0&K=haskell&SB=v&SO=d&PP=25&SeB=nd&do_Orphans= Haskell packages in community] -- just what is needed for xmonad and pandoc.<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=2&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go Haskell packages in AUR] -- a huge number (300+) of packages from http://hackage.haskell.org<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment of of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 300 binary builds of libraries and tools in Haskell are here as of June 2008. New additions to the overlay are announced in the IRC channel.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool.<br />
<br />
* [http://aur.archlinux.org/packages.php?ID=17471 Get the latest cabal2arch]<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Want to create a new Haskell package===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch.<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Libraries: guidelines ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables: guidelines ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= 300+ Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43420Haskell package guidelines2008-06-21T23:27:42Z<p>Dons: /* Community */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR, with binary packages<br />
available via pacman from the Haskell Overlay. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Haskell Overlay ===<br />
<br />
A Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. The available packages can be seen with:<br />
<br />
$ pacman -Sl haskell<br />
<br />
There is an RSS feed of [http://code.haskell.org/arch/x86_64/haskell.xml the latest updates] to the overlay.<br />
<br />
=== Haskell on Arch ===<br />
<br />
The basic Haskell tools are available in the core system (extra):<br />
<br />
* [http://www.archlinux.org/packages/search/?arch=all&repo=all&q=haskell&limit=50 Haskell packages in the core system] -- currently just the compilers<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=3&C=0&K=haskell&SB=v&SO=d&PP=25&SeB=nd&do_Orphans= Haskell packages in community] -- just what is needed for xmonad and pandoc.<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=2&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go Haskell packages in AUR] -- a huge number (300+) of packages from http://hackage.haskell.org<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment of of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 300 binary builds of libraries and tools in Haskell are here as of June 2008. New additions to the overlay are announced in the IRC channel.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool. The latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Want to create a new Haskell package===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch.<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Libraries: guidelines ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables: guidelines ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= 300+ Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43419Haskell package guidelines2008-06-21T23:26:45Z<p>Dons: /* Haskell on Arch */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR, with binary packages<br />
available via pacman from the Haskell Overlay. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Haskell Overlay ===<br />
<br />
A Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. The available packages can be seen with:<br />
<br />
$ pacman -Sl haskell<br />
<br />
There is an RSS feed of [http://code.haskell.org/arch/x86_64/haskell.xml the latest updates] to the overlay.<br />
<br />
=== Haskell on Arch ===<br />
<br />
The basic Haskell tools are available in the core system (extra):<br />
<br />
* [http://www.archlinux.org/packages/search/?arch=all&repo=all&q=haskell&limit=50 Haskell packages in the core system] -- currently just the compilers<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=3&C=0&K=haskell&SB=v&SO=d&PP=25&SeB=nd&do_Orphans= Haskell packages in community] -- just what is needed for xmonad and pandoc.<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=2&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go Haskell packages in AUR] -- a huge number (300+) of packages from http://hackage.haskell.org<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment of of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 300 binary builds of libraries and tools in Haskell are here as of June 2008.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool. The latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Want to create a new Haskell package===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch.<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Libraries: guidelines ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables: guidelines ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= 300+ Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43418Haskell package guidelines2008-06-21T23:25:48Z<p>Dons: /* Haskell on Arch */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR, with binary packages<br />
available via pacman from the Haskell Overlay. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Haskell Overlay ===<br />
<br />
A Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. The available packages can be seen with:<br />
<br />
$ pacman -Sl haskell<br />
<br />
There is an RSS feed of [http://code.haskell.org/arch/x86_64/haskell.xml the latest updates] to the overlay.<br />
<br />
=== Haskell on Arch ===<br />
<br />
The basic Haskell tools are available in the core system (extra):<br />
<br />
* [http://www.archlinux.org/packages/search/?arch=all&repo=all&q=haskell&limit=50 Haskell packages in the core system] -- currently just the compilers<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=3&C=0&K=haskell&SB=v&SO=d&PP=25&SeB=nd&do_Orphans= Haskell packages in community] -- just what is needed for xmonad and pandoc.<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go Haskell packages in AUR] -- a huge number (300+) of packages from http://hackage.haskell.org<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment of of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 300 binary builds of libraries and tools in Haskell are here as of June 2008.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool. The latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Want to create a new Haskell package===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch.<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Libraries: guidelines ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables: guidelines ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= 300+ Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43417Haskell package guidelines2008-06-21T23:24:31Z<p>Dons: /* Haskell on Arch */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR, with binary packages<br />
available via pacman from the Haskell Overlay. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Haskell Overlay ===<br />
<br />
A Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. The available packages can be seen with:<br />
<br />
$ pacman -Sl haskell<br />
<br />
There is an RSS feed of [http://code.haskell.org/arch/x86_64/haskell.xml the latest updates] to the overlay.<br />
<br />
=== Haskell on Arch ===<br />
<br />
The basic Haskell tools are available in the core system (extra):<br />
<br />
* [http://www.archlinux.org/packages/search/?arch=all&repo=all&q=haskell&limit=50 Haskell packages in the core system] -- currently just the compilers<br />
<br />
* A small number of packages can be found in [http://aur.archlinux.org/packages.php?O=0&L=3&C=0&K=haskell&SB=v&SO=d&PP=25&SeB=nd&do_Orphans= community].<br />
<br />
Package descriptions (PKGBUILDS) for everything else are available in AUR:<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go Haskell packages in AUR] -- a huge number (around 300) of packages from hackage.haskell.org<br />
<br />
Anything not found here can be installed via cabal-install direct from hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment of of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 300 binary builds of libraries and tools in Haskell are here as of June 2008.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool. The latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Want to create a new Haskell package===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch.<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Libraries: guidelines ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables: guidelines ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= 300+ Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43416Haskell package guidelines2008-06-21T23:19:32Z<p>Dons: /* AUR */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR, with binary packages<br />
available via pacman from the Haskell Overlay. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Haskell Overlay ===<br />
<br />
A Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. The available packages can be seen with:<br />
<br />
$ pacman -Sl haskell<br />
<br />
There is an RSS feed of [http://code.haskell.org/arch/x86_64/haskell.xml the latest updates] to the overlay.<br />
<br />
=== Haskell on Arch ===<br />
<br />
The basic Haskell tools are available in the core system (extra):<br />
<br />
* [http://www.archlinux.org/packages/search/?arch=all&repo=all&q=haskell&limit=50 Haskell packages in the core system] -- currently just the compilers<br />
<br />
A small number of packages are also in community.<br />
<br />
Package descriptions (PKGBUILDS) for everything else are available in AUR:<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go Haskell packages in AUR] -- a huge number (around 300) of packages from hackage.haskell.org<br />
<br />
Anything not found here can be installed via cabal-install direct from hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment of of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 300 binary builds of libraries and tools in Haskell are here as of June 2008.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool. The latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Want to create a new Haskell package===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch.<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Libraries: guidelines ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables: guidelines ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SB=v&SO=d&PP=100&SeB=nd&do_Orphans= 300+ Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43415Haskell package guidelines2008-06-21T23:18:51Z<p>Dons: /* Executables: guidelines */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR, with binary packages<br />
available via pacman from the Haskell Overlay. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Haskell Overlay ===<br />
<br />
A Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. The available packages can be seen with:<br />
<br />
$ pacman -Sl haskell<br />
<br />
There is an RSS feed of [http://code.haskell.org/arch/x86_64/haskell.xml the latest updates] to the overlay.<br />
<br />
=== Haskell on Arch ===<br />
<br />
The basic Haskell tools are available in the core system (extra):<br />
<br />
* [http://www.archlinux.org/packages/search/?arch=all&repo=all&q=haskell&limit=50 Haskell packages in the core system] -- currently just the compilers<br />
<br />
A small number of packages are also in community.<br />
<br />
Package descriptions (PKGBUILDS) for everything else are available in AUR:<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go Haskell packages in AUR] -- a huge number (around 300) of packages from hackage.haskell.org<br />
<br />
Anything not found here can be installed via cabal-install direct from hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment of of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 300 binary builds of libraries and tools in Haskell are here as of June 2008.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool. The latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Want to create a new Haskell package===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch.<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Libraries: guidelines ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables: guidelines ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries<br />
have a runtime 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.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go 300+ Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43300Haskell package guidelines2008-06-19T00:24:51Z<p>Dons: /* Haskell Overlay */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR, with binary packages<br />
available via pacman from the Haskell Overlay. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Haskell Overlay ===<br />
<br />
A Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. Following this, search for Haskell packages<br />
should yield a large number of hits:<br />
<br />
$ pacman -Ss haskell<br />
<br />
There is an RSS feed of [http://code.haskell.org/arch/x86_64/haskell.xml the latest updates] to the overlay.<br />
<br />
=== Haskell on Arch ===<br />
<br />
The basic Haskell tools are available in the core system (extra):<br />
<br />
* [http://www.archlinux.org/packages/search/?arch=all&repo=all&q=haskell&limit=50 Haskell packages in the core system] -- currently just the compilers<br />
<br />
A small number of packages are also in community.<br />
<br />
Package descriptions (PKGBUILDS) for everything else are available in AUR:<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go Haskell packages in AUR] -- a huge number (around 300) of packages from hackage.haskell.org<br />
<br />
===Haskell Overlay ===<br />
<br />
Compelementing AUR is the Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. Following this, search for Haskell packages<br />
should yield a large number of hits:<br />
<br />
$ pacman -Ss haskell<br />
<br />
Anything not found here can be installed via cabal-install direct from hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment ouf of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 300 binary builds of libraries and tools in Haskell are here as of June 2008.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool. The latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Want to create a new Haskell package===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch.<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Libraries: guidelines ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables: guidelines ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
* Be careful about dynamically linked runtime dependencies on C<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go 300+ Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43299Haskell package guidelines2008-06-19T00:24:05Z<p>Dons: /* Haskell Overlay */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR, with binary packages<br />
available via pacman from the Haskell Overlay. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Haskell Overlay ===<br />
<br />
[http://code.haskell.org/arch/x86_64/haskell.xml http://haskell.org/sitewiki/images/0/09/Rss.png]<br />
<br />
A Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. Following this, search for Haskell packages<br />
should yield a large number of hits:<br />
<br />
$ pacman -Ss haskell<br />
<br />
There is an RSS feed of [http://code.haskell.org/arch/x86_64/haskell.xml the latest updates] to the overlay.<br />
<br />
=== Haskell on Arch ===<br />
<br />
The basic Haskell tools are available in the core system (extra):<br />
<br />
* [http://www.archlinux.org/packages/search/?arch=all&repo=all&q=haskell&limit=50 Haskell packages in the core system] -- currently just the compilers<br />
<br />
A small number of packages are also in community.<br />
<br />
Package descriptions (PKGBUILDS) for everything else are available in AUR:<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go Haskell packages in AUR] -- a huge number (around 300) of packages from hackage.haskell.org<br />
<br />
===Haskell Overlay ===<br />
<br />
Compelementing AUR is the Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. Following this, search for Haskell packages<br />
should yield a large number of hits:<br />
<br />
$ pacman -Ss haskell<br />
<br />
Anything not found here can be installed via cabal-install direct from hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment ouf of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 300 binary builds of libraries and tools in Haskell are here as of June 2008.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool. The latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Want to create a new Haskell package===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch.<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Libraries: guidelines ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables: guidelines ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
* Be careful about dynamically linked runtime dependencies on C<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go 300+ Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43298Haskell package guidelines2008-06-19T00:22:24Z<p>Dons: /* Haskell Overlay */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR, with binary packages<br />
available via pacman from the Haskell Overlay. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Haskell Overlay ===<br />
<br />
A Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. Following this, search for Haskell packages<br />
should yield a large number of hits:<br />
<br />
$ pacman -Ss haskell<br />
<br />
There is an RSS feed of [http://code.haskell.org/arch/x86_64/haskell.xml the latest updates] to the overlay.<br />
<br />
=== Haskell on Arch ===<br />
<br />
The basic Haskell tools are available in the core system (extra):<br />
<br />
* [http://www.archlinux.org/packages/search/?arch=all&repo=all&q=haskell&limit=50 Haskell packages in the core system] -- currently just the compilers<br />
<br />
A small number of packages are also in community.<br />
<br />
Package descriptions (PKGBUILDS) for everything else are available in AUR:<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go Haskell packages in AUR] -- a huge number (around 300) of packages from hackage.haskell.org<br />
<br />
===Haskell Overlay ===<br />
<br />
Compelementing AUR is the Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. Following this, search for Haskell packages<br />
should yield a large number of hits:<br />
<br />
$ pacman -Ss haskell<br />
<br />
Anything not found here can be installed via cabal-install direct from hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment ouf of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 300 binary builds of libraries and tools in Haskell are here as of June 2008.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool. The latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Want to create a new Haskell package===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch.<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Libraries: guidelines ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables: guidelines ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
* Be careful about dynamically linked runtime dependencies on C<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go 300+ Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43294Haskell package guidelines2008-06-18T23:31:29Z<p>Dons: update documentation in light of the overlay</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR, with binary packages<br />
available via pacman from the Haskell Overlay. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Haskell Overlay ===<br />
<br />
A Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. Following this, search for Haskell packages<br />
should yield a large number of hits:<br />
<br />
$ pacman -Ss haskell<br />
<br />
=== Haskell on Arch ===<br />
<br />
The basic Haskell tools are available in the core system (extra):<br />
<br />
* [http://www.archlinux.org/packages/search/?arch=all&repo=all&q=haskell&limit=50 Haskell packages in the core system] -- currently just the compilers<br />
<br />
A small number of packages are also in community.<br />
<br />
Package descriptions (PKGBUILDS) for everything else are available in AUR:<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go Haskell packages in AUR] -- a huge number (around 300) of packages from hackage.haskell.org<br />
<br />
===Haskell Overlay ===<br />
<br />
Compelementing AUR is the Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. Following this, search for Haskell packages<br />
should yield a large number of hits:<br />
<br />
$ pacman -Ss haskell<br />
<br />
Anything not found here can be installed via cabal-install direct from hackage.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment ouf of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 300 binary builds of libraries and tools in Haskell are here as of June 2008.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool. The latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
cabal2arch is used to automatically generate the overlay repository.<br />
<br />
===Want to create a new Haskell package===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch.<br />
In many cases you'll already find a PKGBUILD and a binary package there, installable via pacman.<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Uploading the the Haskell repository ===<br />
<br />
The following (ad hoc) script is currently used to upload packages after running cabal2arch to the respository, and keep it in sync:<br />
<br />
#!/bin/sh<br />
set -e<br />
makepkg -i<br />
scp *-x86_64.pkg.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
repo-add /home/dons/haskell.db.tar.gz *.pkg.tar.gz<br />
rm -rf *.tar.gz pkg src<br />
pwd=`pwd`<br />
dir=`basename $pwd`<br />
cd ..<br />
scp -r $dir code.haskell.org:/srv/code/arch/x86_64/<br />
scp $HOME/haskell.db.tar.gz code.haskell.org:/srv/code/arch/x86_64/<br />
<br />
This is to be used by those with arch-haskell repository write permissions.<br />
<br />
===Libraries: guidelines ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables: guidelines ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
* Be careful about dynamically linked runtime dependencies on C<br />
<br />
== Haskell on Arch: current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===Haskell overlay===<br />
<br />
Has everything else we know how to build.<br />
<br />
===AUR===<br />
<br />
There's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go 300+ Haskell packages] in AUR.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43293Haskell package guidelines2008-06-18T23:21:43Z<p>Dons: haskell overlay is live</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Haskell Overlay ===<br />
<br />
A Haskell "overlay" repository, automatically generated from a snapshot of hackage.haskell.org is hosted by the Arch Haskell team on code.haskell.org.<br />
Add the following to your /etc/pacman.conf<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
<br />
Then resync, pacman -Sy. Following this, search for Haskell packages<br />
should yield a large number of hits:<br />
<br />
$ pacman -Ss haskell<br />
<br />
=== Search ===<br />
<br />
Basic Haskell tools:<br />
<br />
* [http://www.archlinux.org/packages/search/?arch=all&repo=all&q=haskell&limit=50 Haskell packages in the core system] -- currently just the compilers<br />
<br />
All the rest:<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go Haskell packages in AUR] -- a huge number (around 300) of packages from hackage.haskell.org<br />
<br />
Anything that's no here but on hackage can be obtained via "cabal-install", in the AUR suite.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment ouf of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 200 binary builds of libraries and tools in Haskell are here as of June 2008.<br />
<br />
== Guidelines ==<br />
<br />
We're working on a tool to automate PKGBUILD generation.<br />
Latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
This will automate the entire process, allowing us to import the 500+ libraries on hackage, and keep them up to date.<br />
<br />
<br />
===Places to check ===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===Creating new packages with cabal2arch ===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Libraries ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
<br />
== Current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===AUR===<br />
<br />
While there's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go 200+ Haskell packages] in AUR. Note that there are 550+ packages on hackage.haskell.org, so even in AUR we're still well behind.<br />
<br />
===Haskell overlay ===<br />
<br />
A suite of binary packages and PKGBULIDs of Haskell libraries is hosted on code.haskell.org by the Arch Haskell team:<br />
<br />
http://code.haskell.org/arch/<br />
<br />
These are automatically generated via cabal2arch.<br />
<br />
====Haskell overlay with pacman ====<br />
<br />
'''TODO:''' In order to be able to use Haskell overlay as one of the repos available with pacman, we need to create a database with something like:<br />
<br />
''repo-add arch-haskell.db.tar.gz $pkg.tar.gz''<br />
<br />
so that end-users can then enable Haskell overlay by adding the following lines in ''/etc/pacman.conf'':<br />
<br />
<br />
''[arch-haskell]''<br />
<br />
''Server = http://code.haskell.org/arch/$arch''<br />
<br />
where ''$arch'' is ''i686'' or ''x86_64''.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"<br />
<br />
<br />
Using cabal-install we can get a topological sort of the installable graph of modules. You can see such an install plan [http://code.haskell.org/arch/install-plan.txt here].</div>Donshttps://wiki.archlinux.org/index.php?title=Unofficial_user_repositories&diff=43292Unofficial user repositories2008-06-18T22:49:49Z<p>Dons: /* List of PUR (unofficial user repositories) | x86-64 */</p>
<hr />
<div>[[Category: Package management (English)]]<br />
[[Category: General (English)]]<br />
<br />
== Why unofficial user repositories ==<br />
Since the AUR only allows users to upload PKGBUILD and other package build related files, but does not provide a means for distributing a binary package, a user may want to create a binary repository of their packages elsewhere.<br />
<br />
'''However:''' Be advised, if you only put your packages in your private repo and neglect AUR, your package will never make it into community repo nor a central storage space(AUR) which is bad for users, since they will have to add 'YetAnotherThird-party-Repo'(YATR) to their /etc/pacman.conf which will make it slower to update. But the main reason you should not have repo-only packages is that not having packages in a central place confuses and gives users a second job in that they now have to search for ''Repositories'' in addition to ''Packages''.<br />
<br />
Thus the best way to have a private repo is to offer it as a ''supplement'' to the AUR for those users who don't want to compile. You should try to avoid to offer it as a ''substitute''.<br />
<br />
== The future of Unofficial repos ==<br />
I'd like to see more work of this type. Sometimes there are certain projects that don't mesh well with other things, such as the community repo. The 'kdemod' project is a good example.<br />
<br />
In the future, well-thought-out user repositories may be ideal for lots of supplementary things. Forming a "web of trust" is important in cases like this, so we may begin keeping a list of "recommended" repositories somewhere, in order to make it seem more official and trustworthy.<br />
<br />
[[User:Phrakture|Phrakture]] 12:50, 18 May 2007 (EDT)<br />
<br />
== The community repository, maintained by the TUs==<br />
<nowiki>[community]<br />
Server = ftp://ftp.archlinux.org/community/os/i686/</nowiki><br />
<br />
The community repository is included in pacman's default configuration, but disabled. You can enable it by removing the # in these two lines:<br />
<br />
[community]<br />
Include = /etc/pacman.d/community<br />
<br />
== List of PUR (unofficial user repositories) | i686 ==<br />
<nowiki><br />
[archie]<br />
Server = ftp://ftp.sunsite.dk/projects/archie/packages<br />
<br />
[archlinuxfr]<br />
## The french Arch Linux communities packages<br />
Server = http://repo.archlinux.fr/i686<br />
<br />
[archlinux.pl]<br />
## The polish Arch Linux communities packages<br />
Server = http://bednarek.org.pl/arch/i686<br />
<br />
[archlinuxve]<br />
# Home of the splashy packages<br />
Server = http://repo.archlinux.com.ve/i686<br />
<br />
[arch-graphics]<br />
# repository aimed to provide applications mainly for 3D graphics<br />
# for more info, look at http://arch-graphics.kx.cz/<br />
Server = http://arch-graphics.kx.cz/repo/i686<br />
<br />
[cgr-i686]<br />
# packages for some ChicoGeek's PKGBUILDs<br />
Server = http://cgr.i686.googlepages.com/<br />
<br />
[compiz-fusion]<br />
#compiz-fusion-git<br />
Server = http://compiz.dreamz-box.de/i686<br />
<br />
[dibble]<br />
Server = http://dtw.jiwe.org/pkgs/dibble<br />
<br />
[hussam]<br />
## Contains daily Firefox trunk cvs i686 packages.<br />
Server = http://ht990332.googlepages.com/<br />
<br />
[janitux]<br />
Server = http://janitux.mortals.dy.fi <br />
<br />
[kasmol]<br />
Server = http://kasmol.netsons.org/arch/software<br />
<br />
[kde-split]<br />
## Splitted kde packages. Original kdebase and kdelibs are required. Work in progress<br />
Server = http://gotux.altervista.org/arch/packages/i686/<br />
<br />
[kdemod]<br />
# splitted KDE... take a look:<br />
# - http://bbs.archlinux.org/viewtopic.php?t=23319<br />
# - http://kdemod.ath.cx/<br />
# if there's a big change and you would stay on the bleeding edge you may replace<br />
# 'current' with 'testing'<br />
Server = http://kdemod.ath.cx/repo/current/i686<br />
<br />
[lnf]<br />
# packages include: firefox3-systemcairo, cairo-ubuntu (+deps)<br />
# tor-alpha, radeonhd-git, gajim-svn, mpd-svn, sonata-svn, vidalia<br />
Server = http://reactor.reality-protocol.de/lnf<br />
<br />
[Lapis]<br />
## Linux-sevenler packages.Zemberek , virtualbox and other stuff<br />
Server = http://arch.linux-sevenler.org/pkgs <br />
<br />
[nvidia-beta]<br />
## nvidia 0.9.* beta drivers<br />
Server = http://box.decemplex.net/~thomas/nvidia-beta/<br />
<br />
[obarchie]<br />
Server = http://dtw.jiwe.org/pkgs/obarchie<br />
<br />
[perlcpan]<br />
## More info here: http://wiki.archlinux.org/index.php/PerlCPAN_Repository<br />
Server = http://arch.os-zen.net/perlcpan/packages<br />
<br />
[rabyte]<br />
Server = http://oxygen4.free.fr/arch<br />
<br />
[seif]<br />
Server = http://seif.hopto.org/arch/<br />
<br />
[takhis] <br />
## e17, ...<br />
Server = ftp://takhis.net/arch/i686<br />
<br />
[tango]<br />
# dmdtango package (dmd compiler + tango library)<br />
Server = http://downloads.dsource.org/projects/tango/archlinux/i686<br />
<br />
[Tj]<br />
#New repo, currently only has wine (always latest :) ) and toribash (requested). <br />
#I will be compiling more stuff. I will always have latest wine though. <br />
#Requests are welcome, go to the site to find email link.<br />
Server = http://science.uwaterloo.ca/~tharihar<br />
<br />
[Victor]<br />
Server = http://personales.ya.com/vmromanos/arch/pkgs<br />
<br />
[sergej-repo]<br />
# ion3 and some other stuff<br />
# http://code.google.com/p/archlinux-stuff/source/browse/trunk/my-repo<br />
Server = http://web.vrn.ru/sergej/sergej-repo/i686/<br />
</nowiki><br />
<br />
== List of PUR (unofficial user repositories) | x86-64 ==<br />
<nowiki><br />
[archlinuxfr]<br />
## The french Archlinux communities packages<br />
Server = http://repo.archlinux.fr/x86_64/<br />
<br />
[kdemod]<br />
# splitted KDE... take a look:<br />
# - http://bbs.archlinux.org/viewtopic.php?t=23319<br />
# - http://kdemod.ath.cx/<br />
# if there's a big change and you would stay on the bleeding edge you may replace<br />
# 'current' with 'testing'<br />
Server = http://kdemod.ath.cx/repo/current/x86_64<br />
<br />
[olympus]<br />
## by zeus<br />
## see http://archlinux.org.ru/forum/index.php/topic,39.0.html for more info<br />
Server = http://zeus.hovel.ru/archlinux/olympus/<br />
<br />
[oo-voikko]<br />
## Openoffice and linguistic software and data for Finnish<br />
Server = http://www.kotikone.fi/purch/arch/oo-voikko/x86_64<br />
<br />
[homegnu]<br />
## Some packages for the tuxdroid + custom versions of some stuff<br />
Server = http://data.homegnu.net/archlinux<br />
<br />
[compiz-fusion]<br />
#compiz-fusion-git<br />
Server = http://compiz.dreamz-box.de/x86_64<br />
<br />
[archlinuxve]<br />
# Home of the splashy packages<br />
Server = http://repo.archlinux.com.ve/x86_64<br />
<br />
[sergej-repo]<br />
# ion3 and some other stuff<br />
# http://code.google.com/p/archlinux-stuff/source/browse/trunk/my-repo<br />
Server = http://web.vrn.ru/sergej/sergej-repo/x86_64/<br />
<br />
[haskell]<br />
# Complete Haskell libraries and tools suite, snapshot of hackage.haskell.org<br />
Server = http://code.haskell.org/arch/x86_64<br />
</nowiki><br />
<br />
== Add your own repository to this list ==<br />
If you have your own repository, please add this to this list, so that all other users knows where to find your packages.</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43164Haskell package guidelines2008-06-17T01:16:54Z<p>Dons: /* Goals */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Goals === <br />
<br />
* all [http://hackage.haskell.org hackage] packages into AUR or community. <br />
* automatic conversion of new cabal packages to AUR packages<br />
* make Arch Linux the most up to date Haskell platform around<br />
<br />
<br />
=== Search ===<br />
<br />
Basic Haskell tools:<br />
<br />
* [http://www.archlinux.org/packages/search/?arch=all&repo=all&q=haskell&limit=50 Haskell packages in the core system] -- currently just the compilers<br />
<br />
All the rest:<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go Haskell packages in AUR] -- a huge number (around 300) of packages from hackage.haskell.org<br />
<br />
Anything that's no here but on hackage can be obtained via "cabal-install", in the AUR suite.<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment ouf of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 200 binary builds of libraries and tools in Haskell are here as of June 2008.<br />
<br />
== Guidelines ==<br />
<br />
We're working on a tool to automate PKGBUILD generation.<br />
Latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
This will automate the entire process, allowing us to import the 500+ libraries on hackage, and keep them up to date.<br />
<br />
<br />
===Places to check ===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===Creating new packages with cabal2arch ===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Libraries ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
<br />
== Current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===AUR===<br />
<br />
While there's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go 200+ Haskell packages] in AUR. Note that there are 550+ packages on hackage.haskell.org, so even in AUR we're still well behind.<br />
<br />
===Haskell overlay ===<br />
<br />
A suite of binary packages and PKGBULIDs of Haskell libraries is hosted on code.haskell.org by the Arch Haskell team:<br />
<br />
http://code.haskell.org/arch/<br />
<br />
These are automatically generated via cabal2arch.<br />
<br />
====Haskell overlay with pacman ====<br />
<br />
'''TODO:''' In order to be able to use Haskell overlay as one of the repos available with pacman, we need to create a database with something like:<br />
<br />
''repo-add arch-haskell.db.tar.gz $pkg.tar.gz''<br />
<br />
so that end-users can then enable Haskell overlay by adding the following lines in ''/etc/pacman.conf'':<br />
<br />
<br />
''[arch-haskell]''<br />
<br />
''Server = http://code.haskell.org/arch/$arch''<br />
<br />
where ''$arch'' is ''i686'' or ''x86_64''.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"<br />
<br />
<br />
Using cabal-install we can get a topological sort of the installable graph of modules. You can see such an install plan [http://code.haskell.org/arch/install-plan.txt here].</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43139Haskell package guidelines2008-06-16T17:38:18Z<p>Dons: /* Libraries */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Goals === <br />
<br />
* all [http://hackage.haskell.org hackage] packages into AUR or community. <br />
* automatic conversion of new cabal packages to AUR packages<br />
* make Arch Linux the most up to date Haskell platform around<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment ouf of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 200 binary builds of libraries and tools in Haskell are here as of June 2008.<br />
<br />
== Guidelines ==<br />
<br />
We're working on a tool to automate PKGBUILD generation.<br />
Latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
This will automate the entire process, allowing us to import the 500+ libraries on hackage, and keep them up to date.<br />
<br />
<br />
===Places to check ===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===Creating new packages with cabal2arch ===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Libraries ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
<br />
== Current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===AUR===<br />
<br />
While there's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go 200+ Haskell packages] in AUR. Note that there are 550+ packages on hackage.haskell.org, so even in AUR we're still well behind.<br />
<br />
===Haskell overlay ===<br />
<br />
A suite of binary packages and PKGBULIDs of Haskell libraries is hosted on code.haskell.org by the Arch Haskell team:<br />
<br />
http://code.haskell.org/arch/<br />
<br />
These are automatically generated via cabal2arch.<br />
<br />
====Haskell overlay with pacman ====<br />
<br />
'''TODO:''' In order to be able to use Haskell overlay as one of the repos available with pacman, we need to create a database with something like:<br />
<br />
''repo-add arch-haskell.db.tar.gz $pkg.tar.gz''<br />
<br />
so that end-users can then enable Haskell overlay by adding the following lines in ''/etc/pacman.conf'':<br />
<br />
<br />
''[arch-haskell]''<br />
<br />
''Server = http://code.haskell.org/arch/$arch''<br />
<br />
where ''$arch'' is ''i686'' or ''x86_64''.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"<br />
<br />
<br />
Using cabal-install we can get a topological sort of the installable graph of modules. You can see such an install plan [http://code.haskell.org/arch/install-plan.txt here].</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43115Haskell package guidelines2008-06-16T07:42:49Z<p>Dons: /* AUR */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Goals === <br />
<br />
* all [http://hackage.haskell.org hackage] packages into AUR or community. <br />
* automatic conversion of new cabal packages to AUR packages<br />
* make Arch Linux the most up to date Haskell platform around<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment ouf of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 200 binary builds of libraries and tools in Haskell are here as of June 2008.<br />
<br />
== Guidelines ==<br />
<br />
We're working on a tool to automate PKGBUILD generation.<br />
Latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
This will automate the entire process, allowing us to import the 500+ libraries on hackage, and keep them up to date.<br />
<br />
<br />
===Places to check ===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===Creating new packages with cabal2arch ===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Libraries ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
<br />
== Current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===AUR===<br />
<br />
While there's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go 200+ Haskell packages] in AUR. Note that there are 550+ packages on hackage.haskell.org, so even in AUR we're still well behind.<br />
<br />
===Haskell overlay ===<br />
<br />
A suite of binary packages and PKGBULIDs of Haskell libraries is hosted on code.haskell.org by the Arch Haskell team:<br />
<br />
http://code.haskell.org/arch/<br />
<br />
These are automatically generated via cabal2arch.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"<br />
<br />
<br />
Using cabal-install we can get a topological sort of the installable graph of modules. You can see such an install plan [http://code.haskell.org/arch/install-plan.txt here].</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43108Haskell package guidelines2008-06-16T01:46:01Z<p>Dons: /* Community */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Goals === <br />
<br />
* all [http://hackage.haskell.org hackage] packages into AUR or community. <br />
* automatic conversion of new cabal packages to AUR packages<br />
* make Arch Linux the most up to date Haskell platform around<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment ouf of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
[http://code.haskell.org/arch code.haskell.org/arch]. Over 200 binary builds of libraries and tools in Haskell are here as of June 2008.<br />
<br />
== Guidelines ==<br />
<br />
We're working on a tool to automate PKGBUILD generation.<br />
Latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
This will automate the entire process, allowing us to import the 500+ libraries on hackage, and keep them up to date.<br />
<br />
<br />
===Places to check ===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===Creating new packages with cabal2arch ===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Libraries ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
<br />
== Current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===AUR===<br />
<br />
While there's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go 100+ packages] or so in AUR. Note that there are 550+ packages on hackage.haskell.org, so even in AUR we're still well behind.<br />
<br />
===Haskell overlay ===<br />
<br />
A suite of binary packages and PKGBULIDs of Haskell libraries is hosted on code.haskell.org by the Arch Haskell team:<br />
<br />
http://code.haskell.org/arch/<br />
<br />
These are automatically generated via cabal2arch.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"<br />
<br />
<br />
Using cabal-install we can get a topological sort of the installable graph of modules. You can see such an install plan [http://code.haskell.org/arch/install-plan.txt here].</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43107Haskell package guidelines2008-06-16T01:45:36Z<p>Dons: /* Community */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Goals === <br />
<br />
* all [http://hackage.haskell.org hackage] packages into AUR or community. <br />
* automatic conversion of new cabal packages to AUR packages<br />
* make Arch Linux the most up to date Haskell platform around<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment ouf of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
Binary packages and PKGBUILDS generated automatically, regularly from hackage.haskell.org are hosted on<br />
code.haskell.org/arch. Over 200 binary builds of libraries and tools in Haskell are here as of June 2008.<br />
<br />
== Guidelines ==<br />
<br />
We're working on a tool to automate PKGBUILD generation.<br />
Latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
This will automate the entire process, allowing us to import the 500+ libraries on hackage, and keep them up to date.<br />
<br />
<br />
===Places to check ===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===Creating new packages with cabal2arch ===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Libraries ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
<br />
== Current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===AUR===<br />
<br />
While there's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go 100+ packages] or so in AUR. Note that there are 550+ packages on hackage.haskell.org, so even in AUR we're still well behind.<br />
<br />
===Haskell overlay ===<br />
<br />
A suite of binary packages and PKGBULIDs of Haskell libraries is hosted on code.haskell.org by the Arch Haskell team:<br />
<br />
http://code.haskell.org/arch/<br />
<br />
These are automatically generated via cabal2arch.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"<br />
<br />
<br />
Using cabal-install we can get a topological sort of the installable graph of modules. You can see such an install plan [http://code.haskell.org/arch/install-plan.txt here].</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43106Haskell package guidelines2008-06-16T01:10:14Z<p>Dons: /* Haskell on Arch Linux */</p>
<hr />
<div>'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Goals === <br />
<br />
* all [http://hackage.haskell.org hackage] packages into AUR or community. <br />
* automatic conversion of new cabal packages to AUR packages<br />
* make Arch Linux the most up to date Haskell platform around<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment ouf of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
== Guidelines ==<br />
<br />
We're working on a tool to automate PKGBUILD generation.<br />
Latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
This will automate the entire process, allowing us to import the 500+ libraries on hackage, and keep them up to date.<br />
<br />
<br />
===Places to check ===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===Creating new packages with cabal2arch ===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Libraries ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
<br />
== Current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===AUR===<br />
<br />
While there's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go 100+ packages] or so in AUR. Note that there are 550+ packages on hackage.haskell.org, so even in AUR we're still well behind.<br />
<br />
===Haskell overlay ===<br />
<br />
A suite of binary packages and PKGBULIDs of Haskell libraries is hosted on code.haskell.org by the Arch Haskell team:<br />
<br />
http://code.haskell.org/arch/<br />
<br />
These are automatically generated via cabal2arch.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"<br />
<br />
<br />
Using cabal-install we can get a topological sort of the installable graph of modules. You can see such an install plan [http://code.haskell.org/arch/install-plan.txt here].</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43105Haskell package guidelines2008-06-16T01:08:53Z<p>Dons: /* Haskell on Arch Linux */</p>
<hr />
<div>= Haskell on Arch Linux =<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, and a significant percent of the hackage.haskell.org library database available via AUR. There is an active community on the #arch-haskell IRC channel working to improve the support yet further.<br />
<br />
===Goals === <br />
<br />
* all [http://hackage.haskell.org hackage] packages into AUR or community. <br />
* automatic conversion of new cabal packages to AUR packages<br />
* make Arch Linux the most up to date Haskell platform around<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment ouf of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
== Guidelines ==<br />
<br />
We're working on a tool to automate PKGBUILD generation.<br />
Latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
This will automate the entire process, allowing us to import the 500+ libraries on hackage, and keep them up to date.<br />
<br />
<br />
===Places to check ===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===Creating new packages with cabal2arch ===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Libraries ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
<br />
== Current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===AUR===<br />
<br />
While there's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go 100+ packages] or so in AUR. Note that there are 550+ packages on hackage.haskell.org, so even in AUR we're still well behind.<br />
<br />
===Haskell overlay ===<br />
<br />
A suite of binary packages and PKGBULIDs of Haskell libraries is hosted on code.haskell.org by the Arch Haskell team:<br />
<br />
http://code.haskell.org/arch/<br />
<br />
These are automatically generated via cabal2arch.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"<br />
<br />
<br />
Using cabal-install we can get a topological sort of the installable graph of modules. You can see such an install plan [http://code.haskell.org/arch/install-plan.txt here].</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43103Haskell package guidelines2008-06-15T22:36:54Z<p>Dons: /* Short term improvements */</p>
<hr />
<div>= Haskell on Arch Linux =<br />
<br />
===Goals === <br />
<br />
* all [http://hackage.haskell.org hackage] packages into AUR or community. <br />
* automatic conversion of new cabal packages to AUR packages<br />
* make Arch Linux the most up to date Haskell platform around<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). We have [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go a lot more in AUR] though. Certainly not enough for a comfortable development environment ouf of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
== Guidelines ==<br />
<br />
We're working on a tool to automate PKGBUILD generation.<br />
Latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
This will automate the entire process, allowing us to import the 500+ libraries on hackage, and keep them up to date.<br />
<br />
<br />
===Places to check ===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===Creating new packages with cabal2arch ===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Libraries ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
<br />
== Current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===AUR===<br />
<br />
While there's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go 100+ packages] or so in AUR. Note that there are 550+ packages on hackage.haskell.org, so even in AUR we're still well behind.<br />
<br />
===Haskell overlay ===<br />
<br />
A suite of binary packages and PKGBULIDs of Haskell libraries is hosted on code.haskell.org by the Arch Haskell team:<br />
<br />
http://code.haskell.org/arch/<br />
<br />
These are automatically generated via cabal2arch.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"<br />
<br />
<br />
Using cabal-install we can get a topological sort of the installable graph of modules. You can see such an install plan [http://code.haskell.org/arch/install-plan.txt here].</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43102Haskell package guidelines2008-06-15T22:34:24Z<p>Dons: /* Building all of Hackage */</p>
<hr />
<div>= Haskell on Arch Linux =<br />
<br />
===Goals === <br />
<br />
* all [http://hackage.haskell.org hackage] packages into AUR or community. <br />
* automatic conversion of new cabal packages to AUR packages<br />
* make Arch Linux the most up to date Haskell platform around<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). Certainly not enough for a comfortable development environment ouf of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
== Guidelines ==<br />
<br />
We're working on a tool to automate PKGBUILD generation.<br />
Latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
This will automate the entire process, allowing us to import the 500+ libraries on hackage, and keep them up to date.<br />
<br />
<br />
===Places to check ===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===Creating new packages with cabal2arch ===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Libraries ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
<br />
== Current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===AUR===<br />
<br />
While there's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go 100+ packages] or so in AUR. Note that there are 550+ packages on hackage.haskell.org, so even in AUR we're still well behind.<br />
<br />
===Haskell overlay ===<br />
<br />
A suite of binary packages and PKGBULIDs of Haskell libraries is hosted on code.haskell.org by the Arch Haskell team:<br />
<br />
http://code.haskell.org/arch/<br />
<br />
These are automatically generated via cabal2arch.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them. Before you start it is worthwhile removing all haskell packages, and reinstalling them. And then editing your unpacked haskell package directory to remove base libraries -- you probably don't want to install them.<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"<br />
<br />
<br />
Using cabal-install we can get a topological sort of the installable graph of modules. You can see such an install plan [http://code.haskell.org/arch/install-plan.txt here].</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43101Haskell package guidelines2008-06-15T22:33:10Z<p>Dons: /* Short term improvements */</p>
<hr />
<div>= Haskell on Arch Linux =<br />
<br />
===Goals === <br />
<br />
* all [http://hackage.haskell.org hackage] packages into AUR or community. <br />
* automatic conversion of new cabal packages to AUR packages<br />
* make Arch Linux the most up to date Haskell platform around<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number of libraries and applications supported in extras or community (see below). Certainly not enough for a comfortable development environment ouf of the box. And this despite there being hundreds of useful libraries and tools on hackage.haskell.org<br />
<br />
So the next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
Other key libraries can be determined based on use.<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
== Guidelines ==<br />
<br />
We're working on a tool to automate PKGBUILD generation.<br />
Latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
This will automate the entire process, allowing us to import the 500+ libraries on hackage, and keep them up to date.<br />
<br />
<br />
===Places to check ===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===Creating new packages with cabal2arch ===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Libraries ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
<br />
== Current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===AUR===<br />
<br />
While there's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go 100+ packages] or so in AUR. Note that there are 550+ packages on hackage.haskell.org, so even in AUR we're still well behind.<br />
<br />
===Haskell overlay ===<br />
<br />
A suite of binary packages and PKGBULIDs of Haskell libraries is hosted on code.haskell.org by the Arch Haskell team:<br />
<br />
http://code.haskell.org/arch/<br />
<br />
These are automatically generated via cabal2arch.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them:<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"<br />
<br />
<br />
Using cabal-install we can get a topological sort of the installable graph of modules. You can see such an install plan [http://code.haskell.org/arch/install-plan.txt here].</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43100Haskell package guidelines2008-06-15T21:39:35Z<p>Dons: /* Creating new packages with cabal2arch */</p>
<hr />
<div>= Haskell on Arch Linux =<br />
<br />
===Goals === <br />
<br />
* all [http://hackage.haskell.org hackage] packages into AUR or community. <br />
* automatic conversion of new cabal packages to AUR packages<br />
* make Arch Linux the most up to date Haskell platform around<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number<br />
of libraries and applications supported in extras or community (see below).<br />
<br />
The next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
== Guidelines ==<br />
<br />
We're working on a tool to automate PKGBUILD generation.<br />
Latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
This will automate the entire process, allowing us to import the 500+ libraries on hackage, and keep them up to date.<br />
<br />
<br />
===Places to check ===<br />
<br />
When seeking to package a new library, probably the best thing to do is <br />
check if there already exists a PKGBUILD for it on code.haskell.org/arch<br />
<br />
Most things on hackage.haskell.org that are packageable, are already there.<br />
<br />
If not, download and build cabal2arch, as below, and use that to create<br />
the package. This will ensure it follows standard naming, dependency and installation conventions. Drop by #arch-haskell to let us know what is going on.<br />
<br />
===Creating new packages with cabal2arch ===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Libraries ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
<br />
== Current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===AUR===<br />
<br />
While there's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go 100+ packages] or so in AUR. Note that there are 550+ packages on hackage.haskell.org, so even in AUR we're still well behind.<br />
<br />
===Haskell overlay ===<br />
<br />
A suite of binary packages and PKGBULIDs of Haskell libraries is hosted on code.haskell.org by the Arch Haskell team:<br />
<br />
http://code.haskell.org/arch/<br />
<br />
These are automatically generated via cabal2arch.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them:<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"<br />
<br />
<br />
Using cabal-install we can get a topological sort of the installable graph of modules. You can see such an install plan [http://code.haskell.org/arch/install-plan.txt here].</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43094Haskell package guidelines2008-06-15T20:29:11Z<p>Dons: /* Haskell on Arch Linux */</p>
<hr />
<div>= Haskell on Arch Linux =<br />
<br />
===Goals === <br />
<br />
* all [http://hackage.haskell.org hackage] packages into AUR or community. <br />
* automatic conversion of new cabal packages to AUR packages<br />
* make Arch Linux the most up to date Haskell platform around<br />
<br />
===Short term improvements ===<br />
<br />
The "out-of-the-box" haskell support is lacking at the moment in Arch, with only a small number<br />
of libraries and applications supported in extras or community (see below).<br />
<br />
The next step is to get more key applications and libraries into community:<br />
<br />
* cabal-install<br />
* haddock<br />
* cabal2arch<br />
<br />
then also:<br />
<br />
* alex<br />
* binary<br />
* gtk2hs<br />
* cairo<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
== Guidelines ==<br />
<br />
We're working on a tool to automate PKGBUILD generation.<br />
Latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
This will automate the entire process, allowing us to import the 500+ libraries on hackage, and keep them up to date.<br />
<br />
===Creating new packages with cabal2arch ===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Libraries ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
<br />
== Current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===AUR===<br />
<br />
While there's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go 100+ packages] or so in AUR. Note that there are 550+ packages on hackage.haskell.org, so even in AUR we're still well behind.<br />
<br />
===Haskell overlay ===<br />
<br />
A suite of binary packages and PKGBULIDs of Haskell libraries is hosted on code.haskell.org by the Arch Haskell team:<br />
<br />
http://code.haskell.org/arch/<br />
<br />
These are automatically generated via cabal2arch.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them:<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"<br />
<br />
<br />
Using cabal-install we can get a topological sort of the installable graph of modules. You can see such an install plan [http://code.haskell.org/arch/install-plan.txt here].</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43093Haskell package guidelines2008-06-15T20:27:22Z<p>Dons: /* AUR */</p>
<hr />
<div>= Haskell on Arch Linux =<br />
<br />
Goals:<br />
<br />
* all [http://hackage.haskell.org hackage] packages into AUR or community. <br />
* automatic conversion of new cabal packages to AUR packages<br />
* make Arch Linux the most up to date Haskell platform around<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
== Guidelines ==<br />
<br />
We're working on a tool to automate PKGBUILD generation.<br />
Latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
This will automate the entire process, allowing us to import the 500+ libraries on hackage, and keep them up to date.<br />
<br />
===Creating new packages with cabal2arch ===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Libraries ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
<br />
== Current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===AUR===<br />
<br />
While there's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go 100+ packages] or so in AUR. Note that there are 550+ packages on hackage.haskell.org, so even in AUR we're still well behind.<br />
<br />
===Haskell overlay ===<br />
<br />
A suite of binary packages and PKGBULIDs of Haskell libraries is hosted on code.haskell.org by the Arch Haskell team:<br />
<br />
http://code.haskell.org/arch/<br />
<br />
These are automatically generated via cabal2arch.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them:<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"<br />
<br />
<br />
Using cabal-install we can get a topological sort of the installable graph of modules. You can see such an install plan [http://code.haskell.org/arch/install-plan.txt here].</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43092Haskell package guidelines2008-06-15T20:25:08Z<p>Dons: /* AUR */</p>
<hr />
<div>= Haskell on Arch Linux =<br />
<br />
Goals:<br />
<br />
* all [http://hackage.haskell.org hackage] packages into AUR or community. <br />
* automatic conversion of new cabal packages to AUR packages<br />
* make Arch Linux the most up to date Haskell platform around<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
== Guidelines ==<br />
<br />
We're working on a tool to automate PKGBUILD generation.<br />
Latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
This will automate the entire process, allowing us to import the 500+ libraries on hackage, and keep them up to date.<br />
<br />
===Creating new packages with cabal2arch ===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Libraries ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
<br />
== Current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===AUR===<br />
<br />
While there's another [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=haskell&SeB=nd&PP=100&do_Search=Go 100+ packages] or so in AUR. Note that there are 550+ packages on hackage.haskell.org, so even in AUR we're still well behind.<br />
<br />
The next step is to get more key applications and libraries into community:<br />
<br />
* haddock<br />
* alex<br />
* binary<br />
* cabal2arch<br />
<br />
* gtk2hs<br />
* cairo -- so games can be built.<br />
* wxHaskell<br />
<br />
===Haskell overlay ===<br />
<br />
A suite of binary packages and PKGBULIDs of Haskell libraries is hosted on code.haskell.org by the Arch Haskell team:<br />
<br />
http://code.haskell.org/arch/<br />
<br />
These are automatically generated via cabal2arch.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them:<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"<br />
<br />
<br />
Using cabal-install we can get a topological sort of the installable graph of modules. You can see such an install plan [http://code.haskell.org/arch/install-plan.txt here].</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43091Haskell package guidelines2008-06-15T20:22:41Z<p>Dons: Document current state</p>
<hr />
<div>= Haskell on Arch Linux =<br />
<br />
Goals:<br />
<br />
* all [http://hackage.haskell.org hackage] packages into AUR or community. <br />
* automatic conversion of new cabal packages to AUR packages<br />
* make Arch Linux the most up to date Haskell platform around<br />
<br />
== Community ==<br />
<br />
#arch-haskell on freenode.<br />
<br />
== Guidelines ==<br />
<br />
We're working on a tool to automate PKGBUILD generation.<br />
Latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
This will automate the entire process, allowing us to import the 500+ libraries on hackage, and keep them up to date.<br />
<br />
===Creating new packages with cabal2arch ===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
===Libraries ===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
===Executables ===<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
<br />
== Current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===AUR===<br />
<br />
While there's another 100 packages or so in AUR.<br />
<br />
The next step is to get more key applications and libraries into community:<br />
<br />
* haddock<br />
* alex<br />
* binary<br />
* cabal2arch<br />
<br />
===Haskell overlay ===<br />
<br />
A suite of binary packages and PKGBULIDs of Haskell libraries is hosted on code.haskell.org by the Arch Haskell team:<br />
<br />
http://code.haskell.org/arch/<br />
<br />
These are automatically generated via cabal2arch.<br />
<br />
== Building all of Hackage ==<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them:<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"<br />
<br />
<br />
Using cabal-install we can get a topological sort of the installable graph of modules. You can see such an install plan [http://code.haskell.org/arch/install-plan.txt here].</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43090Haskell package guidelines2008-06-15T20:20:57Z<p>Dons: /* Executables */</p>
<hr />
<div>== Haskell on Arch Linux ==<br />
<br />
Goals:<br />
<br />
* all [http://hackage.haskell.org hackage] packages into AUR or community. <br />
* automatic conversion of new cabal packages to AUR packages<br />
* make Arch Linux the most up to date Haskell platform around<br />
<br />
=== Community ===<br />
<br />
#arch-haskell on freenode.<br />
<br />
=== Guidelines ===<br />
<br />
We're working on a tool to automate PKGBUILD generation.<br />
Latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
This will automate the entire process, allowing us to import the 500+ libraries on hackage, and keep them up to date.<br />
<br />
====Creating new packages with cabal2arch ====<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
====Libraries ====<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makedepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit dependencies on core Haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
====Executables ====<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
<br />
== Current state ==<br />
<br />
===Extras ===<br />
<br />
In [extra] we have some of the core infrastructure:<br />
<br />
* extra/ghc 6.8.2-1.1<br />
* extra/happy 1.17-1<br />
* extra/hugs98 200609-1<br />
* extra/darcs 2.0.0-1<br />
<br />
===Community ===<br />
<br />
Community has some a couple of applications:<br />
<br />
* community/haskell-x11 1.4.2-1<br />
* community/haxml 1.13.2-2<br />
* community/pandoc 0.46-1<br />
* community/xmonad 0.7-1<br />
<br />
===AUR===<br />
<br />
While there's another 100 packages or so in AUR.<br />
<br />
The next step is to get more key applications and libraries into community:<br />
<br />
* haddock<br />
* alex<br />
* binary<br />
* cabal2arch<br />
<br />
===Haskell overlay ===<br />
<br />
On code.haskell.org/arch are hosted our own repository of binary packages.<br />
<br />
=== Building all of Hackage ===<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them:<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"<br />
<br />
<br />
Using cabal-install we can get a topological sort of the installable graph of modules. You can see such an install plan [http://code.haskell.org/arch/install-plan.txt here]. <br />
<br />
=== The Haskell Overlay ===<br />
<br />
A suite of binary packages and PKGBULIDs of Haskell libraries is hosted on code.haskell.org by the Arch Haskell team:<br />
<br />
http://code.haskell.org/arch/<br />
<br />
These are automatically generated via cabal2arch.</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43002Haskell package guidelines2008-06-13T23:57:59Z<p>Dons: /* Building all of Hackage */</p>
<hr />
<div>== Haskell on Arch Linux ==<br />
<br />
Goals:<br />
<br />
* all [http://hackage.haskell.org hackage] packages into AUR or community. <br />
* automatic conversion of new cabal packages to AUR packages<br />
* make Arch Linux the most up to date Haskell platform around<br />
<br />
=== Community ===<br />
<br />
#arch-haskell on freenode.<br />
<br />
=== Guidelines ===<br />
<br />
We're working on a tool to automate PKGBUILD generation.<br />
Latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
This will automate the entire process, allowing us to import the 500+ libraries on hackage, and keep them up to date.<br />
<br />
====Creating new packages with cabal2arch ====<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ makepkg -i<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
====Libraries ====<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makdepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit deps on core haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
====Executables ====<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
=== Building all of Hackage ===<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them:<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"<br />
<br />
<br />
Using cabal-install we can get a topological sort of the installable graph of modules. You can see such an install plan [http://code.haskell.org/arch/install-plan.txt here]. <br />
<br />
=== The Haskell Overlay ===<br />
<br />
A suite of binary packages and PKGBULIDs of Haskell libraries is hosted on code.haskell.org by the Arch Haskell team:<br />
<br />
http://code.haskell.org/arch/<br />
<br />
These are automatically generated via cabal2arch.</div>Donshttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=43000Haskell package guidelines2008-06-13T22:27:18Z<p>Dons: /* Executables */</p>
<hr />
<div>== Haskell on Arch Linux ==<br />
<br />
Goals:<br />
<br />
* all [http://hackage.haskell.org hackage] packages into AUR or community. <br />
* automatic conversion of new cabal packages to AUR packages<br />
* make Arch Linux the most up to date Haskell platform around<br />
<br />
=== Community ===<br />
<br />
#arch-haskell on freenode.<br />
<br />
=== Guidelines ===<br />
<br />
We're working on a tool to automate PKGBUILD generation.<br />
Latest version of cabal2arch is here,<br />
<br />
* http://aur.archlinux.org/packages.php?ID=17471<br />
<br />
Development version:<br />
<br />
* darcs get http://code.haskell.org/~dons/code/cabal2arch<br />
<br />
Or:<br />
<br />
* cabal install cabal2arch<br />
<br />
This will automate the entire process, allowing us to import the 500+ libraries on hackage, and keep them up to date.<br />
<br />
====Creating new packages with cabal2arch ====<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a<br />
new package for the delimited continuations library, CC-delcont:<br />
<br />
First, 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<br />
as an argument to cabal2arch:<br />
<br />
$ cd /tmp<br />
$ cabal2arch http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont.cabal<br />
Using /tmp/tmp.Ig0H8jCOyO/CC-delcont.cabal<br />
Fetching http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz<br />
Created /tmp/haskell-cc-delcont.tar.gz<br />
<br />
Checking what was created:<br />
<br />
$ ls<br />
haskell-cc-delcont haskell-cc-delcont.tar.gz<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
# Contributor: Don Stewart <dons@galois.com><br />
# Package generated by cabal2arch 0.2.1.1<br />
pkgname=haskell-cc-delcont<br />
pkgrel=1<br />
pkgver=0.2<br />
pkgdesc="Delimited continuations and dynamically scoped variables"<br />
url="http://code.haskell.org/~dolio/CC-delcont"<br />
license=('custom:OtherLicense')<br />
arch=('i686' 'x86_64')<br />
makedepends=('ghc')<br />
source=(http://hackage.haskell.org/packages/archive/CC-delcont/0.2/CC-delcont-0.2.tar.gz)<br />
install=haskell-cc-delcont.install<br />
md5sums=('e52149fca9bf76330a7c159917152790')<br />
build() {<br />
cd $startdir/src/CC-delcont-0.2<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* libraries are prefixed with "haskell-"<br />
* core libraries are not included as explicit dependencies, since ghc provides them<br />
* since haskell libraries are statically linked, the package only has makedepends requirements<br />
* it uses cabal to generate a post-install register/unregister script, with a standard name<br />
<br />
All Haskell libraries should follow these naming conventions, and using the cabal2arch tool<br />
will ensure this is the case.<br />
<br />
Inspect the bundle, and confirm you can build and install it:<br />
<br />
$ makepkg -s<br />
$ sudo pacman -A haskell-cc-delcont-0.2-1-x86_64.pkg.tar.gz<br />
<br />
And we're ready to go. Now your .tar.gz is ready to upload to AUR.<br />
<br />
====Libraries ====<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all haskell dependencies are statically linked, so can go in the makdepends field.<br />
* all libraries have a dependency on 'ghc'<br />
* libraries don't need to have explicit deps on core haskell packages -- these come in the 'ghc' package. (e.g. array, base, containers, random, process etc).<br />
* we want to resolve dependencies with a fixed constraint to base>=3.0<br />
* be careful about dependencies on the libraries provided by the basic 'ghc' package, which include:<br />
<br />
ALUT-2.1.0.0 cgi-3001.1.5.1 network-2.1.0.0 regex-base-0.72.0.1<br />
Cabal-1.2.3.0 containers-0.1.0.1 old-locale-1.0.0.0 regex-compat-0.71.0.1<br />
GLUT-2.1.1.1 directory-1.0.0.0 old-time-1.0.0.0 regex-posix-0.72.0.2<br />
HUnit-1.2.0.0 fgl-5.4.1.1 packedstring-0.1.0.0 stm-2.1.1.0<br />
OpenAL-1.3.1.1 filepath-1.1.0.0 parallel-1.0.0.0 template-haskell-2.2.0.0<br />
OpenGL-2.2.1.1 haskell-src-1.0.1.1 parsec-2.1.0.0 time-1.1.2.0<br />
QuickCheck-1.1.0.0 haskell98-1.0.1.0 pretty-1.0.0.0 unix-2.3.0.0<br />
array-0.1.0.0 hpc-0.5.0.0 process-1.0.0.0 xhtml-3000.0.2.1<br />
base-3.0.1.0 html-1.0.1.1 random-1.0.0.0<br />
bytestring-0.9.0.1 mtl-1.1.0.0 readline-1.0.1.0<br />
<br />
These libraries don't need explicit dependencies to be set.<br />
<br />
Registering Haskell libraries is done via a register hook:<br />
<br />
<br />
build() {<br />
cd $startdir/src/cabal2arch-0.1<br />
runhaskell Setup configure --prefix=/usr || return 1<br />
runhaskell Setup build || return 1<br />
-- generate register scripts<br />
runhaskell Setup register --gen-script || return 1<br />
runhaskell Setup unregister --gen-script || return 1<br />
install -D -m744 register.sh $startdir/pkg/usr/share/haskell/$pkgname/register.sh<br />
install -m744 unregister.sh $startdir/pkg/usr/share/haskell/$pkgname/unregister.sh<br />
runhaskell Setup copy --destdir=$startdir/pkg || return 1<br />
-- usual Haskell BSD3 license isnt' official<br />
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1<br />
}<br />
<br />
<br />
<br />
* Examples:<br />
haskell-zlib, haskell-mersenne-random<br />
<br />
====Executables ====<br />
<br />
* Have their normal name. Examples:<br />
hmp3, xmonad, ghc, cabal-install<br />
<br />
=== Building all of Hackage ===<br />
<br />
The following simple script, with cabal-install and cabal2arch installed,<br />
will do a simple run over all the Haskell packages on haskell.org, <br />
creating arch packages for them:<br />
<br />
<br />
#!/bin/sh<br />
cabal update<br />
tmpdir=`mktemp -d`<br />
finaldir=`mktemp -d`<br />
cd $tmpdir<br />
tar xzf $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz<br />
for dir in * ; do <br />
if [ ! -d $dir ] ; then<br />
continue<br />
fi<br />
cd $dir<br />
lib=`ls --color=never -1 | tail -1`<br />
echo "************** Building package for $dir-$lib"<br />
cd $lib<br />
cabal2arch *.cabal > $dir.log 2>&1<br />
cd `find . -type d -a ! -name '.'`<br />
if makepkg -sm > ../$dir.log 2>&1 ; then<br />
echo "OK: " $dir-$lib<br />
cp *.pkg.tar.gz $finaldir/<br />
sudo pacman -A *.pkg.tar.gz<br />
rm *.pkg.tar.gz<br />
rm -rf pkg src *.tar.gz<br />
cd ..<br />
cp -R `find . -type d -a ! -name '.'` $finaldir/<br />
cp *.tar.gz $finaldir/<br />
else<br />
echo "Failed"<br />
fi<br />
cd $tmpdir<br />
done<br />
echo `ls $finaldir/*pkg* | wc -l` "build packages in $finaldir"<br />
echo "Now: scp -r $finaldir/* code.haskell.org:/srv/code/arch/$MACHTYPE/"<br />
<br />
<br />
Currently we don't do a topological sort of the dependencies, though we should, in order to construct a build plan that builds everything in order.</div>Dons