gnome-screensaver 2.28.3: fix up configure as well now
[openembedded.git] / classes / sip.bbclass
blob30c08b1ed9bdc555953af84f2318a52dfb9885a6
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"
12 sip_do_generate() {
13         if [ -z "${SIP_MODULES}" ]; then 
14                 MODULES="`ls sip/*mod.sip`"
15         else
16                 MODULES="${SIP_MODULES}"
17         fi
19         if [ -z "$MODULES" ]; then
20                 die "SIP_MODULES not set and no modules found in $PWD"
21         else
22                 oenote "using modules '${SIP_MODULES}' and tags '${EXTRA_SIPTAGS}'"
23         fi
25         if [ -z "${EXTRA_SIPTAGS}" ]; then
26                 die "EXTRA_SIPTAGS needs to be set!"
27         else
28                 SIPTAGS="${EXTRA_SIPTAGS}"
29         fi
31         if [ ! -z "${SIP_FEATURES}" ]; then
32                 FEATURES="-z ${SIP_FEATURES}"
33                 oenote "sip feature file: ${SIP_FEATURES}"
34         fi
36         for module in $MODULES
37         do
38                 install -d ${module}/
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
54                 true
55         done
58 do_generate[deptask] = "do_populate_staging"
60 EXPORT_FUNCTIONS do_generate
62 addtask generate after do_unpack do_patch before do_configure