archrelease: copy trunk to community-any
[ArchLinux/community.git] / haskell-lsp0-test / trunk / PKGBUILD
blob10bad34a047b7013b8222ce17b84e2172ec234ee
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 _hkgname=lsp-test
4 pkgname=haskell-lsp0-test
5 pkgver=0.11.0.7
6 pkgrel=166
7 pkgdesc="Functional test framework for LSP servers (Legacy 0.x version)"
8 url="https://github.com/bubba/lsp-test#readme"
9 license=("BSD")
10 arch=('x86_64')
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')
20 prepare() {
21   cd $_hkgname-$pkgver
22   gen-setup
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
31 build() {
32   cd $_hkgname-$pkgver    
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 \
39     --ghc-option='-pie' \
40     -fdummyserver
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
49 check() {
50   cd $_hkgname-$pkgver
51   runhaskell Setup test --show-details=direct
54 package() {
55   cd $_hkgname-$pkgver
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
63   # Remove dummy-server
64   rm -r "$pkgdir"/usr/libexec