Package Details: python-skia 87.6-1

Git Clone URL: https://aur.archlinux.org/python-skia.git (read-only, click to copy)
Package Base: python-skia
Description: Python binding to Skia Graphics Library (wheel)
Upstream URL: https://github.com/kyamagu/skia-python
Licenses: BSD-3-Clause
Submitter: alerque
Maintainer: alerque
Last Packager: alerque
Votes: 1
Popularity: 0.000000
First Submitted: 2020-10-02 11:28 (UTC)
Last Updated: 2024-07-19 09:02 (UTC)

Latest Comments

Popolon commented on 2024-12-22 21:48 (UTC) (edited on 2024-12-22 22:28 (UTC) by Popolon)

Please use: https://github.com/kyamagu/skia-python/archive/refs/tags/v87.6.tar.gz as src instead of wheel. It will help for Arch Linux multi-arch.

It currently even can't compile on Python 3.13.

Depends on skia, that don't exists as Arch Linux package, there is a skia-git package. But it doesn't install .h and .so/a as required by python-skia. I asked to the maintainer to add in skia-git PKGBUILD :

provides('ska')

so it would be at least detected by yay.

This should work with it, after the changes:

pkgname='python-skia-python'
_module='skia-python'
pkgver='87.6'
_src_folder="${_module}-${pkgver}"
pkgrel=1
pkgdesc="Skia python binding"
url="https://github.com/kyamagu/skia-python"
depends=('python' 'skia')
makedepends=('python-build' 'python-installer' 'python-wheel')
license=('custom:BSD License')
arch=('any')
source=("https://github.com/kyamagu/skia-python/archive/refs/tags/v87.6.tar.gz")
sha256sums=('8355a068074aadc545b416479e5b4d87b7b06fbad81b37fd9ce8ccd6f2e13eef')

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

package() {

    cd "${_src_folder}"
    python -m installer --destdir="${pkgdir}" dist/*.whl
}

alerque commented on 2022-01-20 16:46 (UTC)

@fbrennan Don't get me wrong I see why the _py=$(pacman -Q python ...) hack is useful, but there are a couple of reasons it shouldn't be in this PKGBUILD by default. It runs afoul of both some Arch packaging guidelines and the way some AUR package helpers handle downloads vs. build environments. Fetching the upstream URL should not require the dependencies on the host system, and querying the host system for versions might run amuck when building in a chroot.

If it's a regular problem I can stick that code in the PKGBUILD in a comment for others to use when need arises. If we get into another dry spell again where upstream is behind locking to an old Python build is certainly an option too, although I think it would require patching to do properly so it could co-exist on a system with more than one python.

fbrennan commented on 2022-01-19 16:08 (UTC)

Here's a python39-skia:

# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Hacker: Fredrick Brennan <copypaste@kittens.ph>

_pyrel=39
pkgname=python$_pyrel-skia
_pkgname=skia-python
pkgver=87.2
pkgrel=2
pkgdesc='Python binding to Skia Graphics Library (wheel)'
arch=(x86_64)
url="https://github.com/kyamagu/$_pkgname"
license=(BSD)
depends=(fontconfig opengl-driver python39)
#makedepends=(python-pip)
options=(!strip)
_py=cp$_pyrel
_wheel="${_pkgname/-/_}-$pkgver-$_py-$_py-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
source=("https://files.pythonhosted.org/packages/$_py/${_pkgname::1}/$_pkgname/$_wheel")
sha256sums=('abaa3c78850ed310a4a6b93ecd3e7b9276cd9a170defbaa6da896a2dcd1b642f')

# If anybody wants to muck around with the Chromium tree and figure out how to
# build skia from source on Arch I'm open to patches, but even after mucking
# around with ninja and Python2 and various patched bulid toolchains I have
# come up short of a way to build this against Arch packages. Drop a comment on
# the AUR page if you have ideas.

package() {
    export PIP_CONFIG_FILE=/dev/null
    warning "Using Python3.9!"
    warning 'The Python3.9 installation you use will need numpy installed separately e.g. `pip3.9 install --user numpy`!'
    python3.9 -m ensurepip
    pip3.9 install --isolated --root="$pkgdir" --ignore-installed --no-deps $_wheel
    python3.9 -O -m compileall "$pkgdir"
}

fbrennan commented on 2022-01-19 15:50 (UTC)

Non-functional package due to https://github.com/kyamagu/skia-python/issues/170.

When that is fixed, this package will still be non-functional without this patch:

diff --git a/PKGBUILD b/PKGBUILD
index a43a498..d2428a1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -11,7 +11,7 @@ license=(BSD)
 depends=(fontconfig opengl-driver python)
 makedepends=(python-pip)
 options=(!strip)
-_py=cp39
+_py=$(pacman -Q python|awk '{print $2}'|sed -e 's/\([0-9]\)\.\([0-9]\+\).*/cp\1\2/')
 _wheel="${_pkgname/-/_}-$pkgver-$_py-$_py-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
 source=("https://files.pythonhosted.org/packages/$_py/${_pkgname::1}/$_pkgname/$_wheel")
 sha256sums=('abaa3c78850ed310a4a6b93ecd3e7b9276cd9a170defbaa6da896a2dcd1b642f')