summaryrefslogtreecommitdiffstats
path: root/abs/core/dbus-python/PKGBUILD
blob: acaf5e85a9de33dfe3dda4efc0bab057a043b629 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgbase=dbus-python
pkgname=('python-dbus' 'python2-dbus' 'python-dbus-common')
pkgver=1.2.6
pkgrel=1
pkgdesc="Python bindings for DBUS"
url="https://www.freedesktop.org/wiki/Software/DBusBindings"
arch=(x86_64)
license=('GPL' 'LGPL')
depends=('dbus' 'glib2')
makedepends=('docutils' 'python' 'python2' 'autoconf-archive')
source=(https://dbus.freedesktop.org/releases/${pkgbase}/${pkgbase}-${pkgver}.tar.gz{,.asc})
sha256sums=('32f29c17172cdb9cb61c68b1f1a71dfe7351506fc830869029c47449bd04faeb'
            'SKIP')
validpgpkeys=('DA98F25C0871C49A59EAFF2C4DE8FF2A63C7CC90')

prepare() {
  mkdir build-python2 build-python3
  cd $pkgbase-$pkgver
  autoreconf -fi
}

build() {
  cd build-python2
  ../${pkgbase}-${pkgver}/configure --prefix=/usr PYTHON_VERSION=2
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make

  cd ../build-python3
  ../${pkgbase}-${pkgver}/configure --prefix=/usr
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package_python-dbus-common() {
  pkgdesc="Common dbus-python files shared between python-dbus and python2-dbus"
  depends=()
  conflicts=('dbus-python<1.1.0')

  cd build-python3
  make DESTDIR="${pkgdir}" install-data
  rm -r "${pkgdir}"/usr/lib/python*
}

package_python-dbus() {
  depends+=('python-dbus-common' 'python')
  pkgdesc="Python 3.6 bindings for DBUS"

  cd build-python3
  make DESTDIR="${pkgdir}" install

  rm -r "${pkgdir}/usr/share"
  rm -r "${pkgdir}/usr/include"
  rm -r "${pkgdir}/usr/lib/pkgconfig"
}

package_python2-dbus() {
  depends+=('python-dbus-common' 'python2')
  pkgdesc="Python 2.7 bindings for DBUS"
  replaces=('dbus-python')
  conflicts=('dbus-python')
  provides=("dbus-python=$pkgver")

  cd build-python2
  make DESTDIR="${pkgdir}" install

  rm -r "${pkgdir}/usr/share"
  rm -r "${pkgdir}/usr/include"
  rm -r "${pkgdir}/usr/lib/pkgconfig"
}