PKGBUILDs/community/haskell-cryptonite/PKGBUILD
2016-06-12 23:15:02 +00:00

57 lines
2.3 KiB
Bash

# $Id$
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Arch Haskell Team <arch-haskell@haskell.org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - patch to not build rdrand on ARM
_hkgname=cryptonite
pkgname=haskell-cryptonite
pkgver=0.16
pkgrel=1
pkgdesc="Cryptography Primitives sink"
url="https://github.com/vincenthz/cryptonite"
license=("custom:BSD3")
arch=('i686' 'x86_64')
depends=("ghc=8.0.1" "haskell-memory")
source=("http://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz"
i686.patch
0001-Added-x86_64-constraint-for-rdrand.patch)
sha256sums=('5c3bf190954986ea4af466914eb7a0c55a0b4c1c66552d00341277c89082511a'
'0bd68b7fd7caa859ca9a5dd7343c45c0dfd22c0c5cd55dec626de2dd9804abec'
'fe2216d680fda5920758b796660c4aac00994ae146bc37a013def8c1ccc456cf')
prepare() {
cd $_hkgname-$pkgver
# https://github.com/haskell-crypto/cryptonite/issues/88
patch -p1 -i ../i686.patch
patch -p1 -i ../0001-Added-x86_64-constraint-for-rdrand.patch
}
build() {
cd "${srcdir}/${_hkgname}-${pkgver}"
runhaskell Setup configure -O --enable-library-profiling --enable-shared \
--prefix=/usr --docdir="/usr/share/doc/${pkgname}" \
--libsubdir=\$compiler/site-local/\$pkgid \
-fsupport_deepseq -finteger-gmp -f-support_pclmuldq -fsupport_rdrand -fsupport_aesni -f-old_toolchain_inliner
runhaskell Setup build
runhaskell Setup haddock --hoogle --html
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
}
package() {
cd "${srcdir}/${_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"
install -d -m755 "${pkgdir}/usr/share/doc/ghc/html/libraries"
ln -s "/usr/share/doc/${pkgname}/html" "${pkgdir}/usr/share/doc/ghc/html/libraries/${_hkgname}"
runhaskell Setup copy --destdir="${pkgdir}"
install -D -m644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
rm -f "${pkgdir}/usr/share/doc/${pkgname}/LICENSE"
}