diff --git a/PKGBUILD b/PKGBUILD index edf5267..3e466d6 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -4,28 +4,41 @@ # then please put 'unknown'. # Maintainer: Future Linux Team -pkgname=python-cairo -pkgver=1.26.0 +pkgname=(python-cairo python-cairo-docs) +pkgbase=python-cairo +pkgver=1.27.0 pkgrel=1 pkgdesc="Python bindings for the cairo graphics library" arch=('x86_64') url="https://pycairo.readthedocs.io/en/latest" license=('LGPL2.1' 'MPL') depends=('python' 'cairo') -makedepends=('meson') -source=(https://github.com/pygobject/pycairo/releases/download/v${pkgver}/py${pkgname#*-}-${pkgver}.tar.gz) -sha256sums=(2dddd0a874fbddb21e14acd9b955881ee1dc6e63b9c549a192d613a907f9cbeb) +makedepends=('meson' 'python-sphinx' 'python-sphinx_rtd_theme') +source=(https://github.com/pygobject/pycairo/releases/download/v${pkgver}/py${pkgbase#*-}-${pkgver}.tar.gz) +sha256sums=(5cb21e7a00a2afcafea7f14390235be33497a2cce53a98a19389492a60628430) build() { - cd py${pkgname#*-}-${pkgver} + cd py${pkgbase#*-}-${pkgver} meson setup build --prefix=/usr --buildtype=release meson compile -C build } -package() { - cd py${pkgname#*-}-${pkgver} +package_python-cairo() { + cd py${pkgbase#*-}-${pkgver} meson install -C build --destdir ${pkgdir} + + # compile Python bytecode + python3 -m compileall -d /usr/lib64 ${pkgdir}/usr/lib64 + python3 -O -m compileall -d /usr/lib64 ${pkgdir}/usr/lib64 +} + +package_python-cairo-docs() { + pkgdesc="Developer documentation for Pycairo" + depends=() + + python3 -m sphinx -b html py${pkgbase#*-}-${pkgver}/docs ${pkgdir}/usr/share/doc/pycairo/html + rm -r ${pkgdir}/usr/share/doc/pycairo/html/.doctrees }