add python-cairo

This commit is contained in:
joborun linux 2022-06-26 21:57:41 +03:00
parent 127b90a57b
commit d82b8d851f
7 changed files with 114 additions and 0 deletions

51
python-cairo/PKGBUILD Normal file
View File

@ -0,0 +1,51 @@
#!/usr/bin/bash
# JOBoRun : Jwm OpenBox Obarun RUNit
# Maintainer : Joe Bo Run <joborun@disroot.org>
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=python-cairo
pkgver=1.21.0
pkgrel=01
pkgdesc="Python bindings for the cairo graphics library"
arch=('x86_64')
url="https://pycairo.readthedocs.io/en/latest/"
depends=(cairo python)
makedepends=(git python-setuptools)
_commit=7f7869f4139dbcc84a6f688a321516cb25cea1b0 # tags/v1.21.0
#source=(https://github.com/pygobject/pycairo/releases/download/v$pkgver/pycairo-$pkgver.tar.gz{,.sig})
source=("git+https://github.com/pygobject/pycairo/#commit=$_commit")
pkgver() {
cd pycairo
git describe --tags | sed 's/^v//;s/-/+/g'
}
build() {
cd pycairo
python setup.py build
}
#check() {
# cd pycairo-$pkgver
# python setup.py test
#}
package() {
cd pycairo
python setup.py install --skip-build --root="$pkgdir" --optimize='1'
}
#---- license gpg-key sha256sums ----
license=('LGPL2.1' 'MPL')
validpgpkeys=(0EBF782C5D53F7E5FB02A66746BD761F7A49B0EC) # 46BD761F7A49B0EC: "Christoph Reiter <reiter.christoph@gmail.com>
#sha256sums=(251907f18a552df938aa3386657ff4b5a4937dde70e11aa042bc297957f4b74b # pycairo-1.21.0.tar.gz
# 85a49d1e1fc29d3f57698bf3acafbaa2c4327dbe4de221de9b1686a83e695593) # pycairo-1.21.0.tar.gz.sig
sha256sums=('SKIP')

View File

@ -0,0 +1,32 @@
# Maintainer: Angel Velasquez <angvp@archlinux.org>
# Maintainer: Jan de Groot <jgc@archlinux.org>
pkgname=python-cairo
pkgver=1.21.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=(cairo python)
makedepends=(python-setuptools)
checkdepends=(python-pytest)
source=(https://github.com/pygobject/pycairo/releases/download/v$pkgver/pycairo-$pkgver.tar.gz{,.sig})
sha256sums=('251907f18a552df938aa3386657ff4b5a4937dde70e11aa042bc297957f4b74b'
'SKIP')
validpgpkeys=(0EBF782C5D53F7E5FB02A66746BD761F7A49B0EC) # Christoph Reiter <reiter.christoph@gmail.com>
build() {
cd pycairo-$pkgver
python setup.py build
}
check() {
cd pycairo-$pkgver
python setup.py test
}
package() {
cd pycairo-$pkgver
python setup.py install --root="$pkgdir" --skip-build --optimize=1
}

1
python-cairo/clean Normal file
View File

@ -0,0 +1 @@
rm -rf {src,pkg,*.tar.gz*,pycairo}

5
python-cairo/deps Normal file
View File

@ -0,0 +1,5 @@
cairo
python
python-setuptools
python-pytest
git

1
python-cairo/key Normal file
View File

@ -0,0 +1 @@
gpg --recv-keys 46BD761F7A49B0EC

19
python-cairo/note Normal file
View File

@ -0,0 +1,19 @@
_____________________________________ test_svg_surface_get_document_unit _____________________________________
@pytest.mark.skipif(not hasattr(cairo.SVGSurface, get_document_unit),
reason=too old cairo)
def test_svg_surface_get_document_unit():
with cairo.SVGSurface(None, 10, 10) as surface:
> assert surface.get_document_unit() == cairo.SVGUnit.PT
E AssertionError: assert cairo.SVGUnit.USER == cairo.SVGUnit.PT
E + where cairo.SVGUnit.USER = <built-in method get_document_unit of cairo.SVGSurface object at 0x7f3926a48750>()
E + where <built-in method get_document_unit of cairo.SVGSurface object at 0x7f3926a48750> = <cairo.SVGSurface object at 0x7f3926a48750>.get_document_unit
E + and cairo.SVGUnit.PT = <class 'cairo.SVGUnit'>.PT
E + where <class 'cairo.SVGUnit'> = cairo.SVGUnit
tests/test_surface.py:270: AssertionError
========================================== short test summary info ===========================================
FAILED tests/test_surface.py::test_svg_surface_get_document_unit - AssertionError: assert cairo.SVGUnit.USE...
================================== 1 failed, 261 passed, 3 skipped in 0.41s ==================================
With 1 failing test indicating too-old-cairo how is Arch building it with the tests?

5
python-cairo/time Normal file
View File

@ -0,0 +1,5 @@
real 0m10.554s
user 0m9.382s
sys 0m0.623s