|
| 1 | +# Maintainer: Felix Yan <felixonmars@archlinux.org> |
| 2 | +# Contributor: Arch Haskell Team <arch-haskell@haskell.org> |
| 3 | + |
| 4 | +_hkgname=Agda |
| 5 | +pkgname=agda |
| 6 | +pkgver=2.6.2.2 |
| 7 | +pkgrel=17 |
| 8 | +pkgdesc="A dependently typed functional programming language and proof assistant" |
| 9 | +url="https://wiki.portal.chalmers.se/agda/" |
| 10 | +license=("custom") |
| 11 | +arch=('x86_64') |
| 12 | +depends=('ghc-libs' 'ghc' 'haskell-aeson' 'haskell-async' 'haskell-blaze-html' 'haskell-boxes' |
| 13 | + 'haskell-case-insensitive' 'haskell-cpphs' 'haskell-data-hash' 'haskell-edit-distance' |
| 14 | + 'haskell-equivalence' 'haskell-gitrev' 'haskell-hashable' 'haskell-hashtables' |
| 15 | + 'haskell-monad-control' 'haskell-murmur-hash' 'haskell-parallel' 'haskell-regex-tdfa' |
| 16 | + 'haskell-split' 'haskell-strict' 'haskell-unordered-containers' 'haskell-uri-encode' |
| 17 | + 'haskell-zlib') |
| 18 | +optdepends=('agda-stdlib: for standard library') |
| 19 | +makedepends=('alex' 'happy' 'ghc' 'haskell-filemanip') |
| 20 | +source=("https://hackage.haskell.org/packages/archive/$_hkgname/$pkgver/$_hkgname-$pkgver.tar.gz") |
| 21 | +sha512sums=('f54dcc0fd6dea106db4a04cc3b0b80f404f0613b5075849db17a1b4b5e176ed6d183bfdaf464fbcbc6e0807c1af0c8748f96552d48e537444109be54730685a8') |
| 22 | + |
| 23 | +prepare() { |
| 24 | + cd $_hkgname-$pkgver |
| 25 | + sed -i '/fno-warn-overlapping-patterns/a \ , "-dynamic"' src/full/Agda/Compiler/MAlonzo/Compiler.hs |
| 26 | +} |
| 27 | + |
| 28 | +build() { |
| 29 | + cd $_hkgname-$pkgver |
| 30 | + |
| 31 | + # -fllvm is disabled because ghc+llc hangs since LLVM 13 |
| 32 | + # https://gitlab.haskell.org/ghc/ghc/-/issues/20559 |
| 33 | + runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \ |
| 34 | + --prefix=/usr --docdir=/usr/share/doc/$pkgname --datasubdir=$pkgname \ |
| 35 | + --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid --ghc-option=-fasm \ |
| 36 | + -fcpphs -f-debug -f-enable-cluster-counting |
| 37 | + LC_CTYPE=en_US.UTF-8 runhaskell Setup build $MAKEFLAGS |
| 38 | + runhaskell Setup register --gen-script |
| 39 | + runhaskell Setup unregister --gen-script |
| 40 | + sed -i -r -e "s|ghc-pkg.*update[^ ]* |&'--force' |" register.sh |
| 41 | + sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh |
| 42 | +} |
| 43 | + |
| 44 | +package() { |
| 45 | + cd $_hkgname-$pkgver |
| 46 | + |
| 47 | + install -D -m744 register.sh "${pkgdir}/usr/share/haskell/register/${pkgname}.sh" |
| 48 | + install -D -m744 unregister.sh "${pkgdir}/usr/share/haskell/unregister/${pkgname}.sh" |
| 49 | + LD_LIBRARY_PATH="$PWD/dist/build" runhaskell Setup copy --destdir="${pkgdir}" |
| 50 | + |
| 51 | + # Symlink to avoid writing to this place when agda-lib is present |
| 52 | + install -dm755 "$pkgdir"/usr/share/agda/lib/_build/$pkgver/agda |
| 53 | + ln -s ../../../prim "$pkgdir"/usr/share/agda/lib/_build/$pkgver/agda/ |
| 54 | + |
| 55 | + install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE |
| 56 | + rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE |
| 57 | +} |
0 commit comments