clang: Include the libclang python bindings in the build
PATCH v2 1/1 clang: Include the libclang python bindings in the build
Modify the clang recipe to provide also the python module 'clang' when building libclang.
---
v2 changes:
- used PACKAGECONFIG and default on
--- meta/recipes-devtools/clang/clang_git.bb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
meta/recipes-devtools/clang/clang_git.bb +5 -2
@@ -49,7 +49,7 @@ def get_clang_host_arch(bb, d): def get_clang_target_arch(bb, d): return get_clang_arch(bb, d, 'TARGET_ARCH') -PACKAGECONFIG_CLANG_COMMON = "build-id eh libedit rtti shared-libs \ +PACKAGECONFIG_CLANG_COMMON = "build-id eh libedit rtti shared-libs libclang-python \ ${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'compiler-rt libcplusplus libomp unwindlib', '', d)} \ "
@@ -90,6 +90,7 @@ PACKAGECONFIG[split-dwarf] = "-DLLVM_USE_SPLIT_DWARF=ON,-DLLVM_USE_SPLIT_DWARF=O PACKAGECONFIG[terminfo] = "-DLLVM_ENABLE_TERMINFO=ON -DCOMPILER_RT_TERMINFO_LIB=ON,-DLLVM_ENABLE_TERMINFO=OFF -DCOMPILER_RT_TERMINFO_LIB=OFF,ncurses," PACKAGECONFIG[thin-lto] = "-DLLVM_ENABLE_LTO=Thin -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils," PACKAGECONFIG[unwindlib] = "-DCLANG_DEFAULT_UNWINDLIB=libunwind,-DCLANG_DEFAULT_UNWINDLIB=libgcc,," +PACKAGECONFIG[libclang-python] = "-DCLANG_PYTHON_BINDINGS_VERSIONS=${PYTHON_BASEVERSION},," OECMAKE_SOURCEPATH = "${S}/llvm"
@@ -312,7 +313,7 @@ PROVIDES:append:class-native = " llvm-native libclc-native" PROVIDES:append:class-target = " llvm libclc" PROVIDES:append:class-nativesdk = " nativesdk-llvm nativesdk-libclc" -PACKAGES =+ "${PN}-libllvm ${PN}-lldb-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools ${PN}-clc \ +PACKAGES =+ "${PN}-libllvm ${PN}-lldb-python ${PN}-libclang-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools ${PN}-clc \ libclang lldb lldb-server liblldb llvm-linker-tools"
@@ -342,6 +343,8 @@ FILES:${PN}-libclang-cpp = "${libdir}/libclang-cpp.so.*" FILES:${PN}-lldb-python = "${libdir}/python*/site-packages/lldb/*" +FILES:${PN}-libclang-python = "${libdir}/python*/site-packages/clang/*" + FILES:${PN}-tidy = "${bindir}/*clang-tidy*" FILES:${PN}-format = "${bindir}/*clang-format*"
Signature · 1 line
2.34.1
Hi Luca,
Quoted 42 lines · luca fancellu via lists.openembedded.org
Modify the clang recipe to provide also the python module 'clang' when building libclang.
Signed-off-by Luca Fancellu <[email protected]>---
v2 changes:
- used PACKAGECONFIG and default on--- meta/recipes-devtools/clang/clang_git.bb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)meta/recipes-devtools/clang/clang_git.bb +3
-2@@ -49,7 +49,7 @@ def get_clang_host_arch(bb, d): def get_clang_target_arch(bb, d): return get_clang_arch(bb, d, 'TARGET_ARCH') -PACKAGECONFIG_CLANG_COMMON = "build-id eh libedit rtti shared-libs \ +PACKAGECONFIG_CLANG_COMMON = "build-id eh libedit rtti shared-libs libclang-python \ ${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'compiler-rt libcplusplus libomp unwindlib', '', d)} \ "@@ -90,6 +90,7 @@ PACKAGECONFIG[split-dwarf] = "-DLLVM_USE_SPLIT_DWARF=ON,-DLLVM_USE_SPLIT_DWARF=O PACKAGECONFIG[terminfo] = "-DLLVM_ENABLE_TERMINFO=ON -DCOMPILER_RT_TERMINFO_LIB=ON,-DLLVM_ENABLE_TERMINFO=OFF -DCOMPILER_RT_TERMINFO_LIB=OFF,ncurses," PACKAGECONFIG[thin-lto] = "-DLLVM_ENABLE_LTO=Thin -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils," PACKAGECONFIG[unwindlib] = "-DCLANG_DEFAULT_UNWINDLIB=libunwind,-DCLANG_DEFAULT_UNWINDLIB=libgcc,," +PACKAGECONFIG[libclang-python] = "-DCLANG_PYTHON_BINDINGS_VERSIONS=${PYTHON_BASEVERSION},," OECMAKE_SOURCEPATH = "${S}/llvm"@@ -312,7 +313,7 @@ PROVIDES:append:class-native = " llvm-native libclc-native" PROVIDES:append:class-target = " llvm libclc" PROVIDES:append:class-nativesdk = " nativesdk-llvm nativesdk-libclc" -PACKAGES =+ "${PN}-libllvm ${PN}-lldb-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools ${PN}-clc \ +PACKAGES =+ "${PN}-libllvm ${PN}-lldb-python ${PN}-libclang-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools ${PN}-clc \ libclang lldb lldb-server liblldb llvm-linker-tools"
meta/recipes-devtools/clang/clang_git.bb FILES:${PN}-libclang-cpp = "${libdir}/libclang-cpp.so.*" · line 347
Quoted 5 lines
meta/recipes-devtools/clang/clang_git.bb +2
-0@@ -342,6 +343,8 @@ FILES:${PN}-libclang-cpp = "${libdir}/libclang-cpp.so.*" FILES:${PN}-lldb-python = "${libdir}/python*/site-packages/lldb/*" +FILES:${PN}-libclang-python = "${libdir}/python*/site-packages/clang/*" +
Wondering if we cannot use ${PYTHON_SITEPACKAGES_DIR}/clang/* here from python3-dir.bbclass? (same for lldb-python and do_install:append()?).
Cheers,
Quentin
Hi Quentin,
Quoted 35 lines · Quentin Schulz
Hi Luca,
Quoted 30 lines · luca fancellu via lists.openembedded.org
Modify the clang recipe to provide also the python module 'clang' when building libclang.
Signed-off-by Luca Fancellu <[email protected]>---
v2 changes:
- used PACKAGECONFIG and default on--- meta/recipes-devtools/clang/clang_git.bb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)meta/recipes-devtools/clang/clang_git.bb +2
-0@@ -49,7 +49,7 @@ def get_clang_host_arch(bb, d): def get_clang_target_arch(bb, d): return get_clang_arch(bb, d, 'TARGET_ARCH') -PACKAGECONFIG_CLANG_COMMON = "build-id eh libedit rtti shared-libs \ +PACKAGECONFIG_CLANG_COMMON = "build-id eh libedit rtti shared-libs libclang-python \ ${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'compiler-rt libcplusplus libomp unwindlib', '', d)} \ " @@ -90,6 +90,7 @@ PACKAGECONFIG[split-dwarf] = "-DLLVM_USE_SPLIT_DWARF=ON,-DLLVM_USE_SPLIT_DWARF=O PACKAGECONFIG[terminfo] = "-DLLVM_ENABLE_TERMINFO=ON -DCOMPILER_RT_TERMINFO_LIB=ON,-DLLVM_ENABLE_TERMINFO=OFF -DCOMPILER_RT_TERMINFO_LIB=OFF,ncurses," PACKAGECONFIG[thin-lto] = "-DLLVM_ENABLE_LTO=Thin -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils," PACKAGECONFIG[unwindlib] = "-DCLANG_DEFAULT_UNWINDLIB=libunwind,-DCLANG_DEFAULT_UNWINDLIB=libgcc,," +PACKAGECONFIG[libclang-python] = "-DCLANG_PYTHON_BINDINGS_VERSIONS=${PYTHON_BASEVERSION},," OECMAKE_SOURCEPATH = "${S}/llvm" @@ -312,7 +313,7 @@ PROVIDES:append:class-native = " llvm-native libclc-native" PROVIDES:append:class-target = " llvm libclc" PROVIDES:append:class-nativesdk = " nativesdk-llvm nativesdk-libclc" -PACKAGES =+ "${PN}-libllvm ${PN}-lldb-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools ${PN}-clc \
Quoted 8 lines
meta/recipes-devtools/clang/clang_git.bb
Quoted 6 lines
meta/recipes-devtools/clang/clang_git.bb +2
-0+PACKAGES =+ "${PN}-libllvm ${PN}-lldb-python ${PN}-libclang-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools ${PN}-clc \ libclang lldb lldb-server liblldb llvm-linker-tools" @@ -342,6 +343,8 @@ FILES:${PN}-libclang-cpp = "${libdir}/libclang-cpp.so.*" FILES:${PN}-lldb-python = "${libdir}/python*/site-packages/lldb/*" +FILES:${PN}-libclang-python = "${libdir}/python*/site-packages/clang/*" +Wondering if we cannot use ${PYTHON_SITEPACKAGES_DIR}/clang/* here from python3-dir.bbclass? (same for lldb-python and do_install:append()?).
it would surely work, I can do the change on the bits I’m touching, but I’m not confident to change the rest, is that ok for you?
Cheers,
Luca
Hi Luca,
Quoted 46 lines · Luca Fancellu
Hi Quentin,
Quoted 35 lines · Quentin Schulz
Hi Luca,
Quoted 30 lines · luca fancellu via lists.openembedded.org
Modify the clang recipe to provide also the python module 'clang' when building libclang.
Signed-off-by Luca Fancellu <[email protected]>---
v2 changes:
- used PACKAGECONFIG and default on--- meta/recipes-devtools/clang/clang_git.bb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)meta/recipes-devtools/clang/clang_git.bb +2
-0@@ -49,7 +49,7 @@ def get_clang_host_arch(bb, d): def get_clang_target_arch(bb, d): return get_clang_arch(bb, d, 'TARGET_ARCH') -PACKAGECONFIG_CLANG_COMMON = "build-id eh libedit rtti shared-libs \ +PACKAGECONFIG_CLANG_COMMON = "build-id eh libedit rtti shared-libs libclang-python \ ${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'compiler-rt libcplusplus libomp unwindlib', '', d)} \ " @@ -90,6 +90,7 @@ PACKAGECONFIG[split-dwarf] = "-DLLVM_USE_SPLIT_DWARF=ON,-DLLVM_USE_SPLIT_DWARF=O PACKAGECONFIG[terminfo] = "-DLLVM_ENABLE_TERMINFO=ON -DCOMPILER_RT_TERMINFO_LIB=ON,-DLLVM_ENABLE_TERMINFO=OFF -DCOMPILER_RT_TERMINFO_LIB=OFF,ncurses," PACKAGECONFIG[thin-lto] = "-DLLVM_ENABLE_LTO=Thin -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils," PACKAGECONFIG[unwindlib] = "-DCLANG_DEFAULT_UNWINDLIB=libunwind,-DCLANG_DEFAULT_UNWINDLIB=libgcc,," +PACKAGECONFIG[libclang-python] = "-DCLANG_PYTHON_BINDINGS_VERSIONS=${PYTHON_BASEVERSION},," OECMAKE_SOURCEPATH = "${S}/llvm" @@ -312,7 +313,7 @@ PROVIDES:append:class-native = " llvm-native libclc-native" PROVIDES:append:class-target = " llvm libclc" PROVIDES:append:class-nativesdk = " nativesdk-llvm nativesdk-libclc" -PACKAGES =+ "${PN}-libllvm ${PN}-lldb-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools ${PN}-clc \Quoted 8 lines
meta/recipes-devtools/clang/clang_git.bb
Quoted 6 lines
meta/recipes-devtools/clang/clang_git.bb +2
-0+PACKAGES =+ "${PN}-libllvm ${PN}-lldb-python ${PN}-libclang-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools ${PN}-clc \ libclang lldb lldb-server liblldb llvm-linker-tools" @@ -342,6 +343,8 @@ FILES:${PN}-libclang-cpp = "${libdir}/libclang-cpp.so.*" FILES:${PN}-lldb-python = "${libdir}/python*/site-packages/lldb/*" +FILES:${PN}-libclang-python = "${libdir}/python*/site-packages/clang/*" +Wondering if we cannot use ${PYTHON_SITEPACKAGES_DIR}/clang/* here from python3-dir.bbclass? (same for lldb-python and do_install:append()?).
Quoted 3 lines
it would surely work, I can do the change on the bits I’m touching, but I’m not confident to change the rest, is that ok for you?
It's a good start :)
PYTHON_SITEPACKAGES_DIR has a harcoded python version, so I hope that this is fine. I assume this shouldn't be an issue for the native class as we don't generate packages for the native class anyway if I remember correctly (considering that I'm not sure whether we take python from the host (as it is an actual dependency of BitBake already) or from the native sysroot). So, the change in do_install:append() is probably not the best idea for that reason.
Cheers,
Quentin