desktop/python3-shiboken/PKGBUILD
2015-05-27 22:10:19 +00:00

80 lines
3.0 KiB
Bash

# Maintainer: Fabian Kosmale <0inkane@googlemail.com>
# Contributor: arlx_ignacy <ziphims@gmail.com>
# Contributor: Matthias Maennich <arch@maennich.net>
### NOTE: there's also python2-shiboken in another path
pkgname=python3-shiboken
pkgver=1.2.2
pkgrel=3
pkgdesc='Python binding generator that uses API Extractor and outputs CPython code. (Python 3 build)'
arch=('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://download.qt-project.org/official_releases/pyside/shiboken-${pkgver}.tar.bz2"
'cmake.patch'
'cmake_fixes.patch'
'cmake_vars.patch')
md5sums=('9f5bee9d414ce51be07ff7a20054a48d'
'e21f354434c2c43b8ebdcf582d512de5'
'c434168b591c27d2b3b18cfca92189af'
'3ba4a76129899a2508fec517888bf6e8')
prepare() {
# msg 'patch1'
# patch $srcdir/shiboken-$pkgver/cmake/Modules/FindPython3Libs.cmake cmake.patch
cd "$srcdir/shiboken-$pkgver"
msg "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
msg "this patch is to make it much easier to veriables from cmake"
patch -p1 -N < ../cmake_vars.patch
[[ -d bulid ]] || mkdir build
}
build() {
cd $srcdir/shiboken-$pkgver/build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTS=FALSE \
-DUSE_PYTHON3=TRUE \
-Dshiboken_SUFFIX=-python3.4
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
install -dm 755 $pkgdir/usr/lib/pkgconfig/
install -m 755 ../data/shiboken$SHIBOKEN_SUFFIX.pc $pkgdir/usr/lib/pkgconfig/
}