summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 16982a455ee911eaad8efc51371f8afe00a36cf1 (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
74
75
76
77
78
79
80
81
82
83
84
# Maintainer: Daniel Mouritzen <dmrtzn at gmail dot com>

_hkgname=implicit
pkgname=implicitcad
pkgver=0.3.0.1
pkgrel=1
pkgdesc='A math-inspired programmatic 2D & 3D CAD system based on OpenSCAD'
url="http://www.implicitcad.org/"
license=('AGPL3')
arch=('x86_64')
depends=(
  'ghc-libs'

  # library 
  'haskell-blaze-builder'
  'haskell-blaze-markup'
  'haskell-blaze-svg'
  'haskell-bytestring'
  'haskell-containers'
  'haskell-deepseq'
  'haskell-directory'
  'haskell-filepath'
  'haskell-hspec'
  'haskell-juicypixels'
  'haskell-monads-tf'
  'haskell-parallel'
  'haskell-parsec'
  'haskell-storable-endian'
  'haskell-text'
  'haskell-transformers'
  'haskell-vector-space'

  # extopenscad 
  'haskell-filepath'
  'haskell-optparse-applicative'
  'haskell-vector-space'

  # implicitsnap  
  'haskell-bytestring'
  'haskell-snap-core'
  'haskell-snap-server'
  'haskell-text'
  'haskell-vector-space'
)
makedepends=(
  'ghc'

  # Benchmark 
  'haskell-criterion'
)
source=("https://hackage.haskell.org/packages/archive/$_hkgname/$pkgver/$_hkgname-$pkgver.tar.gz")
sha256sums=('360428a3ac1870d8fc33bd535cde56499d3411404b0a10a34f125812db4804a4')

build() {
  cd "$_hkgname-$pkgver"
    
  runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
    --prefix=/usr --docdir=/usr/share/doc/$pkgname --datasubdir="$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 haddock
  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 "$_hkgname-$pkgver"
  runhaskell Setup test
}

package() {
  cd "$_hkgname-$pkgver"

  install -D -m744 register.sh "$pkgdir"/usr/share/haskell/register/$pkgname.sh
  install -D -m744 unregister.sh "$pkgdir"/usr/share/haskell/unregister/$pkgname.sh
  runhaskell Setup copy --destdir="$pkgdir" lib:implicit exe:extopenscad
  install -D -m644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  rm -f "${pkgdir}/usr/share/doc/${pkgname}/LICENSE"
}