summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d6d596af3d9f35518fd8f00f5cfce66e06d81094 (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
73
# Original Author: Thiago Mota <thiagomota510@gmail.com>
# Maintainer: Eshan Ramesh - https://esrh.me

pkgname=xmobar-dynamic
pkgver=0.44.2
pkgrel=1
pkgdesc='Minimalistic Text Based Status Bar'
url='https://hackage.haskell.org/package/xmobar'
license=('BSD')
arch=('x86_64')
provides=('xmobar')
conflicts=('xmobar' 'xmobar-git')
depends=('libxft' 'libxinerama' 'libxrandr' 'libxpm' 'ghc-libs' 'haskell-x11'
         'haskell-x11-xft' 'haskell-utf8-string' 'haskell-network-uri'
         'haskell-hinotify' 'haskell-parsec-numbers'
         'haskell-regex-compat' 'haskell-old-locale'
         'haskell-http' 'haskell-dbus' 'haskell-libmpd' 'haskell-cereal' 'haskell-netlink'
         'haskell-async' 'haskell-aeson'
         'haskell-timezone-olson' 'haskell-timezone-series' 'alsa-lib'
         'haskell-extensible-exceptions' 'haskell-http-conduit'
         'haskell-http-types' 'haskell-http-client-tls' 'haskell-alsa-core' 'haskell-alsa-mixer')
makedepends=('ghc' 'uusi' 'haskell-hspec' 'haskell-temporary')
source=(https://codeberg.org/xmobar/xmobar/archive/${pkgver}.tar.gz
        dynamic.patch)
sha512sums=('SKIP'
            '7a8d6f157716c41f1e0f5749b79477fb560bb36c8f0eb244f9659a4e17918fb792b81e0622be00429445186e2a3f89caaa0bbdd30d3bd52975472e64502460f5')

prepare() {
    tar -xzf 0.44.2.tar.gz
    cd xmobar
    patch -i "${srcdir}/dynamic.patch" src/Xmobar/App/Compile.hs
    uusi -u base xmobar.cabal
}

build() {
  cd xmobar

  _flags=(with_xft with_utf8 with_inotify with_mpd with_alsa with_nl80211
          with_datezone with_mpris with_dbus with_xpm with_threaded
          with_rtsopts with_weather)

  runhaskell setup configure -O \
    --enable-shared \
    --enable-executable-dynamic \
    --disable-library-vanilla \
    --prefix=/usr \
    --dynlibdir=/usr/lib \
    --libsubdir=\$compiler/site-local/\$pkgid --ghc-option=-fllvm \
    --ghc-option=-optl-Wl\,-z\,relro\,-z\,now \
    --ghc-option='-pie' \
    --flags="${_flags[*]}" \
    --enable-tests
  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
}

check() {
  cd xmobar
  runhaskell setup test
}

package() {
  cd xmobar
  install -Dm 744 register.sh   "${pkgdir}/usr/share/haskell/register/xmobar.sh"
  install -Dm 744 unregister.sh "${pkgdir}/usr/share/haskell/unregister/xmobar.sh"
  runhaskell setup copy --destdir="${pkgdir}"
  install -Dm 644 license -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et: