upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / c2hs / trunk / PKGBUILD
blob482d6fe6f2e8bc7d745b3b9359ae9fc7d247fba3
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Contributor: Arch Haskell Team <arch-haskell@haskell.org>
4 pkgname=c2hs
5 pkgver=0.28.8
6 pkgrel=149
7 pkgdesc="C->Haskell FFI tool that gives some cross-language type safety"
8 url="https://github.com/haskell/c2hs"
9 license=("GPL2")
10 arch=('x86_64')
11 depends=('ghc-libs' 'haskell-dlist' 'haskell-language-c')
12 makedepends=('ghc' 'uusi' 'haskell-test-framework' 'haskell-test-framework-hunit' 'haskell-hunit'
13              'haskell-shelly')
14 source=("https://hackage.haskell.org/packages/archive/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.gz"
15         https://github.com/haskell/c2hs/archive/fbb4c2fa6ec5528aa068512f1b691298db420321.tar.gz)
16 sha512sums=('ff9119acecddd853f2f797385f971c249bcd92d4b141e8e7ea5f5d3e63aa257502c80ded2720a46e3186260026b94c9e518f08f8e452a64c9f888d0183ee1749'
17             '2953a07fecc95cfd5086b973a0d12b7407417f16bf73ad0f7d261e9e1884cf14b18663c15d86c8bf047dff05de70d4f01195e5d70c3225c86695fc57c8cf70e9')
19 prepare() {
20     sed -i 's/cmd "ghc"/cmd "ghc" "-dynamic"/' c2hs-$pkgver/tests/test-*.hs
21     sed -i 's/HC=ghc/HC="ghc -dynamic"/' c2hs-$pkgver/tests/system/Makefile
22     sed -i 's/"ghc", \["-/"ghc", ["-dynamic", "-/' c2hs-$pkgver/tests/test-*.hs
24     # Missing test files
25     # https://github.com/haskell/c2hs/pull/266
26     cp -r c2hs-fbb4c2fa6ec5528aa068512f1b691298db420321/tests/bugs/issue-242 c2hs-$pkgver/tests/bugs/
27     cp -r c2hs-fbb4c2fa6ec5528aa068512f1b691298db420321/tests/system/interruptible c2hs-$pkgver/tests/system/
29     uusi -u shelly c2hs-$pkgver/c2hs.cabal
32 build() {
33     cd $pkgname-$pkgver
35     runhaskell Setup configure -O --enable-executable-dynamic --prefix=/usr \
36         --docdir=/usr/share/doc/$pkgname --datasubdir=$pkgname --enable-tests \
37             -f-regression -fbase3 --ghc-option='-pie'
38     runhaskell Setup build $MAKEFLAGS
41 check() {
42     cd $pkgname-$pkgver
43     runhaskell Setup test --show-details=direct
46 package() {
47     cd "${srcdir}/${pkgname}-${pkgver}"
48     runhaskell Setup copy --destdir="${pkgdir}"