summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fe511185926843f838fe654859875c86e0229ead (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
# shellcheck disable=SC2034,SC2154,SC2164

# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Douglas Soares de Andrade <douglas@archlinux.org>
# Contributor: riai <riai@bigfoot.com>, Ben <ben@benmazer.net>
# Contributor: Zhirui Dai <daizhirui@hotmail.com>

pkgbase=sip4
pkgname=(sip4 python-sip4)
pkgver=4.19.25
pkgrel=7
arch=(x86_64)
url='https://www.riverbankcomputing.com/software/sip/intro'
license=('LicenseRef-sip')
makedepends=(
    python
    python-setuptools
)
source=("https://www.riverbankcomputing.com/static/Downloads/sip/$pkgver/sip-$pkgver.tar.gz"
        python3-11.patch)
sha256sums=('b39d93e937647807bac23579edbff25fe46d16213f708370072574ab1f1b4211'
            'af816287a77ae8dcfd8859d162ca603ac72a4cf4f7080bb6e712cbc87638d194')

prepare() {
  mkdir -p build
  cd sip-$pkgver
  patch -Np1 -i ../python3-11.patch
}

build() {
  cd build
  python ../sip-$pkgver/configure.py CFLAGS="$CFLAGS" LFLAGS="$LDFLAGS" --no-dist-info
  make
}

package_sip4() {
  pkgdesc="A tool that makes it easy to create Python bindings for C and C++ libraries"
  depends=(glibc)
  provides=(sip4)

  cd build
  make DESTDIR="$pkgdir" install -C sipgen
# move sip.h to /usr/include
  mv "$pkgdir"/usr/include/{python*/sip.h,}
  rm -r "$pkgdir"/usr/include/python*

  install -Dm644 ../sip-$pkgver/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

package_python-sip4() {
  pkgdesc="Python SIP4 bindings for C and C++ libraries"
  depends=(python)
  provides=(python-sip4)
  replaces=(python-sip4)

  cd build
  make DESTDIR="$pkgdir" install
  rm -r "$pkgdir"/usr/{bin,include} # conflicts with sip

  install -Dm644 ../sip-$pkgver/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}