summaryrefslogtreecommitdiff
path: root/skip/pandoc/pandoc.xibuild
diff options
context:
space:
mode:
Diffstat (limited to 'skip/pandoc/pandoc.xibuild')
-rw-r--r--skip/pandoc/pandoc.xibuild57
1 files changed, 42 insertions, 15 deletions
diff --git a/skip/pandoc/pandoc.xibuild b/skip/pandoc/pandoc.xibuild
index fd6988c..12d2406 100644
--- a/skip/pandoc/pandoc.xibuild
+++ b/skip/pandoc/pandoc.xibuild
@@ -3,36 +3,63 @@
NAME="pandoc"
DESC="universal markup converter"
-MAKEDEPS="cabal"
-DEPS="gmp libffi musl zlib "
+MAKEDEPS=" ghc cabal zlib libffi"
-PKG_VER=2.16.2
+PKG_VER=2.19.1
SOURCE="https://hackage.haskell.org/package/pandoc-$PKG_VER/pandoc-$PKG_VER.tar.gz"
-ADDITIONAL="cabal.project.freeze "
-prepare () {
- cp "$srcdir/cabal.project.freeze" .
+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" \
- --ghc-option="-j" \
- --ghc-option="-O1" \
--flags="+embed_data_files -trypandoc +static"
+ cabal build --jobs=${JOBS:-1}
}
-build () {
- cabal install --only-dependencies
- cabal build --jobs=${JOBS:-1}
+check() {
+ cabal test --jobs=${JOBS:-1}
}
-package () {
- bindir="$PKG_DEST/usr/bin"
- mkdir -p "$bindir"
+package() {
+ _bindir="$PKG_DEST/usr/bin"
+ mkdir -p "$_bindir"
cabal install \
- --installdir="$bindir" \
+ --installdir="$_bindir" \
--install-method=copy
install -Dm644 man/pandoc.1 "$PKG_DEST"/usr/share/man/man1/pandoc.1
}
+