summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 178fc6f0afc9d8f69bcfc7f43af258a59d77d79c (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
# This file was generated by https://github.com/berberman/arch-hs, please check it manually.
# Maintainer: PRESFIL <echo cHJlc2ZpbEBwcm90b25tYWlsLmNvbQo= | base64 -d>

_hkgname=xmonad-dbus
pkgname="${_hkgname}-git"
pkgver=0.1.0.2.r0.gddd5ed1 # renovate: datasource=github-tags depName=troydm/xmonad-dbus
pkgrel=2
pkgdesc="XMonad DBus monitor application and library to easily connect XMonad with Polybar"
url="https://github.com/troydm/xmonad-dbus#readme"
license=("custom: BSD3")
arch=('x86_64')
conflicts=('xmonad-dbus')
provides=('xmonad-dbus')
depends=('ghc-libs' 'haskell-dbus')
makedepends=('ghc' 'git')
source=("xmonad-dbus::git+https://github.com/troydm/xmonad-dbus.git")
sha256sums=('SKIP')

pkgver() {
  cd "${pkgname%-git}"
  ( set -o pipefail
    git describe --long --tags 2>/dev/null | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

build() {
  cd "${pkgname%-git}"

  runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
    --prefix=/usr --docdir="/usr/share/doc/${pkgname%-git}" --enable-tests \
    --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid \
    --ghc-option=-optl-Wl\,-z\,relro\,-z\,now \
    --ghc-option='-pie'

  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 "${pkgname%-git}"
  runhaskell Setup test
}

package() {
  cd "${pkgname%-git}"

  install -D -m744 register.sh "${pkgdir}/usr/share/haskell/register/${pkgname%-git}.sh"
  install -D -m744 unregister.sh "${pkgdir}/usr/share/haskell/unregister/${pkgname%-git}.sh"
  runhaskell Setup copy --destdir="${pkgdir}"
  install -D -m644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname%-git}/"
  rm -f "${pkgdir}/usr/share/doc/${pkgname%-git}/LICENSE"
}