Bug 1490964

Summary: Build kf5 python bindings
Product: [Fedora] Fedora Reporter: Rex Dieter <rdieter>
Component: kf5Assignee: Rex Dieter <rdieter>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jgrulich, j, kde-sig, me, rdieter
Target Milestone: ---Keywords: Tracking
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1490997    
Bug Blocks:    

Description Rex Dieter 2017-09-12 15:42:30 UTC
Tracking bug for building kf5 python bindings (where supported)

Comment 1 Jason Tibbitts 2017-09-12 16:06:25 UTC
If anyone has suggestions about how to get started with this, I may be able to put in some effort.  But at this point I'm not even sure where to start.

Comment 2 Rex Dieter 2017-09-12 16:26:53 UTC
Just to document where I got stuck:

camke-extra-modules includes:
/usr/share/ECM/find-modules/FindPythonModuleGeneration.cmake

which looks for libclang and fails on fedora.  As far as I can tell, it's looking for libclang-X.Y.so, which is something that fedora's llvm/clang packaging doesn't seem to provide.

Comment 3 Rex Dieter 2017-09-12 16:33:31 UTC
Manually specifying:
 -Dlibclang_LIBRARY:PATH=%{_libdir}/libclang.so

gets a little further:

Traceback (most recent call last):
  File "/usr/share/ECM/find-modules/sip_generator.py", line 41, in <module>
    from clang import cindex
ImportError: No module named clang
-- sip_generator failed a self-check for the PythonModuleGeneration Module.
Traceback (most recent call last):
  File "/usr/share/ECM/find-modules/sip_generator.py", line 41, in <module>
    from clang import cindex
ImportError: No module named clang
-- sip_generator failed a self-check for the PythonModuleGeneration Module.

Comment 4 Rex Dieter 2017-09-13 15:01:43 UTC
Followup, following bug #1490997 , once we have clang python bindings available at buildtime, builds generally(*) succeed (tested using kf5-kconfig-5.38 module at least).


(*) generally, modulo other issues: doesn't reliably support shadow/out-of-src-tree or parallel builds

Comment 5 Jason Tibbitts 2017-09-13 15:10:19 UTC
One possibility is that we just include the three or four python files needed directly in the package, so that we can at least have a package to test.  They're only used at build time in any case.  It should be possible to just copy them someplace in the source directory in after %autosetup and then export PYTHONPATH so that they're used.

Comment 6 Rex Dieter 2017-09-13 15:17:30 UTC
Good idea.

next, could consider bundling them somewhere in kf5 or extra-cmake-modules (or whatever) to be usable by all kf5- framework packages with python bindings

Comment 7 Rex Dieter 2017-09-13 15:21:18 UTC
Comment #3 issue upstream at https://bugs.kde.org/show_bug.cgi?id=372311

Comment 8 Rex Dieter 2018-09-14 13:31:50 UTC
To document progress, I have a proof-of-concept implented in kf5-kconfig (tier1) package, to provide python bindings.

Now that python2-clang is available everywhere at least.  Of course now have to deal with python2 deprecation in f30+