https://wiki.archlinux.org/api.php?action=feedcontributions&user=Deteego&feedformat=atomArchWiki - User contributions [en]2024-03-19T08:30:43ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=120287Haskell package guidelines2010-10-30T05:01:33Z<p>Deteego: </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/"<br />
<br />
== Automatic local building of Hackage Packages with cabal2arch using Bauerbill ==<br />
Although there are a number of haskell packages on AUR, there will always be outdated packages on AUR. If this happens and you want to create a fully updated package you would normally use cabal2arch. This however can become painful/time consuming if you have numerous packages with different dependencies (some of which may/may not be updated). Instead you can automatic this process by using [[Bauerbill]] which has the --hackage flag, allowing you to create AUR packages from Hackage locally. Below is an example of some common commands<br />
<br />
bauerbill -S --hackage [pkgs] : build [pkgs] directly from Hackage*<br />
bauerbill -Si --hackage [pkgs] : look up information about [pkgs]<br />
bauerbill -Ss --hackage [args] : search for [args]<br />
bauerbill -Qu --hackage : list upgradable Hackage packages<br />
<br />
Syncing packages with the --hackage flag will interactively download all dependencies of the package from Hackage, convert them using cabal2arch and then build/install them (while checking dependencies). You can combine this with the --aur flag to give precedence to Hackage packages that are on AUR</div>Deteegohttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=115221Haskell package guidelines2010-08-25T08:04:52Z<p>Deteego: Information on using Bauerbill with Hackage</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/"<br />
<br />
== Automatic local building of Hackage Packages with cabal2arch using Bauerbill ==<br />
Although there are a number of haskell packages on AUR, there will always be outdated packages on AUR. If this happens and you want to create a fully updated package you would normally use cabal2arch. This however can become painful/time confusing if you have numerous packages with different dependencies (some of which may/may not be updated). Instead you can automatic this process by using [[Bauerbill]] which has the --hackage flag, allowing you to create AUR packages from Hackage locally. Below is an example of some common commands<br />
<br />
bauerbill -S --hackage [pkgs] : build [pkgs] directly from Hackage*<br />
bauerbill -Si --hackage [pkgs] : look up information about [pkgs]<br />
bauerbill -Ss --hackage [args] : search for [args]<br />
bauerbill -Qu --hackage : list upgradable Hackage packages<br />
<br />
Syncing packages with the --hackage flag will interactively download all dependencies of the package from Hackage, convert them using cabal2arch and then build/install them (while checking dependencies). You can combine this with the --aur flag to give precedence to Hackage packages that are on AUR</div>Deteego