summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f4421b63b23defa41c6dfe06b01b83c985f1fc88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Maintainer: Sam Kirby <sam.kirby94@hotmail.co.uk>
# Contributor: Øyvind 'Mr.Elendig' Heggstad <mrelendig@har-ikkje.net>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Vesa Kaihlavirta <vegai@iki.fi>
# Contributor: shild <shildv@gmail.com>

pkgname=xmonad-git
pkgver=v0.17.0.r24.ge25d090
pkgrel=1
pkgdesc="Lightweight X11 tiled window manager written in Haskell"
arch=('x86_64')
url="http://xmonad.org/"
license=('BSD')
depends=('ghc'
         'sh'
         'gmp'
         'haskell-x11>=1.10' 'haskell-x11<1.11'
         'haskell-mtl'
         'haskell-utf8-string>=0.3' 'haskell-utf8-string<1.1'
         'haskell-extensible-exceptions'
         'haskell-setlocale')
makedepends=('gendesk' 'git')
optdepends=('xorg-xmessage: for displaying visual error messages')
conflicts=('xmonad')
provides=('xmonad')
source=('git+https://github.com/xmonad/xmonad.git'
        'dynamic-compilation.patch'
        'xmonad.svg')
md5sums=('SKIP'
         '0a67c65162c618abaf496c877c5d07b9'
         '72bfa5e62e4e44fe7fa59b6a7593d993')
options=('staticlibs')

pkgver() {
  cd "${pkgname/-git}"
  git describe --tags --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  gendesk --pkgname "${pkgname/-git}" --pkgdesc "$pkgdesc"
  cd "$srcdir"/${pkgname/-git}
  patch -p1 -i "${srcdir}/dynamic-compilation.patch"
}

build() {
  cd "$srcdir"/${pkgname/-git}
  runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
    --prefix=/usr --docdir="/usr/share/doc/${pkgname}" --datasubdir="$pkgname" \
    --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid
  runhaskell Setup build
  runhaskell Setup register --gen-script
  runhaskell Setup unregister --gen-script
  sed -i -r -e "s|ghc-pkg.*update[^ ]* |&'--force' |" register.sh
  sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh
}

package() {
  cd "$srcdir"/${pkgname/-git}

  install -Dm 744 register.sh   "${pkgdir}/usr/share/haskell/register/${pkgname/-git}.sh"
  install -Dm 744 unregister.sh "${pkgdir}/usr/share/haskell/unregister/${pkgname/-git}.sh"

  runhaskell Setup.lhs copy --destdir="${pkgdir}"

  # Requires pandoc, regex-posix, Pretty and cabal
  #runhaskell util/GenerateManpage.hs

  install -Dm 644 man/xmonad.1 -t "${pkgdir}/usr/share/man/man1"
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/xmonad"
  install -Dm 644 "$srcdir/xmonad.svg" -t "${pkgdir}/usr/share/pixmaps"
  install -Dm 644 "$srcdir/xmonad.desktop" -t "${pkgdir}/usr/share/xsessions"
}