Source

pyside_aur / shiboken / PKGBUILD

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


# modify this to whatever Python 2 interpreter you're targetting; on my
# system I use the vanilla python2
_py2exec=$(which python2)
# modify this to whatever Python 3 interpreter you're targetting; on my
# system I use the vanilla python3
_py3exec=$(which python3)


pkgbase=shiboken
pkgname=('python2-shiboken' 'python-shiboken' 'shiboken-common')
pkgver=1.1.2
pkgrel=1
pkgdesc='Python binding generator that uses API Extractor and outputs CPython code.'
arch=('i686' 'x86_64')
license=('LGPL')
url='http://www.pyside.org'
depends=('qt>=4.8' 'openssl')
makedepends=('cmake' 'automoc4')
replaces=('shibokengenerator' 'libshiboken')
source=("http://www.pyside.org/files/shiboken-$pkgver.tar.bz2")
md5sums=('0a37b5011b3a7276bf4584317412a4b6')

build() {
    echo ""
}

package_python2-shiboken() {
    if [ "$_py2exec" != "" ]; then
        depends=('python2' 'shiboken-common>=1.1.2')
        makedepends=('sed')

        if [ -d "$srcdir/build" ]; then
            rm -r "$srcdir/build"
        fi
        mkdir -p "$srcdir/build"

        cd "$srcdir/build"
        cmake ../shiboken-$pkgver -DBUILD_TESTS=FALSE          \
                                  -DCMAKE_BUILD_TYPE=Release   \
                                  -DCMAKE_INSTALL_PREFIX=/usr  \
                                  -DENABLE_GCC_OPTIMIZATION=On \
                                  -DUSE_PYTHON3=FALSE
        make DESTDIR=$pkgdir clean install

        # remove files provided by shiboken-common
        rm -r $pkgdir/usr/bin
        rm $pkgdir/usr/lib/cmake/Shiboken-$pkgver/ShibokenConfig{,Version}.cmake
        rm -r $pkgdir/usr/lib/pkgconfig
        rm -r $pkgdir/usr/include
        rm -r $pkgdir/usr/share
    fi
}

package_python-shiboken() {
    if [ "$_py3exec" != "" ]; then
        depends=('python' 'shiboken-common>=1.1.2')
        makedepends=('sed')

        if [ -d "$srcdir/build" ]; then
            rm -r "$srcdir/build"
        fi
        mkdir -p "$srcdir/build"

        cd "$srcdir/build"
        cmake ../shiboken-$pkgver -DBUILD_TESTS=FALSE          \
                                  -DCMAKE_BUILD_TYPE=Release   \
                                  -DCMAKE_INSTALL_PREFIX=/usr  \
                                  -DENABLE_GCC_OPTIMIZATION=On \
                                  -DUSE_PYTHON3=TRUE
        make DESTDIR=$pkgdir clean install

        # remove files provided by shiboken-common
        rm -r $pkgdir/usr/bin
        rm $pkgdir/usr/lib/cmake/Shiboken-$pkgver/ShibokenConfig{,Version}.cmake
        rm -r $pkgdir/usr/lib/pkgconfig
        rm -r $pkgdir/usr/include
        rm -r $pkgdir/usr/share
    fi
}

package_shiboken-common() {
    cd "$srcdir/build"
    make DESTDIR=$pkgdir install

    # remove library files, we dont need it for common
    rm $pkgdir/usr/lib/libshiboken*.so*
    rm -r $pkgdir/usr/lib/python*

    # remove ShibokenConfig*python*.cmake files
    rm $pkgdir/usr/lib/cmake/Shiboken-$pkgver/ShibokenConfig*python*.cmake
}
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.