summaryrefslogtreecommitdiff
path: root/python2-qtpy/PKGBUILD
blob: f9db2cbe9d95d39c66b138a1475724bbaccd90e6 (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
30
31
32
33
34
35
36
# Maintainer: Erich Eckner <arch at eckner dot net>
# Contributor: Muflone http://www.muflone.com/contacts/english/

pkgname='python2-qtpy'
_pkgname="${pkgname#*-}"
pkgver=1.9.0
pkgrel=1
pkgdesc='Provides an uniform layer to support PyQt5, PyQt4 and PySide with a single codebase'
makedepends=('python2' 'python2-setuptools')
arch=('any')
url="https://github.com/spyder-ide/${_pkgbase}/"
license=('MIT')
source=("${pkgname}-${pkgver}.tar.gz"::"https://github.com/spyder-ide/${_pkgname}/archive/v${pkgver}.tar.gz")
sha512sums=('aa94c55b6e3f12528377d3d77bba0803cab01d47cf18fb5a82afced6bdcd45144b97380be52c71fda7a96ea4eaa7eda27f4a072048065fb3834be81939c6b41c')

prepare() {
  # Fix Python 2.x shebang
  cd "${_pkgname}-${pkgver}"
  sed -i 's@^#!.*python$@#!/usr/bin/env python2@' "${_pkgname}/tests/runtests.py"
}

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

package() {
  depends=('python2')
  optdepends=('python2-pyqt5: Qt5 Python bindings'
              'python2-pyqtwebengine: Qt5-WebEngine python bindings')

  cd "${_pkgname}-${pkgver}"
  python2 setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1
  # Install license file
  install -D -m644 "LICENSE.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}