summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5b77d6bb35e31426a055095217e2d590837d73b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Maintainer: Aseem Athale <athaleaseem@gmail.com>

_pkgname=pdf2docx
pkgname=python-${_pkgname}-git
pkgver=0.5.6.r7.g288cae8
pkgrel=3
pkgdesc="A Python library for converting pdf to docx"
arch=('any')
url="https://github.com/dothinking/${_pkgname}"
license=('GPL')
depends=('python' 'python-pymupdf' 'python-docx' 'python-fonttools' 'python-numpy' 'python-opencv' 'python-fire')
makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel' 'python-pip' 'git')
source=("git+${url}.git")
sha512sums=('SKIP')

pkgver() {
  cd "${_pkgname}"
  git describe --long --tags --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "${_pkgname}"
  git -C "${srcdir}/${_pkgname}" clean -dfx
}

build() {
  cd "${_pkgname}"
  python -m build --wheel --no-isolation
}

package() {
  cd "${_pkgname}"
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}