# Maintainer: Nicolas Reynolds # Based on haskell-pandoc # Run `makepkg -sp SRCBUILD` if you want to update the source tarball # hslua fails if LANG is empty or C test -z "$LANG" && export LANG="en_US.utf8" pkgname=pandoc-static _pkgname=pandoc pkgver=1.12.4.2 pkgrel=1 _srcrel=2 pkgdesc='Conversion between markup formats (no Haskell libs)' url='http://johnmacfarlane.net/pandoc/' license=('GPL') arch=('i686' 'x86_64' 'mips64el') # Needed for pandoc-citeproc depends=('icu>=52' 'icu<=54') makedepends=('ghc' 'sh' 'cabal-install' 'alex' 'happy') options=(strip !makeflags !distcc !emptydirs) source=(https://repo.parabolagnulinux.org/other/pandoc-static/${_pkgname}-${pkgver}-${_srcrel}-any.src.tar.xz{,.sig} SRCBUILD) replaces=('pandoc') provides=('pandoc') optdepends=('texlive-most: for pdf creation') # PKGBUILD functions build() { mkdir -p ${srcdir}/{build,${_pkgname}-${pkgver}} cd ${srcdir}/${_pkgname}-${pkgver} # pandoc-citeproc needs hsb2hs export PATH=${srcdir}/build/usr/bin:$PATH while read _hkpkg; do # Skip already built [ -d ${srcdir}/build/usr/lib/$_hkpkg ] && continue pushd ${srcdir}/${_pkgname}-${pkgver}/${_hkpkg} >/dev/null msg2 "Building $_hkpkg" case $_hkpkg in $_pkgname-$pkgver) HOME=${srcdir}/${_pkgname}-${pkgver} \ cabal configure --prefix=/usr \ --libdir=${srcdir}/build/usr/lib -v HOME=${srcdir}/${_pkgname}-${pkgver} \ cabal build HOME=${srcdir}/${_pkgname}-${pkgver} \ cabal register --inplace ;; pandoc-citeproc*) HOME=${srcdir}/${_pkgname}-${pkgver} \ cabal configure --flags='small_base embed_data_files bibutils hexpat unicode_collation' \ --libdir=${srcdir}/build/usr/lib \ --prefix=/usr -v HOME=${srcdir}/${_pkgname}-${pkgver} \ cabal build ;; *) HOME=${srcdir}/${_pkgname}-${pkgver} \ cabal install --prefix=${srcdir}/build/usr --flags="embed_data_files" ;; esac popd >/dev/null done