summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c9330cad3af4d1b5aae46a6390b01ff9896dc921 (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
# This file was generated by https://github.com/berberman/arch-hs, please check it manually.
# Maintainer: Ferdinand Bachmann <theferdi265@gmail.com>

pkgname=sv2v
pkgver=0.0.11
pkgrel=1
pkgdesc="SystemVerilog to Verilog conversion"
url="https://github.com/zachjs/sv2v"
license=("custom: BSD3")
arch=('x86_64')
depends=('ghc-libs' 'haskell-cmdargs' 'haskell-githash' 'haskell-hashable' 'haskell-vector')
makedepends=('ghc' 'alex' 'happy')
source=("https://github.com/zachjs/$pkgname/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('06a5304b8b5c3cdfd9b43231d91d50f93b83c3dbf1c410e96b9e55705b8ca431')

build() {
  cd $pkgname-$pkgver

  runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
    --prefix=/usr --docdir=/usr/share/doc/$pkgname --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
  if [[ -f register.sh ]]; then sed -i -r -e "s|ghc-pkg.*update[^ ]* |&'--force' |" register.sh; fi
  if [[ -f unregister.sh ]]; then sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh; fi
}

package() {
  cd $pkgname-$pkgver

  if [[ -f register.sh ]]; then install -D -m744 register.sh "$pkgdir"/usr/share/haskell/register/$pkgname.sh; fi
  if [[ -f unregister.sh ]]; then install -D -m744 unregister.sh "$pkgdir"/usr/share/haskell/unregister/$pkgname.sh; fi
  runhaskell Setup copy --destdir="$pkgdir"
  install -D -m644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
  rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE
}