You are not logged in.

#1 2025-06-08 04:46:52

Salkay
Member
Registered: 2014-05-22
Posts: 674

[REQUEST] python-widevine

I'm trying to write a PKGBUILD for a python program pywidevine (here at pip). I actually already maintain 45 packages on the AUR, including two python-related packages. However, I'm not really sure how to package this one, given there is no setup.py provided. I had a read of the wiki, but was a bit confused.

The project's pyproject.toml includes

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

But I'm not really sure how to package python modules with poetry.

I've listed the PKGBUILD I've started with, although the build, check, and package functions below are just copied from another python package for reference, and presumably are incorrect here.

pkgname=python-widevine
pkgver=1.8.0
pkgrel=1
pkgdesc="Python implementation of Google's Widevine DRM CDM (Content Decryption Module)"
arch=('any')
url='https://github.com/devine-dl/pywidevine'
license=('GPL-3.0-only')
depends=('python>=3.8'
         'python-protobuf'
         'python-pymp4'
         'python-pycryptodome'
         'python-click'
         'python-requests'
         'python-unidecode'
         'python-yaml'
         'python-aiohttp')
makedepends=(python-setuptools) # presumably unneeded?
checkdepends=() # also unneeded?
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('foobar')

build() {
  cd "$_pkgname-$pkgver"
  python setup.py build
}

check() {
  cd "$_pkgname-$pkgver"
  python setup.py test
}

package() {
  cd "$_pkgname-$pkgver"
  python setup.py install --optimize=1 --root="${pkgdir}/"
  install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

Any help would be greatly appreciated. Thank you in advance.

Offline

#2 2025-06-08 10:58:49

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,769

Re: [REQUEST] python-widevine

All python backends supported by archlinux are a member of the python-build-backend group .

$ pacman -Sg python-build-backend
python-build-backend meson-python
python-build-backend python-flit-core
python-build-backend python-hatchling
python-build-backend python-maturin
python-build-backend python-pdm-backend
python-build-backend python-poetry-core
python-build-backend python-setuptools
$ 

As there is a python-poetry-core backend, you can use the usual python-build / python-installer method.
Section 4.1 Standards based (PEP 517) of the wiki page has details.

Last edited by Lone_Wolf (2025-06-08 10:59:12)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2025-06-09 13:35:01

Salkay
Member
Registered: 2014-05-22
Posts: 674

Re: [REQUEST] python-widevine

Thanks @Lone_Wolf. With your tips I managed to find a couple of similar PKGBUILDs to base mine on.

Unfortunately the package I'm trying to build depends on python-pymp4, which doesn't build right now, so I can't test if my PKGBUILD works. I'll see if the maintainer fixes it up, otherwise I might need to investigate other options.

Offline

Board footer

Powered by FluxBB