Source

pyside_aur / python-pyside-tools / PKGBUILD

Full commit
# Maintainer: arlx_ignacy <ziphims@gmail.com>
# Contributor: Matthias Maennich <arch@maennich.net>
# Contributor: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>


# modify these two to whatever Python 3 interpreter you're targetting; on my
# system I use the vanilla python3
_pyver=3
_pyexec=/usr/bin/python$_pyver

pkgname=python-pyside-tools
pkgver=0.2.13
pkgrel=1
pkgdesc='PySide development tools (pyuic and pyrcc) for Python 3.'
arch=('i686' 'x86_64')
license=('LGPL')
url="http://www.pyside.org"
depends=('python-pyside>=1.1.0' 'python')
makedepends=('cmake' 'automoc4' 'python-shibokengenerator>=1.1.0' 'patch' 'sed')
replaces=('pyside-tools-py3')
source=("http://www.pyside.org/files/pyside-tools-$pkgver.tar.bz2"
        '2to3.patch'
        'py3uic.patch'
        'py3build.patch')
md5sums=('14d3a36df06d680357d7bc1960f19a6d'
         '88ca14b1e58ca167564afd215930a84b'
         '9e4d6f040e442713f5e74fc8aae6d8e6'
         'c6a93ca5a200ec6b2601e8349db08bae')


build() {
    cd "$srcdir/pyside-tools-$pkgver"

    msg "Applying patches ..."
    # this patch from running 2to3-3.2
    patch -p1 < ../2to3.patch
    # this patch to make pyside-uic valid for Python 3
    patch -p1 < ../py3uic.patch
    # this patch is to differentiate our build as Python 3
    patch -p1 < ../py3build.patch

    # of course, if you want to undo the patches you can use:
    #  $ patch -p1 -R < ../py3build.patch
    #  $ patch -p1 -R < ../py3uic.patch
    #  $ patch -p1 -R < ../2to3.patch

    cd ..
    if [ -d build ] ; then
        msg "Removing last build ..."
        rm -rf build
    fi

    mkdir build
    cd build

    cmake ../pyside-tools-$pkgver -DCMAKE_INSTALL_PREFIX=/usr  \
                                  -DCMAKE_BUILD_TYPE=Release   \
                                  -DPYTHON_EXECUTABLE=$_pyexec \
                                  -DUSE_PYTHON3=TRUE
    make

    # change interpreter to what we set it to
    sed -i -e "1c #!$_pyexec" ../pyside-tools-$pkgver/pyside-uic
}


package() {
    cd "$srcdir/build"
    make DESTDIR=$pkgdir install
}