aports/community/pandoc-cli/APKBUILD
Jean-Louis Fuchs 0761fdb3e0 mailmap/email: update my email-address
update to my current git address: safe.pen2857@rhizoome.ch
2025-02-24 20:52:40 +00:00

92 lines
2.4 KiB
Plaintext

# Contributor: Jean-Louis Fuchs <safe.pen2857@rhizoome.ch>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=pandoc-cli
pkgver=3.6.3
pkgrel=1
pkgdesc="Universal markup converter"
url="https://pandoc.org/"
# limited by ghc
arch="aarch64 x86_64"
license="GPL-2.0-or-later"
makedepends="ghc cabal zlib-dev libffi-dev"
subpackages="$pkgname-doc"
source="https://hackage.haskell.org/package/pandoc-cli-$pkgver/pandoc-cli-$pkgver.tar.gz
cabal.project.freeze
"
options="net !check" # TODO
# but everyone probably used this for cli, so provide the name,
# even though renamed
provides="pandoc=$pkgver-r$pkgrel"
replaces="pandoc"
# Cabal seems to be built without sandbox, moving the cabal-dir into src
export CABAL_DIR="${CABAL_DIR:-"$srcdir/.cabal"}"
cabal_update() {
local repo="hackage.haskell.org"
# Default config uses HTTP, change it to HTTPS.
[ -f "$CABAL_DIR"/config ] || {
cabal user-config init
cabal user-config update -a \
"repository $repo {url: https://$repo/}"
}
cd "$startdir"
[ -d "$builddir" ] || abuild unpack
msg "Freezing $pkgname dependencies"
# Resolve deps and generate fresh cabal.project.freeze with version constraints.
(
cd "$builddir" || {
error 'Is $builddir set correctly?'
return 1
}
cabal v2-update
cabal v2-freeze \
--strong-flags \
--shadow-installed-packages \
--constraint "pandoc +embed_data_files" \
--flags "+server +lua"
mv -v cabal.project.freeze "$startdir"/
)
if ! abuild checksum; then
die "Failed to update checksum, run 'abuild checksum' manually"
fi
}
prepare() {
default_prepare
ln -svf "$srcdir"/cabal.project.freeze "$builddir"/
}
build() {
cabal v2-update
cabal v2-build pandoc-cli:exes \
--jobs=${JOBS:-1} \
--prefix=/usr \
--docdir=/usr/share/doc/$pkgname \
--flags "+server +lua" \
--sysconfdir=/etc
}
package() {
# See https://github.com/haskell/cabal/issues/6919#issuecomment-761563498
cabal list-bin pandoc-cli:exes |
xargs install -Dvm755 -t "$pkgdir"/usr/bin/
ln -sfv pandoc "$pkgdir"/usr/bin/pandoc-server
install -Dvm644 man/*.1 -t "$pkgdir"/usr/share/man/man1/
}
sha512sums="
32bcfa5e7d5b19c436e662044b02fa364915cfe47b8f414e0e4ccf4c509e82578a4992083b98fa440850fb76049b8681e40828c966221f67208e4cdc6140ad21 pandoc-cli-3.6.3.tar.gz
b93afeb1b7ab1de5f155dee9770daf1be35d39325ebf85542e4c327870104b97bb29b6a75e2b49248ee2e3968f1b292d1e667e8923a2d3c041f978788dc6cb03 cabal.project.freeze
"