summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorWorMzy Tykashi2017-12-05 15:47:16 +0000
committerWorMzy Tykashi2017-12-05 15:47:16 +0000
commita9b93ba2e8a49395150111303d46d9fdd0410965 (patch)
tree0a492a6d03d7ee4991a71234f3c3274882f16ab5
parent76cdc10c92f64fd2ad6058ad6e253b747bca15f3 (diff)
downloadaur-a9b93ba2e8a49395150111303d46d9fdd0410965.tar.gz
Fix for pandoc 2.0
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD15
-rw-r--r--pandoc-2.0-fix.patch95
3 files changed, 110 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3463375928c0..608d3d293997 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = vimpager-git
pkgdesc = A vim-based script to use as a PAGER - git checkout
- pkgver = 2.06.r337.ga7d18ce
+ pkgver = 2.06.r349.g897a467
pkgrel = 1
url = https://github.com/rkitover/vimpager
arch = any
@@ -12,7 +12,9 @@ pkgbase = vimpager-git
conflicts = vimpager
backup = etc/vimpagerrc
source = git+https://github.com/rkitover/vimpager.git
+ source = pandoc-2.0-fix.patch
sha256sums = SKIP
+ sha256sums = cdb1619e958a5872a1cfcb5b861720380bd5ed3102516116958b1eb17fb7dd66
pkgname = vimpager-git
diff --git a/PKGBUILD b/PKGBUILD
index ad6297a463d5..b290fabd36ad 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,7 +5,7 @@
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
pkgname=vimpager-git
-pkgver=2.06.r337.ga7d18ce
+pkgver=2.06.r349.g897a467
pkgrel=1
pkgdesc='A vim-based script to use as a PAGER - git checkout'
arch=('any')
@@ -16,8 +16,10 @@ makedepends=('git' 'pandoc')
conflicts=('vimpager')
provides=('vimpager')
backup=('etc/vimpagerrc')
-source=('git+https://github.com/rkitover/vimpager.git')
-sha256sums=('SKIP')
+source=('git+https://github.com/rkitover/vimpager.git'
+ 'pandoc-2.0-fix.patch')
+sha256sums=('SKIP'
+ 'cdb1619e958a5872a1cfcb5b861720380bd5ed3102516116958b1eb17fb7dd66')
pkgver() {
cd vimpager/
@@ -34,6 +36,13 @@ pkgver() {
fi
}
+prepare() {
+ cd vimpager/
+
+ # Fix pandoc build failure
+ patch -Np1 -i "$srcdir/pandoc-2.0-fix.patch"
+}
+
package() {
cd vimpager/
diff --git a/pandoc-2.0-fix.patch b/pandoc-2.0-fix.patch
new file mode 100644
index 000000000000..23a4e7e87fef
--- /dev/null
+++ b/pandoc-2.0-fix.patch
@@ -0,0 +1,95 @@
+From 78a1a24dd8da1a3f07e1b09a6f26e6fc32312938 Mon Sep 17 00:00:00 2001
+From: Abdo Roig-Maranges <abdo.roig@gmail.com>
+Date: Sat, 2 Dec 2017 19:23:44 +0100
+Subject: [PATCH] adapt to command-line change in pandoc 2.0
+
+pandoc 2 has removed -S from the command line. Instead we must add
++smart as an extension to the format.
+---
+ Makefile | 4 ++--
+ scripts/pandoc-sh | 11 +++++++++--
+ 2 files changed, 11 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index d4d0f71..0cfa755 100644
+--- a/Makefile
++++ b/Makefile
+@@ -263,7 +263,7 @@ man/%.1: markdown_src/%.md
+ @if command -v pandoc >/dev/null; then \
+ echo 'generating $@'; \
+ ${MKPATH} `dirname '$@'` 2>/dev/null || true; \
+- ${PANDOC} -Ss -f markdown_github $< -o $@; \
++ ${PANDOC} -s -f markdown_github $< -o $@; \
+ else \
+ if [ ! -r docs-warn-stamp ]; then \
+ echo >&2; \
+@@ -283,7 +283,7 @@ html/%.html: %.md.work
+ @if command -v pandoc >/dev/null; then \
+ echo 'generating $@'; \
+ ${MKPATH} `dirname '$@'` 2>/dev/null || true; \
+- ${PANDOC} -Ss --toc -f markdown_github $< -o $@; \
++ ${PANDOC} -s --toc -f markdown_github $< -o $@; \
+ rm -f $<; \
+ else \
+ if [ ! -r docs-warn-stamp ]; then \
+diff --git a/scripts/pandoc-sh b/scripts/pandoc-sh
+index 03cb265..7a6e8bf 100755
+--- a/scripts/pandoc-sh
++++ b/scripts/pandoc-sh
+@@ -33,13 +33,20 @@ fi
+
+ first_arg=1
+ for arg in "$@"; do
+- [ $first_arg -eq 1 ] && set -- && first_arg=0
++ if [ $first_arg -eq 1 ]; then
++ if [ $old_pandoc -eq 1 ]; then
++ set -- "-S"
++ else
++ set --
++ fi
++ first_arg=0
++ fi
+
+ if [ "$arg" = markdown_github ]; then
+ if [ $old_pandoc -eq 1 ]; then
+ set -- "$@" markdown
+ else
+- set -- "$@" markdown_github+pandoc_title_block
++ set -- "$@" markdown_github+pandoc_title_block+smart
+ fi
+ else
+ set -- "$@" "$arg"
+From 07905e4c445d963dd34f3f46caad84e1472a210c Mon Sep 17 00:00:00 2001
+From: Abdo Roig-Maranges <abdo.roig@gmail.com>
+Date: Sat, 2 Dec 2017 20:02:04 +0100
+Subject: [PATCH] pandoc feature detection was broken for new pandoc
+
+Pandoc no longer prints input formats in --help, so we cannot detect
+availability of markdown_github this way.
+
+There is a --list-input-formats command line argument, but it was
+introduced recently.
+
+So, let's check by version. markdown_github was introduced in version
+1.10.
+---
+ scripts/pandoc-sh | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/scripts/pandoc-sh b/scripts/pandoc-sh
+index 7a6e8bf..44ec603 100755
+--- a/scripts/pandoc-sh
++++ b/scripts/pandoc-sh
+@@ -27,7 +27,11 @@ title="`echo \"$title\" | \
+ # use markdown instead of markdown_github on older versions
+ # and markdown_github+pandoc_title_block on newer ones
+ old_pandoc=0
+-if ! ( pandoc --help | grep markdown_github >/dev/null ); then
++pandoc_version=$(pandoc --version | head -1 | cut -d' ' -f2)
++pandoc_major_version=${pandoc_version%%.*}
++pandoc_minor_version=${pandoc_version#*.}
++pandoc_minor_version=${pandoc_minor_version%%.*}
++if [ $pandoc_major_version -le 1 ] && [ $pandoc_minor_version -le 9 ]; then
+ old_pandoc=1
+ fi
+