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

_hkgname=sv2v
pkgname=haskell-sv2v
pkgver=0.0.8
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://hackage.haskell.org/packages/archive/$_hkgname/$pkgver/$_hkgname-$pkgver.tar.gz"
        "sv2v-cabal.patch"
        "at-operator.patch")
sha256sums=('fc84a770faa9357eeac56d55f861e89d2a73d71378b332096de8ddf4340674fe'
            'fd9d4dfd5537347d3ca6c3c1e5f166c7d6417acfe84541b8feb837fb043879f8'
            '6f0ab8b52a0592e42de5f07a75e16f13fa576d37c8d223e5932e9f2d8b8689f6')

prepare() {
  cd $_hkgname-$pkgver

  patch -p1 < "$srcdir/sv2v-cabal.patch"
  patch -p1 < "$srcdir/at-operator.patch"
}

build() {
  cd $_hkgname-$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 $_hkgname-$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
}