void-packages/srcpkgs/pandoc/template

76 lines
2.9 KiB
Bash

# Template file for 'pandoc'
pkgname=pandoc
# Keep in sync with http://www.stackage.org/lts
version=2.17.1.1
revision=1
_sidenote_version=0.22.1.0
_monad_gen_version=0.3.0.1
_crossref_version=0.3.12.2
_roman_numerals_version=0.5.1.5
create_wrksrc=yes
build_style=haskell-stack
stackage="lts-19.0"
make_build_args="
--flag pandoc:embed_data_files
--flag=lua:pkg-config"
hostmakedepends="pkg-config unzip wget"
makedepends="zlib-devel lua53-devel tar"
short_desc="Universal converter between markup formats"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later, BSD-3-Clause"
homepage="http://johnmacfarlane.net/pandoc/"
distfiles="https://hackage.haskell.org/package/${pkgname}-${version}/${pkgname}-${version}.tar.gz
https://hackage.haskell.org/package/${pkgname}-sidenote-${_sidenote_version}/${pkgname}-sidenote-${_sidenote_version}.tar.gz
https://hackage.haskell.org/package/monad-gen-${_monad_gen_version}/monad-gen-${_monad_gen_version}.tar.gz
https://hackage.haskell.org/package/${pkgname}-crossref-${_crossref_version}/${pkgname}-crossref-${_crossref_version}.tar.gz
https://hackage.haskell.org/package/roman-numerals-${_roman_numerals_version}/roman-numerals-${_roman_numerals_version}.tar.gz"
checksum="649ec528d1413130c5ce304b826ff473b3696269eea8834d908589e775bd1ad1
c39dd7343b9cb4dc5b1c91c9e47c3d357874e9e1a30b8d377bbea0b1d50323b2
be8485023fce236b5b915f2f6074f7b0470a2040f84cdd137c5227f1b4c98465
94540325c9c98ae4d5199c634bf402ffa41e3c5b020d7207daef90fd9e224fb4
b9c7195b69b1662a286d2c28a55fafdcb693c522ba5eb54a11b1d0a4e92eaa81"
subpackages="
pandoc-sidenote
pandoc-crossref"
nocross=yes
nopie_files="
/usr/bin/pandoc
/usr/bin/pandoc-sidenote
/usr/bin/pandoc-crossref"
post_extract() {
sed -i 's/tasty .*,/tasty,/' pandoc-*/pandoc.cabal
sed -i 's/zip-archive .*,/zip-archive,/' pandoc-*/pandoc.cabal
# See https://github.com/lierdakil/pandoc-crossref/issues/342#issuecomment-1073256586
cp "${FILESDIR}/pandoc-crossref.cabal" pandoc-crossref-${_crossref_version}
}
post_install() {
vman pandoc-${version}/man/pandoc.1
vlicense pandoc-${version}/COPYRIGHT LICENSE
}
# pandoc filters should be built with pandoc to ensure compatibility and speed up compiliation
pandoc-sidenote_package() {
depends="pandoc-${version}_${revision}"
short_desc="Pandoc filter to convert Markdown-style footnotes into sidenotes"
short_desc+=" - version ${_sidenote_version}"
license="MIT"
pkg_install() {
vmove usr/bin/pandoc-sidenote
vlicense pandoc-sidenote-${_sidenote_version}/LICENSE
}
}
pandoc-crossref_package() {
depends="pandoc-${version}_${revision}"
short_desc="Pandoc filter for cross-references"
short_desc+=" - version ${_crossref_version}"
license="GPL-2.0-or-later"
pkg_install() {
vmove usr/bin/pandoc-crossref
$DESTDIR/usr/bin/pandoc -s -t man pandoc-crossref-${_crossref_version}/docs/index.md -o pandoc-crossref-${_crossref_version}/docs/pandoc-crossref.1
vman pandoc-crossref-${_crossref_version}/docs/pandoc-crossref.1
}
}