1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
4 pkgname=haskell-lsp0-test
7 pkgdesc="Functional test framework for LSP servers (Legacy 0.x version)"
8 url="https://github.com/bubba/lsp-test#readme"
11 depends=('ghc-libs' 'haskell-diff' 'haskell-glob' 'haskell-aeson' 'haskell-aeson-pretty'
12 'haskell-ansi-terminal' 'haskell-async' 'haskell-conduit' 'haskell-conduit-parse'
13 'haskell-data-default' 'haskell-lsp0' 'haskell-lens' 'haskell-parser-combinators'
14 'haskell-unordered-containers')
15 makedepends=('ghc' 'uusi' 'haskell-hspec')
16 # Hackage source is missing test data
17 source=("https://github.com/bubba/lsp-test/archive/refs/tags/$pkgver/$pkgname-$pkgver.tar.gz")
18 sha512sums=('bc42e9d5a31a81501b324f5c5c91d00512f85e6a1c867ca17f619565c732dacdd7a058b265819f6f045b84534450e785d88d038a91304ab9310680e46e0bf0ea')
23 uusi -u haskell-lsp $_hkgname.cabal
25 sed -i 's|dist-newstyle|dist/build/dummy-server|' test/Test.hs
27 # haskell-lsp 0.24.0.0
28 sed -i 's/"deleteThis" Nothing))/"deleteThis" Nothing)) Nothing Nothing/' test/dummy-server/Main.hs
34 # We need to enable dummy-server here for tests, but it shouldn't be installed...
35 runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
36 --prefix=/usr --docdir=/usr/share/doc/$pkgname --datasubdir=$pkgname --enable-tests \
37 --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid --ghc-option=-fllvm \
38 --ghc-option=-optl-Wl\,-z\,relro\,-z\,now \
42 runhaskell Setup build $MAKEFLAGS
43 runhaskell Setup register --gen-script
44 runhaskell Setup unregister --gen-script
45 sed -i -r -e "s|ghc-pkg.*update[^ ]* |&'--force' |" register.sh
46 sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh
51 runhaskell Setup test --show-details=direct
57 install -D -m744 register.sh "$pkgdir"/usr/share/haskell/register/$pkgname.sh
58 install -D -m744 unregister.sh "$pkgdir"/usr/share/haskell/unregister/$pkgname.sh
59 runhaskell Setup copy --destdir="$pkgdir"
60 install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
61 rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE
64 rm -r "$pkgdir"/usr/libexec