ayaports/backports/pandoc/APKBUILD
2023-01-12 18:10:32 +00:00

82 lines
2.2 KiB
Text

# Contributor: Jean-Louis Fuchs <jean-louis.fuchs@adfinis-sygroup.ch>
# Maintainer: Jean-Louis Fuchs <jean-louis.fuchs@adfinis-sygroup.ch>
pkgname=pandoc
pkgver=2.19.2
pkgrel=0
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-$pkgver/pandoc-$pkgver.tar.gz
texmath-0.12.5.4.patch
cabal.config
"
options="net"
# Cabal seems to be built without sandbox, moving the cabal-dir into src
export CABAL_DIR="$srcdir/.cabal"
cabal_update() {
msg "Freezing $pkgname dependencies"
# Resolve deps and generate fresh cabal.config with version constraints.
cabal update
(
cd "$builddir"
cabal v1-freeze --shadow-installed-packages
# Add version tag at the first line.
sed -i "1i--$pkgver" "cabal.config"
mv "cabal.config" "$startdir/"
)
if ! abuild checksum; then
die "Failed to update checksum, run 'abuild checksum' manually"
fi
}
prepare() {
default_prepare
if [ "$(head -n 1 "$srcdir/cabal.config")" != "--$pkgver" ]; then
die "Requirements file is outdated, run 'abuild cabal_update'"
fi
ln -sf "$srcdir/cabal.config" "$builddir/cabal.project.freeze"
}
build() {
export PATH="$PATH:/usr/lib/llvm14/bin"
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="$pkgdir/usr/bin"
mkdir -p "$_bindir"
cabal install \
--installdir="$_bindir" \
--install-method=copy
install -Dm644 man/pandoc.1 "$pkgdir"/usr/share/man/man1/pandoc.1
}
sha512sums="
3628a9193d5138294bae562726bcd94567eec10fa0053d43739af04d4eba0a53bd49c2c000a5360afcac08153960a9bf2ee4be3c419cec7e5c13273e718edc80 pandoc-2.19.2.tar.gz
172f8f57c18cc08c976b3c4853be54918fab57aaead2c272685be2183de2e8db9163c26e5f4477ed5059de08b1ed100b6508b0b1ea98c0a20cb6ef9ae6eb52cd texmath-0.12.5.4.patch
02013589a1acd53ffb9ef50bf76ad31b569823f8ef382a783372d0941f462aa53830e506e5b64a1755899eb25111cc912b69628c5ef1c889aec999d4d7883b5d cabal.config
"