void-packages/srcpkgs/shiboken/template
Alessio Sergi 29032cfb18 shiboken: rebuild for Python 3.5
Switch to python3-* pkgs.
Convert python3.4-* pkgs into dummy pkgs.
2016-10-17 02:30:47 +02:00

126 lines
3.9 KiB
Bash

# Template file for 'shiboken'
pkgname=shiboken
version=1.2.2
revision=3
wrksrc="shiboken-${version}"
hostmakedepends="cmake"
makedepends="python-devel python3-devel qt-devel libxml2-devel libxslt-devel"
short_desc="CPython bindings generator for C++ libraries"
maintainer="Enno Boland <gottox@voidlinux.eu>"
homepage="http://www.pyside.org"
license="LGPL-2.1"
distfiles="https://download.qt.io/official_releases/pyside/shiboken-${version}.tar.bz2"
checksum=7625bbcf1fe313fd910c6b8c9cf49ac5495499f9d00867115a2f1f2a69fce5c4
pre_build() {
# Fix inconsistent naming of libshiboken.so and ShibokenConfig.cmake
sed -i "/get_config_var('SOABI')/d" cmake/Modules/FindPython3InterpWithDebug.cmake
}
do_build() {
local args= configure_args="
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTS=OFF"
for pyver in $py2_ver $py3_ver; do
args=
if [ "$pyver" = "$py2_ver" ]; then
args="-DPYTHON_SUFFIX=-python$py2_ver"
else
args="-DUSE_PYTHON3=yes"
fi
[ ! -d build-${pyver} ] && mkdir build-${pyver}
pushd build-${pyver}
cmake .. ${configure_args} ${args}
make ${makejobs}
popd
done
}
do_install() {
for pyver in $py2_ver $py3_ver; do
make -C build-${pyver} DESTDIR=${DESTDIR} install
done
}
post_install() {
# Fix conflict between .pc files
rm -f ${DESTDIR}/usr/lib/pkgconfig/*
for pyver in $py2_ver $py3_ver; do
vinstall build-${pyver}/data/shiboken.pc 644 \
usr/lib/pkgconfig shiboken-python${pyver}.pc
done
}
libshiboken-common-devel_package() {
depends="${sourcepkg}-${version}_${revision}"
short_desc+=" - common development files"
pkg_install() {
vmove usr/include
vmove usr/lib/cmake/Shiboken-${version}/ShibokenConfig.cmake
vmove usr/lib/cmake/Shiboken-${version}/ShibokenConfigVersion.cmake
}
}
libshiboken-python-devel_package() {
depends="libshiboken-common-devel-${version}_${revision}
libshiboken-python-${version}_${revision}"
short_desc="Python2 shiboken bindings - shared library (development files)"
pkg_install() {
vmove usr/lib/cmake/Shiboken-${version}/ShibokenConfig-python${py2_ver}.cmake
vmove usr/lib/pkgconfig/shiboken-python${py2_ver}.pc
vmove usr/lib/libshiboken-python${py2_ver}.so
}
}
libshiboken-python_package() {
short_desc="Python2 shiboken bindings - shared library"
pkg_install() {
vmove usr/lib/libshiboken-python${py2_ver}.so.${version%.*}
vmove usr/lib/libshiboken-python${py2_ver}.so.${version}
}
}
python-shiboken_package() {
short_desc="Python2 shiboken bindings"
pkg_install() {
vmove ${py2_sitelib}/shiboken.so
}
}
libshiboken-python3-devel_package() {
replaces="libshiboken-python3.4-devel>=0"
depends="libshiboken-common-devel-${version}_${revision}
libshiboken-python3-${version}_${revision}"
short_desc="Python3 shiboken bindings - shared library (development files)"
pkg_install() {
vmove usr/lib/cmake/Shiboken-${version}/ShibokenConfig-python${py3_ver}.cmake
vmove usr/lib/pkgconfig/shiboken-python${py3_ver}.pc
vmove usr/lib/libshiboken-python${py3_ver}.so
}
}
libshiboken-python3_package() {
replaces="libshiboken-python3.4>=0"
short_desc="Python3 shiboken bindings - shared library"
pkg_install() {
vmove usr/lib/libshiboken-python${py3_ver}.so.${version%.*}
vmove usr/lib/libshiboken-python${py3_ver}.so.${version}
}
}
python3-shiboken_package() {
replaces="python3.4-shiboken>=0"
short_desc="Python3 shiboken bindings"
pkg_install() {
vmove ${py3_sitelib}/shiboken.so
}
}
libshiboken-python3.4-devel_package() {
build_style=meta
short_desc="Python3.4 shiboken bindings (transitional dummy package)"
depends="libshiboken-python3-devel>=${version}_${revision}"
}
libshiboken-python3.4_package() {
build_style=meta
short_desc="Python3.4 shiboken bindings (transitional dummy package)"
depends="libshiboken-python3>=${version}_${revision}"
}
python3.4-shiboken_package() {
build_style=meta
short_desc="Python3.4 shiboken bindings (transitional dummy package)"
depends="python3-shiboken>=${version}_${revision}"
}