summaryrefslogtreecommitdiff
path: root/repo/pandoc/pandoc.xibuild
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-10-22 16:29:29 +0100
committerdavidovski <david@davidovski.xyz>2022-10-22 16:29:29 +0100
commitf99268f797c120a24030a573ef22813cd018beb5 (patch)
treeee18857a5eda7bc94286e3924dc2209aea7b92c4 /repo/pandoc/pandoc.xibuild
parent95545d88b997a17ff03bb164af33c33e2a12d693 (diff)
Added unrar
Diffstat (limited to 'repo/pandoc/pandoc.xibuild')
-rw-r--r--repo/pandoc/pandoc.xibuild65
1 files changed, 65 insertions, 0 deletions
diff --git a/repo/pandoc/pandoc.xibuild b/repo/pandoc/pandoc.xibuild
new file mode 100644
index 0000000..12d2406
--- /dev/null
+++ b/repo/pandoc/pandoc.xibuild
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+NAME="pandoc"
+DESC="universal markup converter"
+
+MAKEDEPS=" ghc cabal zlib libffi"
+
+PKG_VER=2.19.1
+SOURCE="https://hackage.haskell.org/package/pandoc-$PKG_VER/pandoc-$PKG_VER.tar.gz"
+
+ADDITIONAL="
+cabal.config
+"
+
+cabal_update() {
+ echo "Freezing pandoc dependencies"
+
+ # Resolve deps and generate fresh cabal.config with version constraints.
+ cabal update
+ (
+ cd "$BUILD_ROOT"
+ cabal v1-freeze --shadow-installed-packages
+
+ # Add version tag at the first line.
+ sed -i "1i--$PKG_VER" "cabal.config"
+
+ mv "cabal.config" "$startdir/"
+ )
+}
+
+prepare() {
+ apply_patches
+
+ if [ "$(head -n 1 "$BUILD_ROOT/cabal.config")" != "--$PKG_VER" ]; then
+ die "Requirements file is outdated, run 'abuild cabal_update'"
+ fi
+
+ ln -sf "$BUILD_ROOT/cabal.config" "$BUILD_ROOT/cabal.project.freeze"
+}
+
+build() {
+ cabal update
+ cabal install --only-dependencies
+ cabal configure \
+ --prefix='/usr' \
+ --enable-tests \
+ --enable-split-sections \
+ --ghc-option="-split-sections" \
+ --flags="+embed_data_files -trypandoc +static"
+ cabal build --jobs=${JOBS:-1}
+}
+
+check() {
+ cabal test --jobs=${JOBS:-1}
+}
+
+package() {
+ _bindir="$PKG_DEST/usr/bin"
+ mkdir -p "$_bindir"
+ cabal install \
+ --installdir="$_bindir" \
+ --install-method=copy
+ install -Dm644 man/pandoc.1 "$PKG_DEST"/usr/share/man/man1/pandoc.1
+}
+