1 # Build Class for Sip based Python Bindings
2 # (C) Michael 'Mickey' Lauer <mickey@Vanille.de>
5 # yes, python-sip is actually a build-time dependency, since
6 # the recipe installs sip.h
7 DEPENDS += "sip-native python-sip"
9 # default stuff, do not uncomment
10 # EXTRA_SIPTAGS = "-tWS_X11 -tQt_4_3_0"
13 if [ -z "${SIP_MODULES}" ]; then
14 MODULES="`ls sip/*mod.sip`"
16 MODULES="${SIP_MODULES}"
19 if [ -z "$MODULES" ]; then
20 die "SIP_MODULES not set and no modules found in $PWD"
22 oenote "using modules '${SIP_MODULES}' and tags '${EXTRA_SIPTAGS}'"
25 if [ -z "${EXTRA_SIPTAGS}" ]; then
26 die "EXTRA_SIPTAGS needs to be set!"
28 SIPTAGS="${EXTRA_SIPTAGS}"
31 if [ ! -z "${SIP_FEATURES}" ]; then
32 FEATURES="-z ${SIP_FEATURES}"
33 oenote "sip feature file: ${SIP_FEATURES}"
36 for module in $MODULES
39 echo "calling 'sip -I sip -I ${STAGING_SIPDIR} ${SIPTAGS} ${FEATURES} -c ${module} -b ${module}/${module}.pro.in sip/${module}/${module}mod.sip'"
40 sip -I ${STAGING_SIPDIR} -I sip ${SIPTAGS} ${FEATURES} -c ${module} -b ${module}/${module}.sbf \
41 sip/${module}/${module}mod.sip || die "Error calling sip on ${module}"
42 cat ${module}/${module}.sbf | sed s,target,TARGET, \
43 | sed s,sources,SOURCES, \
44 | sed s,headers,HEADERS, \
45 | sed s,"moc_HEADERS =","HEADERS +=", \
46 >${module}/${module}.pro
47 echo "TEMPLATE=lib" >>${module}/${module}.pro
48 [ "${module}" = "qt" ] && echo "" >>${module}/${module}.pro
49 [ "${module}" = "qtcanvas" ] && echo "" >>${module}/${module}.pro
50 [ "${module}" = "qttable" ] && echo "" >>${module}/${module}.pro
51 [ "${module}" = "qwt" ] && echo "" >>${module}/${module}.pro
52 [ "${module}" = "qtpe" ] && echo "" >>${module}/${module}.pro
53 [ "${module}" = "qtpe" ] && echo "LIBS+=-lqpe" >>${module}/${module}.pro
58 do_generate[deptask] = "do_populate_staging"
60 EXPORT_FUNCTIONS do_generate
62 addtask generate after do_unpack do_patch before do_configure