You are not logged in.

#1 2024-05-22 08:19:16

Tétrapyle
Member
Registered: 2014-01-03
Posts: 56

PKGBUILD review: python-pystrich

Hi,
Please kindly review this PKGBUILD.
This Python module has not been updated for a few years but is still used and required by a software I use, for producing Data Matrix pictures.
There's a project's URL in the source but it's down, hence the source_url. There's also a PyPi version.
For build() and package(), I just followed the wiki.
pkgver() is a nice feature. I'm not sure if there's a way to get a file in the source before the version has been set.
Thanks.

# Maintainer:  Tétrapyle <https://aur.archlinux.org/account/Tetrapyle/>
# Contributor: Tétrapyle

#
# A Python module to generate 1D and 2D barcodes
# (Code 39, Code 128, EAN-13, Data Matrix, QR Code),
# forked from huBarcode.
#

pkgname=python-pystrich
pkgver=0.8
pkgrel=1
pkgdesc="A Python module to generate 1D and 2D barcodes"
arch=('any')
url="https://github.com/mmulqueen/pyStrich"
source_url="https://github.com/mmulqueen/pyStrich"
license=('Apache-2.0')
depends=(python python-pillow python-lxml python-setuptools)
source=("${pkgname}-${pkgver}::git+"$source_url)
sha256sums=('SKIP')

makedepends=(python-build python-installer python-wheel python-setuptools git)

pkgver() {
    sed -n "s/.*version='\([0-9|.]*\)'.*/\1/p" $srcdir/${pkgname}-*/setup.py
}

build() {
    cd $pkgname-$pkgver
    python -m build --wheel --no-isolation
}

package() {
    cd $pkgname-$pkgver
    python -m installer --destdir="$pkgdir" dist/*.whl
}

Offline

#2 2024-05-22 12:23:16

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,690

Re: PKGBUILD review: python-pystrich

If you want version 0.8, you need to download version 0.8. If you want a VCS package, you need to make a VCS package (https://wiki.archlinux.org/title/VCS_package_guidelines). You can't have this weird combination of both.

Online

#3 2024-05-23 08:50:22

Tétrapyle
Member
Registered: 2014-01-03
Posts: 56

Re: PKGBUILD review: python-pystrich

I understand, thanks.
This one should be OK?

# Maintainer:  Tétrapyle <https://aur.archlinux.org/account/Tetrapyle/>
# Contributor: Tétrapyle

#
# A Python module to generate 1D and 2D barcodes
# (Code 39, Code 128, EAN-13, Data Matrix, QR Code),
# forked from huBarcode.
#

_name=pyStrich
pkgname=python-${_name,,}
pkgver=0.8
pkgrel=1
pkgdesc="A Python module to generate 1D and 2D barcodes"
arch=('any')
url="https://github.com/mmulqueen/pyStrich"
license=('Apache-2.0')
depends=(python python-pillow python-lxml python-setuptools)
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/mmulqueen/${_name}/archive/v${pkgver}.tar.gz")
sha256sums=('dc40821f7862f99bc3b4129cd08700bc7d20842a661fb7046cdc14d5d43b05d0')

makedepends=(python-build python-installer python-wheel git)

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

package() {
    cd "$_name-$pkgver"
    python -m installer --destdir="$pkgdir" dist/*.whl
}

Offline

Board footer

Powered by FluxBB