From a53c3486f08bdbbd5390149e57112d9a1976b82b Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Wed, 16 Feb 2022 19:54:51 -0500 Subject: [PATCH] pandoc: add pandoc-crossref filter, move filters to subpkgs --- srcpkgs/pandoc-crossref | 1 + srcpkgs/pandoc-sidenote | 1 + srcpkgs/pandoc/template | 60 ++++++++++++++++++++++++++++++++++------- 3 files changed, 52 insertions(+), 10 deletions(-) create mode 120000 srcpkgs/pandoc-crossref create mode 120000 srcpkgs/pandoc-sidenote diff --git a/srcpkgs/pandoc-crossref b/srcpkgs/pandoc-crossref new file mode 120000 index 00000000000..53ab49c268d --- /dev/null +++ b/srcpkgs/pandoc-crossref @@ -0,0 +1 @@ +pandoc \ No newline at end of file diff --git a/srcpkgs/pandoc-sidenote b/srcpkgs/pandoc-sidenote new file mode 120000 index 00000000000..53ab49c268d --- /dev/null +++ b/srcpkgs/pandoc-sidenote @@ -0,0 +1 @@ +pandoc \ No newline at end of file diff --git a/srcpkgs/pandoc/template b/srcpkgs/pandoc/template index d84e94c7b93..0e487510497 100644 --- a/srcpkgs/pandoc/template +++ b/srcpkgs/pandoc/template @@ -2,9 +2,11 @@ pkgname=pandoc # Keep in sync with http://www.stackage.org/lts version=2.14.0.3 -revision=1 -_sidenote_version=0.20.0 +revision=2 +_sidenote_version=0.20.0.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-18.5" @@ -15,26 +17,64 @@ hostmakedepends="pkg-config unzip wget" makedepends="zlib-devel lua53-devel tar" short_desc="Universal converter between markup formats" maintainer="slotThe " -license="GPL-2.0-or-later, BSD-3-Clause, MIT" +license="GPL-2.0-or-later, BSD-3-Clause" homepage="http://johnmacfarlane.net/pandoc/" -distfiles="http://hackage.haskell.org/package/${pkgname}-${version}/${pkgname}-${version}.tar.gz - https://github.com/jez/${pkgname}-sidenote/archive/${_sidenote_version}.tar.gz \ +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" checksum="82e3f55bff3059bf30cf532e93d9876c9e3599aa4eafae9c907fe75a4430eddd - 34ee7f46d6472c04884b1dcb030d701a32b885d9b0d4307d2c0da327a359cb7a + 91f8e96d8470722d677d31d4bbf16c2ac6902567d818ed7a2715bad2617a4cdb be8485023fce236b5b915f2f6074f7b0470a2040f84cdd137c5227f1b4c98465" +subpackages="pandoc-sidenote" nocross=yes nopie_files=" /usr/bin/pandoc - /usr/bin/pandoc-sidenote -" + /usr/bin/pandoc-sidenote" + +# pandoc-crossref is currently broken on musl. See lierdakil/pandoc-crossref#342 and commercialhaskell/stack#5683 +if [ "$XBPS_TARGET_LIBC" != "musl" ]; then + distfiles+=" + 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+=" + 94540325c9c98ae4d5199c634bf402ffa41e3c5b020d7207daef90fd9e224fb4 + b9c7195b69b1662a286d2c28a55fafdcb693c522ba5eb54a11b1d0a4e92eaa81" + nopie_files+=" + /usr/bin/pandoc-crossref" + subpackages+=" + pandoc-crossref" +fi post_extract() { sed -i 's/tasty .*,/tasty,/' pandoc-*/pandoc.cabal sed -i 's/zip-archive .*,/zip-archive,/' pandoc-*/pandoc.cabal } + post_install() { vman pandoc-${version}/man/pandoc.1 - vlicense pandoc-${version}/COPYRIGHT LICENSE.pandoc - vlicense pandoc-sidenote-${_sidenote_version}/LICENSE LICENSE.pandoc-sidenote + 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 + } }