# Maintainer: Andrew Crerar <crerar@archlinux.org>
# Maintainer: Morten Linderud <foxboron@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Angel 'angvp' Velasquez <angvp[at]archlinux.com.ve>
# Contributor: Douglas Soares de Andrade <dsa@aur.archlinux.org>

pkgname=python-psycopg2
pkgver=2.9.9
pkgrel=2
pkgdesc="A PostgreSQL database adapter for the Python programming language."
arch=('x86_64' 'aarch64')
url="https://www.psycopg.org/"
license=('LGPL-3.0-or-later')
depends=('python' 'glibc' 'postgresql-libs')
makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel')
source=("https://github.com/psycopg/psycopg2/archive/refs/tags/${pkgver}.tar.gz")
b2sums=('0bf4c9e7b07915c52b7581d02c100ca1539b63ce46ec92cc299d4998112f6146a45a7c5a5806c99d5483f1b91cea9e577402a920690b1ada3ac5560e0fcc743e')
build(){
  cd "psycopg2-${pkgver}"
  sed -i 's/,PSYCOPG_DEBUG$//' setup.cfg
  python -m build --wheel --no-isolation
}

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