summaryrefslogtreecommitdiff
path: root/python2-qtpy/PKGBUILD
blob: 0ec4d944266b41752fc2da93ccc8d91a57869928 (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.8.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")
sha256sums=('f4d5bdeeac2a859ecaf72b52ed6502f00946e255d635911866efa8cbab95238d')

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"
}