Wednesday, January 16, 2008

GLFW Archlinux package.

I bought SOE. And here is GLFW PKGBUILD for Archlinux:

pkgname=glfw2hs
pkgver=0.3
pkgrel=1
pkgdesc="A Haskell module for GLFW OpenGL framework. It provides an alternative to GLUT for OpenGL based Haskell programs."
url="http://haskell.org/haskellwiki/GLFW"
license=('GPL')
depends=('gcc' 'ghc' 'xorg-server')
arch=('i686')
source=("GLFW-$pkgver.tar.gz")
install=('glfw2hs.install')
md5sums=('c1cefce0573dd0237031fc3d28b4514d')
build() {
    cd "$startdir/src/GLFW-$pkgver"
    runhaskell Setup.hs configure --ghc --prefix=/usr
    runhaskell Setup.hs build || return 1
    runhaskell Setup.hs register --gen-script
    runhaskell Setup.hs unregister --gen-script
    install -D -m744 register.sh "$startdir/pkg/usr/share/haskell/$pkgname/register.sh"
    install -m744 unregister.sh "$startdir/pkg/usr/share/haskell/$pkgname/unregister.sh"
    runhaskell Setup.hs copy --destdir="$startdir/pkg"
}

This is glfw2hs.install:

HS_DIR=/usr/share/haskell/glfw2hs

post_install() {
    ${HS_DIR}/register.sh
    echo "GLFW registered"
}

pre_upgrade() {
    ${HS_DIR}/unregister.sh
}

post_upgrade() {
    ${HS_DIR}/register.sh
}

pre_remove() {
    ${HS_DIR}/unregister.sh
}
op=$1
shift

$op $*

No comments:

Post a Comment