pyside_aur / python-shibokengenerator / PKGBUILD

# Maintainer: arlx_ignacy <ziphims@gmail.com>
# Contributor: Matthias Maennich <arch@maennich.net>

# 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-shibokengenerator
pkgver=1.1.0
pkgrel=1
pkgdesc='Python 3 bindings generator that uses API Extractor and outputs CPython code.'
arch=('i686' 'x86_64')
license=('LGPL')
url='http://www.pyside.org'
depends=('python' 'qt>=4.7' 'openssl' 'generatorrunner>=0.6.16')
makedepends=('cmake' 'automoc4' 'patch')
replaces=('shibokengenerator-py3')
source=("http://www.pyside.org/files/shiboken-$pkgver.tar.bz2"
        "pythonsuffix.patch")
md5sums=('9c9d696c8c426fb5abf28a6bd3759558'
         '6e33e6e68ffc18785b6aaebc36c905ed')

build() {
    cd "$srcdir/shiboken-$pkgver"

    msg "Applying patches ..."
    # this patch is to make it much easier to get python suffix
    patch -p1 -N < ../../pythonsuffix.patch

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

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

    mkdir -p build
    cd build

    cmake ../shiboken-$pkgver -DCMAKE_INSTALL_PREFIX=/usr  \
                              -DCMAKE_BUILD_TYPE=Release   \
                              -DBUILD_TESTS=FALSE          \
                              -DPYTHON_EXECUTABLE=$_pyexec \
                              -DUSE_PYTHON3=TRUE
    make shiboken
}

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

    mkdir -m 755 -p $pkgdir/usr/lib/cmake/Shiboken-$pkgver/
    install -m 755 ../data/ShibokenConfig.cmake $pkgdir/usr/lib/cmake/Shiboken-$pkgver/
    install -m 755 ../data/ShibokenConfigVersion.cmake $pkgdir/usr/lib/cmake/Shiboken-$pkgver/
    if [ -e ../data/ShibokenConfig-python$_pyver.cmake ] ; then
        install -m 755 ../data/ShibokenConfig-python$_pyver.cmake $pkgdir/usr/lib/cmake/Shiboken-$pkgver/
    else
        pythonsuffix=$(cat ../data/pythonsuffix)
        if [ -e ../data/ShibokenConfig$pythonsuffix.cmake ] ; then
            install -m 755 ../data/ShibokenConfig$pythonsuffix.cmake $pkgdir/usr/lib/cmake/Shiboken-$pkgver/
        else
            msg "Unable to get pythonsuffix!"
            return 1
        fi
    fi

    mkdir -m 755 -p $pkgdir/usr/lib/pkgconfig/
    install -m 755 ../data/shiboken.pc $pkgdir/usr/lib/pkgconfig/
}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.