mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-01-24 02:22:13 +08:00
93 lines
3.0 KiB
Bash
93 lines
3.0 KiB
Bash
# Contributions from Arch: https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/shiboken
|
|
|
|
pkgbase=shiboken
|
|
pkgname=(python{2,3}-shiboken shiboken)
|
|
pkgver=1.2.4
|
|
pkgrel=3
|
|
arch=('x86_64')
|
|
license=('LGPL')
|
|
url="http://www.pyside.org"
|
|
makedepends=('cmake' 'python2' 'python3' 'qt4' 'libxslt')
|
|
source=("$pkgbase-$pkgver.tar.gz::https://github.com/PySide/Shiboken/archive/$pkgver.tar.gz"
|
|
'python-3.6.patch')
|
|
|
|
md5sums=('c284197d06ad25d78009ff55f18dd512'
|
|
'bf4b227f37c2bf190554a16bf3346963')
|
|
|
|
prepare(){
|
|
cd "$srcdir/Shiboken-$pkgver"
|
|
patch -p1 -i ../python-3.6.patch
|
|
}
|
|
|
|
build(){
|
|
cd "$srcdir/Shiboken-$pkgver"
|
|
# build python2
|
|
mkdir -p build-py2 && cd build-py2
|
|
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DBUILD_TESTS=OFF \
|
|
-DPYTHON_EXECUTABLE=/usr/bin/python2 \
|
|
-DPYTHON_LIBRARY=/usr/lib/libpython2.7.so \
|
|
-DPYTHON_INCLUDE_DIR=/usr/include/python2.7
|
|
make
|
|
|
|
# build python3
|
|
cd "$srcdir/Shiboken-$pkgver"
|
|
mkdir -p build-py3 && cd build-py3
|
|
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DBUILD_TESTS=OFF \
|
|
-DUSE_PYTHON3=yes
|
|
make
|
|
}
|
|
|
|
package_shiboken() {
|
|
pkgdesc="CPython bindings generator for C++ libraries"
|
|
depends=(python3 qt4 libxslt)
|
|
optdepends=("python2-shiboken: for compilation against python2"
|
|
"python3-shiboken: for compilation against python3")
|
|
|
|
# Header files/ /usr/bin/shiboke, pkgconfig, man page
|
|
cd "$srcdir/Shiboken-$pkgver/build-py3"
|
|
make DESTDIR="$pkgdir" install
|
|
|
|
cd "$srcdir/Shiboken-$pkgver/build-py2"
|
|
cd data
|
|
install -Dm 644 ShibokenConfig-python2.7.cmake "$pkgdir/usr/lib/cmake/Shiboken-$pkgver/"
|
|
install -Dm 644 shiboken.pc "$pkgdir/usr/lib/pkgconfig/shiboken-py2.pc"
|
|
|
|
rm -rf "$pkgdir/usr/lib/python"*
|
|
rm -rf "$pkgdir/usr/lib/libshiboken"*
|
|
rm -rf "$pkgdir/usr/lib/pkgconfig/"
|
|
rm "$pkgdir"/usr/lib/cmake/Shiboken-$pkgver/ShibokenConfig*python*.cmake
|
|
}
|
|
|
|
package_python2-shiboken() {
|
|
pkgdesc="Support library for Python2 bindings"
|
|
depends=("qt4" "libxslt" "python2" "shiboken")
|
|
|
|
cd "$srcdir/Shiboken-$pkgver/build-py2"
|
|
make DESTDIR="$pkgdir" install
|
|
|
|
cd "$srcdir/Shiboken-$pkgver/build-py2"
|
|
cd data
|
|
install -Dm 644 ShibokenConfig-python2.7.cmake "$pkgdir/usr/lib/cmake/Shiboken-$pkgver/"
|
|
mv "$pkgdir"/usr/lib/pkgconfig/shiboken{,-py2}.pc
|
|
|
|
rm -rf "$pkgdir"/usr/{include,bin,share}
|
|
rm "$pkgdir/usr/lib/cmake/Shiboken-$pkgver/ShibokenConfigVersion.cmake"
|
|
rm "$pkgdir/usr/lib/cmake/Shiboken-$pkgver/ShibokenConfig.cmake"
|
|
}
|
|
|
|
package_python3-shiboken() {
|
|
pkgdesc="Support library for Python3 bindings"
|
|
depends=("qt4" "libxslt" "python3" "shiboken")
|
|
|
|
cd "$srcdir/Shiboken-$pkgver/build-py3"
|
|
make DESTDIR="$pkgdir" install
|
|
|
|
rm -rf "$pkgdir"/usr/{include,bin,share}
|
|
rm "$pkgdir/usr/lib/cmake/Shiboken-$pkgver/ShibokenConfigVersion.cmake"
|
|
rm "$pkgdir/usr/lib/cmake/Shiboken-$pkgver/ShibokenConfig.cmake"
|
|
}
|