desktop/python-pyside/PKGBUILD
2017-10-31 23:04:26 +01:00

88 lines
3.2 KiB
Bash

# Contributions from Arch: https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/python-pyside
pkgbase=python-pyside
pkgname=(python-pyside-common python2-pyside python3-pyside)
_pkgrealname=pyside
pkgver=1.2.4
pkgrel=3
arch=('x86_64')
license=('LGPL')
url="http://qt-project.org/wiki/PySide"
_qtver=4.8
makedepends=('python3' 'python2' "qt>=${_qtver}" "python"{3,2}"-shiboken>=$pkgver"
'cmake' 'phonon' 'automoc4' 'graphviz' 'mesa' "python"{2,3}-sphinx)
source=("pypi-$pkgbase-$pkgver.tar.gz::https://pypi.python.org/packages/source/P/PySide/PySide-$pkgver.tar.gz")
md5sums=('3cb7174c13bd45e3e8f77638926cb8c0')
build(){
cd "$srcdir/PySide-$pkgver"
python2 setup.py egg_info
cd "$srcdir/PySide-$pkgver/sources/pyside"
mkdir -p build_py3
cd build_py3
cmake .. -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF \
-DQT_PHONON_INCLUDE_DIR=/usr/include/phonon \
-DPYTHON_SUFFIX=.cpython-36m-x86_64-linux-gnu \
-DQT_SRC_DIR=/usr/include/Qt
make
cd "$srcdir/PySide-$pkgver/sources/pyside"
mkdir -p build_py2
cd build_py2
cmake .. -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF \
-DQT_PHONON_INCLUDE_DIR=/usr/include/phonon \
-DPYTHON_SUFFIX=-python2.7 \
-DQT_SRC_DIR=/usr/include/Qt
make
}
package_python-pyside-common(){
pkgdesc="Provides LGPL Qt bindings for Python and related tools for binding generation (Common Files)"
# cmake will use Python 3 version by default
cd "$srcdir/PySide-$pkgver/sources/pyside/build_py3"
make DESTDIR="$pkgdir" install
rm -rf "$pkgdir"/usr/lib/pkgconfig
rm -rf "$pkgdir"/usr/lib/python* "$pkgdir"/usr/lib/libpyside.*
rm "$pkgdir"/usr/lib/cmake/PySide-$pkgver/PySideConfig*python*.cmake
}
package_python3-pyside(){
depends=('python3' "qt>=${_qtver}" "python3-shiboken>=$pkgver"
"python-pyside-common=$pkgver-$pkgrel")
pkgdesc="Provides LGPL Qt bindings for Python and related tools for binding generation (Python 3 version)"
optdepends=('phonon: for PySide.phonon')
cd "$srcdir/PySide-$pkgver/sources/pyside/build_py3"
make DESTDIR="$pkgdir" install
mv "$pkgdir"/usr/lib/pkgconfig/pyside.pc \
"$pkgdir"/usr/lib/pkgconfig/pyside-py3.pc
rm -rf "$pkgdir"/usr/include
rm -rf "$pkgdir"/usr/share
rm "$pkgdir"/usr/lib/cmake/PySide-$pkgver/PySideConfig.cmake
rm "$pkgdir"/usr/lib/cmake/PySide-$pkgver/PySideConfigVersion.cmake
}
package_python2-pyside(){
depends=('python2' "qt>=${_qtver}" "python2-shiboken>=$pkgver" "python-pyside-common=$pkgver-$pkgrel")
pkgdesc="Provides LGPL Qt bindings for Python and related tools for binding generation (Python 2 version)"
optdepends=('phonon: for PySide.phonon')
cd "$srcdir/PySide-$pkgver/sources/pyside/build_py2"
make DESTDIR="$pkgdir" install
mv "$pkgdir"/usr/lib/pkgconfig/pyside.pc \
"$pkgdir"/usr/lib/pkgconfig/pyside-py2.pc
rm -rf "$pkgdir"/usr/include
rm -rf "$pkgdir"/usr/share
rm "$pkgdir"/usr/lib/cmake/PySide-$pkgver/PySideConfig.cmake
rm "$pkgdir"/usr/lib/cmake/PySide-$pkgver/PySideConfigVersion.cmake
}