summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f9a536186b6bc91333117c92d37e651d97c618c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Maintainer: Zhang Hua <zhanghuadedn@gmail.com>
# Contributer: Aloxaf <aloxafx@gmail.com>

pkgname=python-playwright-git
pkgver=v1.12.0_3_e05ab07
pkgrel=1
pkgdesc="a Python library to automate Chromium, Firefox and WebKit browsers with a single API"
arch=(x86_64 aarch64)
url=https://github.com/microsoft/playwright-python
license=(Apache)
provides=(python-playwright)
makedepends=('python-pip' 'python-wheel' 'git' 'curl')
depends=('python' 'python-greenlet' 'python-pyee' 'python-typing_extensions')
source=(${pkgname}::git+${url})
sha256sums=('SKIP')
pkgver() {
  cd ${srcdir}/${pkgname}
  git describe --tags | sed "s/-/_/g;s/g//"
}
package() {
  cd ${srcdir}/${pkgname}
  pip install --isolated --root="$pkgdir" --ignore-installed --no-deps --no-warn-script-location ${srcdir}/${pkgname}
  python -O -m compileall "${pkgdir}"
  if [ ${CARCH} != "x86_64" ]
  then
    depends+=('nodejs')
    sed -i "s#\$SCRIPT_PATH/node#node#" ${pkgdir}/$(python -c "import site; print(site.getsitepackages()[0])")/playwright/driver/playwright.sh
  fi
}