archrelease: copy trunk to community-x86_64
[ArchLinux/community.git] / pandoc-citeproc / trunk / PKGBUILD
blob8c283296ad29ae23057faa154c58181b6449cec9
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Contributor: Arch Haskell Team <arch-haskell@haskell.org>
4 pkgname=pandoc-citeproc
5 pkgver=0.17.0.2
6 pkgrel=242
7 pkgdesc="Supports using pandoc with citeproc"
8 url="https://hackage.haskell.org/package/$pkgname"
9 license=("BSD")
10 arch=('x86_64')
11 depends=('ghc-libs' 'haskell-aeson' 'haskell-aeson-pretty' 'haskell-attoparsec'
12          'haskell-base-compat' 'haskell-data-default' 'haskell-hs-bibutils' 'haskell-libyaml'
13          'haskell-network' 'haskell-old-locale' 'pandoc' 'haskell-pandoc-types' 'haskell-rfc5051'
14          'haskell-safe' 'haskell-setenv' 'haskell-split' 'haskell-syb' 'haskell-tagsoup'
15          'haskell-temporary' 'haskell-text-icu' 'haskell-unordered-containers' 'haskell-vector'
16          'haskell-xml-conduit' 'haskell-yaml' 'haskell-hsyaml' 'haskell-hsyaml-aeson')
17 conflicts=('haskell-pandoc-citeproc')
18 replaces=('haskell-pandoc-citeproc')
19 makedepends=('ghc' 'uusi')
20 source=("https://hackage.haskell.org/packages/archive/$pkgname/${pkgver}/$pkgname-${pkgver}.tar.gz")
21 sha512sums=('5ce079a542b096c06d6e4e205625a993422a972f04787495ac9013dd3131df62733f30e4c3004335e3738b02bb22a7ad50a31c1eb3f67d2b4ef51605c7fcbf16')
23 prepare() {
24     cd "${srcdir}/$pkgname-${pkgver}"
25     uusi $pkgname.cabal
26     # TODO: find a better solution
27     sed -i "s|(\"HOME\",\".\")|(\"HOME\",\".\"),(\"LD_LIBRARY_PATH\",\"$PWD/dist/build\"),(\"pandoc_citeproc_datadir\",\"$PWD\")|" tests/test-pandoc-citeproc.hs
30 build() {
31     cd "${srcdir}/$pkgname-${pkgver}"
33     runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
34         --prefix=/usr --docdir="/usr/share/doc/$pkgname" --datasubdir="$pkgname" --enable-tests \
35         --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid \
36             -f-debug -f-test_citeproc -funicode_collation -f-embed_data_files -fbibutils -f-static
37     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
44 check() {
45     cd $pkgname-$pkgver
46     # https://github.com/jgm/pandoc-citeproc/issues/342
47     runhaskell Setup test || echo "Tests failed"
50 package() {
51     cd "${srcdir}/$pkgname-${pkgver}"
53     install -D -m744 register.sh   "${pkgdir}/usr/share/haskell/register/$pkgname.sh"
54     install -D -m744 unregister.sh "${pkgdir}/usr/share/haskell/unregister/$pkgname.sh"
55     runhaskell Setup copy --destdir="${pkgdir}"
56     install -D -m644 "LICENSE" "${pkgdir}/usr/share/licenses/$pkgname/LICENSE"
57     rm -f "${pkgdir}/usr/share/doc/$pkgname/LICENSE"