[aur-general] Request review PKGBUILDs

Iyán Méndez Veiga me at iyanmv.com
Mon Apr 4 21:59:44 UTC 2022


Hi,

I would appreciate if anyone can review these two PKGBUILDs. I'm completely 
new to the new PEP 517-518 approach, so any feedback will be welcome.

Also, I'm not able to  run the tests in the check function. So any hints/tips 
are also appreciated. It's like python inside check() is not able to import 
the _accelerate.cpython-310-x86_64-linux-gnu.so library for some reason. But 
manually, I can do python -c 'import _accelerate'.

Thanks,
Iyán

-- 
Iyán Méndez Veiga
GPG: 0x422E3694311E5AC1
-------------- next part --------------
# Maintainer: Iyán Méndez Veiga <me (at) iyanmv (dot) com>
_pkgname=qiskit-aer
pkgname=python-${_pkgname}
pkgver=0.10.3
pkgrel=2
pkgdesc="A high performance simulator for quantum circuits that includes noise models"
arch=('x86_64')
url="https://github.com/Qiskit/qiskit-aer"
license=('Apache')
depends=(
    'cython'
    'muparserx'
    'nlohmann-json'
    'python-numpy'
    'python-qiskit-terra'
    'python-scipy'
)
optdepends=(
    'openblas: optimized BLAS library'
    'openmp: parallelization with OpenMP'
    'python-dask: parallel computing with task scheduling'
    'python-distributed: distributed task scheduler for Dask'
)
makedepends=(
    'cmake'
    'ninja'
    'pybind11'
    'python-build'
    'python-installer'
    'python-scikit-build'
    'python-setuptools'
    'python-wheel'
    'spdlog'
)
checkdepends=(
    'python-pytest'
    'python-fixtures'
    'python-ddt'
)
source=(
    "${_pkgname}-${pkgver}.tar.gz::https://github.com/Qiskit/${_pkgname}/archive/${pkgver}.tar.gz"
    "fix.patch"
)

sha256sums=(
    'debc146f4c05c4187cda24bcf9d690ab9845d266c706d9685c145e6795e11443'
    'c847b08cf47e384bfec3c75aa38cc9b03f9c9976b40956f2b332a946f1a2c124'
)

prepare() {
    cd "${srcdir}/${_pkgname}-${pkgver}"
    patch --forward --strip=1 --input="${srcdir}/fix.patch"
}

build() {
    cd "${srcdir}/${_pkgname}-${pkgver}"
    DISABLE_CONAN=ON python -m build --wheel --no-isolation
}

check() {
    cd "${srcdir}/${_pkgname}-${pkgver}"
    python -m installer --destdir="$srcdir/test" dist/*.whl
    export PYTHONPATH="$srcdir"/test/usr/lib/python3.10/site-packages
    python -m pytest test
}

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

    # This deletes all folders except /usr/lib/python3.10/site-packages/qiskit/
    # See https://github.com/Qiskit/qiskit-aer/issues/1457
    find "${pkgdir}/usr" -mindepth 1 -maxdepth 1 -not -name lib -exec rm -rf '{}' \;

    install -D -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
-------------- next part --------------
# Maintainer: Iyán Méndez Veiga <me (at) iyanmv (dot) com>
_pkgname=qiskit-terra
pkgname=python-${_pkgname}
pkgver=0.20.0
pkgrel=1
pkgdesc="An open-source framework for working with noisy quantum computers at the level of pulses, circuits, and algorithms"
arch=('x86_64')
url="https://github.com/Qiskit/qiskit-terra"
license=('Apache')
depends=(
    'cython'
    'python-constraint'
    'python-dateutil'
    'python-dill'
    'python-numpy'
    'python-ply'
    'python-psutil'
    'python-retworkx'
    'python-scipy'
    'python-stevedore'
    'python-symengine'
    'python-sympy'
    'python-tweedledum'
)

optdepends=(
    'cplex: commercial solver for mathematical optimization problems'
    'python-docplex: IBM Decision Optimization CPLEX Modeling'
    'python-ipywidgets: IPython HTML widgets for Jupyter'
    'python-matplotlib: plotting support'
    'python-pillow: image support'
    "python-pydot: Graphviz's Dot support"
    'python-pygments: syntax highlighter'
    'python-pylatexenc: LaTeX support'
    'python-seaborn: statistical data visualization'
    #'z3-solver: efficient SMT solver library'
)
makedepends=(
    'python-build'
    'python-installer'
    'python-setuptools'
    'python-setuptools-rust'
    'python-wheel'
)
checkdepends=(
    'python-pytest'
    'python-hypothesis'
)
source=("${_pkgname}-${pkgver}.tar.gz::https://github.com/Qiskit/${_pkgname}/archive/${pkgver}.tar.gz")
sha256sums=('67ac498b951dcfa1a1a6343b6386ed555b075d91c28bc76b761d30357a8ba0a9')

build() {
    cd "${srcdir}/${_pkgname}-${pkgver}"
    python -m build --wheel --no-isolation
}

#check() {
#    cd "${srcdir}/${_pkgname}-${pkgver}"
#    python -m installer --destdir="$srcdir/test" dist/*.whl
#    export PYTHONPATH="$srcdir"/test/usr/lib/python3.10/site-packages
#    python -m pytest test/python
#}

package() {
    cd "${srcdir}/${_pkgname}-${pkgver}"
    python -m installer --destdir="$pkgdir" dist/*.whl
    install -D -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.archlinux.org/pipermail/aur-general/attachments/20220404/bae881fe/attachment.sig>


More information about the aur-general mailing list