desktop/python3-shiboken/PKGBUILD
2012-12-24 00:22:05 +00:00

74 lines
2.8 KiB
Bash

# Maintainer: Fabian Kosmale <0inkane@googlemail.com>
# Contributor: arlx_ignacy <ziphims@gmail.com>
# Contributor: Matthias Maennich <arch@maennich.net>
pkgname=python3-shiboken
pkgver=1.1.2
pkgrel=2
pkgdesc='Python binding generator that uses API Extractor and outputs CPython code. (Python 3 build)'
arch=('i686' 'x86_64')
license=('LGPL')
url='http://www.pyside.org'
depends=('python3' 'qt>=4.7' 'openssl')
makedepends=('cmake' 'automoc4' 'sed' 'patch')
replaces=('shibokengenerator-py3', 'python-libshiboken')
source=("http://www.qt-project.org/uploads/pyside/shiboken-$pkgver.tar.bz2"
'cmake.patch'
'cmake_fixes.patch'
'cmake_vars.patch')
md5sums=('0a37b5011b3a7276bf4584317412a4b6'
'e21f354434c2c43b8ebdcf582d512de5'
'c434168b591c27d2b3b18cfca92189af'
'3ba4a76129899a2508fec517888bf6e8')
build() {
patch $srcdir/shiboken-$pkgver/cmake/Modules/FindPython3Libs.cmake cmake.patch
cd "$srcdir/shiboken-$pkgver"
# this patch is to fix cmake to make python's and python2's version coexistence (needed for the prefix to work)
patch -p1 -N < ../cmake_fixes.patch
# this patch is to make it much easier to veriables from cmake
patch -p1 -N < ../cmake_vars.patch
mkdir -p build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTS=FALSE \
-DUSE_PYTHON3=TRUE \
-Dshiboken_SUFFIX=-python3
make shiboken
make libshiboken
# generator does not build this way
}
package() {
# install generator
cd "$srcdir/shiboken-${pkgver}/build/generator"
make DESTDIR=$pkgdir install
# install libshiboken
cd "$srcdir/shiboken-${pkgver}/build/libshiboken"
make DESTDIR=$pkgdir install
# get some variables for our purpose
SHIBOKEN_SUFFIX=$(sed -n '2p' ../data/cmake_vars)
PYTHON_SUFFIX=$(sed -n '3p' ../data/cmake_vars)
mkdir -m 755 -p $pkgdir/usr/lib/cmake/Shiboken$SHIBOKEN_SUFFIX-$pkgver/
install -m 755 ../data/ShibokenConfig.cmake $pkgdir/usr/lib/cmake/Shiboken$SHIBOKEN_SUFFIX-$pkgver/
install -m 755 ../data/ShibokenConfigVersion.cmake $pkgdir/usr/lib/cmake/Shiboken$SHIBOKEN_SUFFIX-$pkgver/
if [ -e ../data/ShibokenConfig-python$_pyver.cmake ] ; then
install -m 755 ../data/ShibokenConfig-python$_pyver.cmake $pkgdir/usr/lib/cmake/Shiboken$SHIBOKEN_SUFFIX-$pkgver/
else
if [ -e ../data/ShibokenConfig$PYTHON_SUFFIX.cmake ] ; then
install -m 755 ../data/ShibokenConfig$PYTHON_SUFFIX.cmake $pkgdir/usr/lib/cmake/Shiboken$SHIBOKEN_SUFFIX-$pkgver/
else
msg "Unable to resolve cmake config file for \"$PYTHON_SUFFIX\"."
return 1
fi
fi
mkdir -m 755 -p $pkgdir/usr/lib/pkgconfig/
install -m 755 ../data/shiboken$SHIBOKEN_SUFFIX.pc $pkgdir/usr/lib/pkgconfig/
}