void-packages/srcpkgs/sip/template
2016-08-10 07:49:13 +02:00

103 lines
3 KiB
Bash

# Template file for 'sip'
pkgname=sip
version=4.18.1
revision=1
wrksrc="sip-${version}"
hostmakedepends="python-devel python3.4-devel"
makedepends="${hostmakedepends}"
short_desc="Python extension module generator for C/C++ libraries"
maintainer="Alessio Sergi <al3hex@gmail.com>"
homepage="http://www.riverbankcomputing.co.uk/software/sip/intro"
license="GPL-2, GPL-3, SIP"
distfiles="${SOURCEFORGE_SITE}/pyqt/sip-${version}.tar.gz"
checksum=9bce7a2dbf7f105bf68ad1bab58eebc0ce33087ec40396da756463f086ffa290
_do_sip_build() {
local pyver=${1:-2.7} pysufx=
if [ "$pyver" != "2.7" ]; then
pysufx="m"
fi
python${pyver} configure.py \
CC="${CC}" CFLAGS="${CFLAGS}" CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \
LINK="${CXX}" LINK_SHLIB="${CXX}" LFLAGS="${LDFLAGS}" STRIP="" \
INCDIR="${XBPS_CROSS_BASE}/usr/include/python${pyver}${pysufx}"
make ${makejobs}
}
pre_build() {
cp -a ${wrksrc} /tmp/sip-3.4
mv /tmp/sip-3.4 ${wrksrc}
}
do_build() {
# build python-sip
_do_sip_build
# build python3.4-sip
cd ${wrksrc}/sip-3.4
_do_sip_build 3.4
}
do_install() {
# install sip
make DESTDIR=${DESTDIR} install -C sipgen
# install python-sip
make DESTDIR=${DESTDIR} install -C siplib
vinstall sipconfig.py 644 usr/lib/python2.7/site-packages
vinstall sipdistutils.py 644 usr/lib/python2.7/site-packages
# install python3.4-sip
cd ${wrksrc}/sip-3.4
make DESTDIR=${DESTDIR} install -C siplib
vinstall sipconfig.py 644 usr/lib/python3.4/site-packages
vinstall sipdistutils.py 644 usr/lib/python3.4/site-packages
}
post_install() {
# Remove references to hardening -specs.
sed -i ${DESTDIR}/usr/lib/python*/site-packages/sipconfig.py \
-e "s|-specs=/void-packages/common/environment/configure/gccspecs/hardened-cc1||g" \
-e "s|-specs=/void-packages/common/environment/configure/gccspecs/hardened-ld||g"
}
python-sip_package() {
lib32disabled=yes
depends="${sourcepkg}-${version}_${revision} python"
pycompile_module="sipconfig.py"
short_desc="Python2 SIP bindings"
pkg_install() {
vmove usr/lib/python2.7/site-packages/sip.so
vmove usr/lib/python2.7/site-packages/sipconfig.py
vmove usr/lib/python2.7/site-packages/sip.pyi
}
}
python-sip-devel_package() {
depends="python-sip-${version}_${revision}"
pycompile_module="sipdistutils.py"
short_desc="Python2 SIP bindings (development files)"
pkg_install() {
vmove usr/include/python2.7
vmove usr/lib/python2.7/site-packages/sipdistutils.py
}
}
python3.4-sip_package() {
lib32disabled=yes
depends="${sourcepkg}-${version}_${revision} python3.4"
pycompile_version="3.4"
pycompile_module="sipconfig.py"
short_desc="Python3.4 SIP bindings"
pkg_install() {
vmove usr/lib/python3.4/site-packages/sip.so
vmove usr/lib/python3.4/site-packages/sipconfig.py
vmove usr/lib/python3.4/site-packages/sip.pyi
}
}
python3.4-sip-devel_package() {
depends="python3.4-sip-${version}_${revision}"
pycompile_version="3.4"
pycompile_module="sipdistutils.py"
short_desc="Python3.4 SIP bindings (development files)"
pkg_install() {
vmove usr/include/python3.4m
vmove usr/lib/python3.4/site-packages/sipdistutils.py
}
}