[Kde-bindings] Progress report on Py*5 binding generation

Shaheed Haque srhaque at theiet.org
Fri Apr 22 19:43:41 UTC 2016


Hi Steve,

On 22 April 2016 at 08:35, Stephen Kelly <steveire at gmail.com> wrote:

> Stephen Kelly wrote:
>
> > "/usr/include/x86_64-linux-gnu/qt5,/usr/include/x86_64-linux-
> gnu/qt5/QtCore"
> > --select @kitemmodelsmod.sip sip cxx
>
> Oops, the cxx at the end should be removed, but the end result is still
> that
> the module is reported as having an error:
>
> $ ./create_script.sh
> ERROR: Parse error
> /usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:38[10]
> 'stddef.h' file not found
> 2016-04-22 09:35:03,078 __main__ INFO: Creating PyKF5/tmp/kitemmodels
> 2016-04-22 09:35:03,078 __main__ DEBUG:
> PyKF5/tmp/kitemmodels/kitemmodelsmod.sip.tmp
> 2016-04-22 09:35:03,078 __main__ INFO: /usr/bin/sip -c
> PyKF5/tmp/kitemmodels
> -b PyKF5/tmp/kitemmodels/module.sbf -x kitemmodelsmod_sip -x VendorID -t
> WS_X11 -t Qt_5_4_2 -x Py_v3 -I/usr/share/sip/PyQt5 -Isip
> PyKF5/tmp/kitemmodels/kitemmodelsmod.sip.tmp
> 2016-04-22 09:35:03,406 __main__ INFO: make -f module.Makefile
> g++ -c -g -O2 -fstack-protector-strong -Wformat -Werror=format-security  -
> D_FORTIFY_SOURCE=2 -fPIC -Wall -W -DNDEBUG -I. -I/usr/include/x86_64-linux-
> gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/python2.7
> -o sipkitemmodelscmodule.o sipkitemmodelscmodule.cpp
> g++ -c -g -O2 -fstack-protector-strong -Wformat -Werror=format-security  -
> D_FORTIFY_SOURCE=2 -fPIC -Wall -W -DNDEBUG -I. -I/usr/include/x86_64-linux-
> gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/python2.7
> -o sipkitemmodelsKSelectionProxyModel.o
> sipkitemmodelsKSelectionProxyModel.cpp
> g++ -Wl,-Bsymbolic-functions -Wl,-z,relro -shared -Wl,--version-
> script=kitemmodels.exp -o kitemmodels.so sipkitemmodelscmodule.o
> sipkitemmodelsKSelectionProxyModel.o -lm /usr/lib/x86_64-linux-
> gnu/libQt5Core.so /usr/lib/x86_64-linux-gnu/libKF5ItemModels.so
> /usr/lib/x86_64-linux-gnu/libpython2.7.so
> 2016-04-22 09:35:03,665 __main__ INFO: Publishing PyKF5.kitemmodels
> <module 'PyQt5.QtCore' from '/usr/lib/python2.7/dist-
> packages/PyQt5/QtCore.so'>
> Traceback (most recent call last):
>   File "./pythontest.py", line 7, in <module>
>     from PyKF5 import kitemmodels
> SystemError: dynamic module not initialized properly
>


I think the only thing you did wrong is the %Module declaration in
kitemmodelsmod.sip. If I change it from:

%Module PyKDE5.kitemmodels

to

%Module PyKF5.kitemmodels

then it all seems to work:

$ ./create_script.sh
ERROR: Parse error
/usr/lib/gcc/x86_64-linux-gnu/5.3.1/../../../../include/c++/5.3.1/cstddef:45[10]
'stddef.h' file not found
2016-04-22 20:39:23,846 __main__ INFO: Creating PyKF5/tmp/kitemmodels
2016-04-22 20:39:23,846 __main__ DEBUG:
PyKF5/tmp/kitemmodels/kitemmodelsmod.sip.tmp
2016-04-22 20:39:23,846 __main__ INFO: /usr/bin/sip -c
PyKF5/tmp/kitemmodels -b PyKF5/tmp/kitemmodels/module.sbf -x
kitemmodelsmod_sip -x VendorID -t WS_X11 -t Qt_5_5_1 -x Py_v3
-I/usr/share/sip/PyQt5 -Istevesip
PyKF5/tmp/kitemmodels/kitemmodelsmod.sip.tmp
2016-04-22 20:39:24,149 __main__ INFO: make -f module.Makefile
g++ -c -g -O2 -fstack-protector-strong -Wformat -Werror=format-security
-Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Wall -W -DNDEBUG -I.
-I/usr/include/x86_64-linux-gnu/qt5
-I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/python2.7 -o
sipkitemmodelscmodule.o sipkitemmodelscmodule.cpp
g++ -c -g -O2 -fstack-protector-strong -Wformat -Werror=format-security
-Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Wall -W -DNDEBUG -I.
-I/usr/include/x86_64-linux-gnu/qt5
-I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/python2.7 -o
sipkitemmodelsKSelectionProxyModel.o sipkitemmodelsKSelectionProxyModel.cpp
g++ -Wl,-Bsymbolic-functions -Wl,-z,relro -shared
-Wl,--version-script=kitemmodels.exp -o kitemmodels.so
sipkitemmodelscmodule.o sipkitemmodelsKSelectionProxyModel.o -lm
/usr/lib/x86_64-linux-gnu/libQt5Core.so
/usr/lib/x86_64-linux-gnu/libKF5ItemModels.so /usr/lib/x86_64-linux-gnu/
libpython2.7.so
2016-04-22 20:39:26,124 __main__ INFO: Publishing PyKF5.kitemmodels
<module 'PyQt5.QtCore' from '/usr/lib/python2.7/dist-packages/PyQt5/
QtCore.x86_64-linux-gnu.so'>

And just to be sure:

$ python -c 'from PyKF5 import kitemmodels; print(kitemmodels)'
<module 'PyKF5.kitemmodels' from 'PyKF5/kitemmodels.so'>

Thanks, Shaheed



> Thanks,
>
> Steve.
> _______________________________________________
> Kde-bindings mailing list
> Kde-bindings at kde.org
> https://mail.kde.org/mailman/listinfo/kde-bindings
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20160422/f4366bd5/attachment.html>


More information about the Kde-bindings mailing list