mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-01-09 10:42:12 +01:00
82 lines
2.2 KiB
Plaintext
82 lines
2.2 KiB
Plaintext
# Contributor: Jean-Louis Fuchs <jean-louis.fuchs@adfinis-sygroup.ch>
|
|
# Maintainer: Jean-Louis Fuchs <jean-louis.fuchs@adfinis-sygroup.ch>
|
|
pkgname=pandoc-cli
|
|
pkgver=0.1.1.1
|
|
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"
|
|
source="https://hackage.haskell.org/package/pandoc-cli-$pkgver/pandoc-cli-$pkgver.tar.gz
|
|
cabal.config
|
|
"
|
|
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="$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 --strong-flags --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 \
|
|
--constraint "pandoc +embed_data_files"
|
|
cabal configure \
|
|
--prefix='/usr' \
|
|
--enable-split-sections \
|
|
--ghc-option="-split-sections" \
|
|
--flags="-trypandoc +static" \
|
|
--constraint "pandoc +embed_data_files"
|
|
cabal build --jobs=${JOBS:-1}
|
|
}
|
|
|
|
package() {
|
|
_bindir="$pkgdir/usr/bin"
|
|
mkdir -p "$_bindir"
|
|
cabal install \
|
|
--installdir="$_bindir" \
|
|
--install-method=copy
|
|
ln -sfv pandoc "$pkgdir"/usr/bin/pandoc-server
|
|
}
|
|
|
|
sha512sums="
|
|
cdc3b30e6d340f8401698ee6c424410602ab37e50d1165c0a84620d323bfa9cf57bbca5c9740fe3d98025c9ce5f11a587cd97328682830a22c0c07a8d6efbb75 pandoc-cli-0.1.1.1.tar.gz
|
|
1edb18db0c778086fdeba9d328bf54e6290fa916fa78bb97c747fa43748bb21ddf31455116dddf8c2561b293f34a9a635b5c45795310b0b99c2cb1e89f1d2afd cabal.config
|
|
"
|