archrelease: copy trunk to community-any
[ArchLinux/community.git] / asciidoc / trunk / PKGBUILD
blob6755d693ada0fbf4de32073d5344db510bdb264d
1 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
2 # Maintainer: Caleb Maclennan <caleb@alerque.com>
3 # Contributor: Eli Schwartz <eschwartz@archlinux.org>
4 # Contributor: Florian Pritz <flo@xinu.at>
5 # Contributor: Chris Brannon <cmbrannon79@gmail.com>
6 # Contributor: Geoffroy Carrier <geoffroy@archlinux.org>
7 # Contributor: Dan McGee <dan@archlinux.org>
8 # Contributor: Jaroslaw Rosiek <philosoph@interia.pl>
9 # Contributor: Darwin Bautista <djclue917@gmail.com>
10 # Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
12 pkgname=asciidoc
13 pkgver=10.2.0
14 pkgrel=3
15 pkgdesc='Text document format for short documents, articles, books and UNIX man pages'
16 arch=('any')
17 url='https://asciidoc.org/'
18 license=('GPL')
19 depends=('python' 'libxslt' 'docbook-xsl')
20 checkdepends=('dblatex' 'graphviz' 'lilypond' 'python-pytest'{,-mock} 'source-highlight')
21 makedepends=(python-{build,installer,wheel} python-setuptools)
22 optdepends=('graphviz: graphviz-filter'
23             'lilypond: music-filter'
24             'imagemagick: music-filter'
25             'source-highlight: source-highlight-filter'
26             'dblatex: pdf generation'
27             'fop: alternative pdf generation'
28             'w3m: text generation'
29             'lynx: alternative text generation')
30 source=("https://github.com/asciidoc-py/asciidoc-py/releases/download/$pkgver/$pkgname-$pkgver.tar.gz")
31 sha256sums=('237b2ba5c35c0ae7ccd4cd44ebf1d87c20b2695dae01798954416d492ef7fa0e')
32 b2sums=('ed5db8fd1432b255e9c03e17805c26c76a42392c2ebeaf839b8c0aaaf38cd1a36d79b645ca4474503181200924df91218eb0997dd82335a30d6a0a1b35eb5730')
34 prepare() {
35   cd ${pkgname}-${pkgver}
36   sed -i \
37     -e '/^build: /a \\tpython3 -m build -wn' \
38     -e '/pip install/{s#pip install --root#installer -d#;s#\.$#dist/*.whl#}' \
39     Makefile.in
40   # https://github.com/asciidoc-py/asciidoc-py/issues/234
41   autoconf
44 build() {
45   cd ${pkgname}-${pkgver}
46   # https://github.com/asciidoc-py/asciidoc-py/issues/234#issuecomment-1045970138
47   ./configure \
48       --docdir /usr/share/doc/$pkgname \
49       --prefix /usr
50   make build
53 check() {
54   cd ${pkgname}-${pkgver}
55   make test
58 package() {
59   cd ${pkgname}-${pkgver}
60   make DESTDIR="${pkgdir}" install
61   make DESTDIR="${pkgdir}" docs
62   install -Dm0644 -t "$pkgdir/usr/share/man/man1/" doc/*.1
63   # ascidocapi is deprecated, but still included in 10.x on a "provisional" basis
64   local _platlib="$(python -c 'import sysconfig; print(sysconfig.get_paths()["platlib"])')"
65   install -Dm0644 -t "${pkgdir}/${_platlib}/${pkgname}/" asciidoc/api.py