wxwidgets: fix install errors

There are errors during do install. So link files 'wx-config' and 'wxrc'
are not created, and rename failed either:

| CMake Error: failed to create symbolic link '/usr/bin/wx-config': Permission denied
| Error renaming from "/usr/bin/wxrc" to "/usr/bin/wxrc-3.1": No such file or directory
| CMake Error: failed to create symbolic link '/usr/bin/wxrc': Permission denied

Respect variable 'DESTDIR' to make it work as expect.

And package ${libdir}/wx/config/gtk3-unicode-3.1 to ${PN}-dev that
/usr/bin/wx-config from ${PN}-dev links to it.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Kai Kang 2022-03-10 07:28:51 +08:00 committed by Khem Raj
parent 669b1eb6ba
commit 10e9b26163
2 changed files with 60 additions and 1 deletions

View File

@ -0,0 +1,55 @@
There are errors during do install. So link files 'wx-config' and 'wxrc' are
not created, and rename failed either:
| CMake Error: failed to create symbolic link '/usr/bin/wx-config': Permission denied
| Error renaming from "/usr/bin/wxrc" to "/usr/bin/wxrc-3.1": No such file or directory
| CMake Error: failed to create symbolic link '/usr/bin/wxrc': Permission denied
Respect variable 'DESTDIR' to make it work as expect.
Upstream-Status: Pending
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
build/cmake/install.cmake | 4 ++--
build/cmake/utils/CMakeLists.txt | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/build/cmake/install.cmake b/build/cmake/install.cmake
index c850c51844..5cbc67daa1 100644
--- a/build/cmake/install.cmake
+++ b/build/cmake/install.cmake
@@ -46,8 +46,8 @@ else()
install(DIRECTORY DESTINATION "bin")
install(CODE "execute_process( \
COMMAND ${CMAKE_COMMAND} -E create_symlink \
- ${CMAKE_INSTALL_PREFIX}/lib${wxPLATFORM_LIB_DIR}/wx/config/${wxBUILD_FILE_ID} \
- ${CMAKE_INSTALL_PREFIX}/bin/wx-config \
+ ../lib${wxPLATFORM_LIB_DIR}/wx/config/${wxBUILD_FILE_ID} \
+ \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/wx-config \
)"
)
endif()
diff --git a/build/cmake/utils/CMakeLists.txt b/build/cmake/utils/CMakeLists.txt
index 4108d6a723..fbac6bb533 100644
--- a/build/cmake/utils/CMakeLists.txt
+++ b/build/cmake/utils/CMakeLists.txt
@@ -34,14 +34,14 @@ if(wxUSE_XRC)
if(NOT MSVC)
install(CODE "execute_process( \
COMMAND ${CMAKE_COMMAND} -E rename \
- ${CMAKE_INSTALL_PREFIX}/bin/wxrc${EXE_SUFFIX} \
- ${CMAKE_INSTALL_PREFIX}/bin/wxrc-${wxMAJOR_VERSION}.${wxMINOR_VERSION}${EXE_SUFFIX} \
+ \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/wxrc${EXE_SUFFIX} \
+ \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/wxrc-${wxMAJOR_VERSION}.${wxMINOR_VERSION}${EXE_SUFFIX} \
)"
)
install(CODE "execute_process( \
COMMAND ${CMAKE_COMMAND} -E create_symlink \
- ${CMAKE_INSTALL_PREFIX}/bin/wxrc-${wxMAJOR_VERSION}.${wxMINOR_VERSION}${EXE_SUFFIX} \
- ${CMAKE_INSTALL_PREFIX}/bin/wxrc${EXE_SUFFIX} \
+ wxrc-${wxMAJOR_VERSION}.${wxMINOR_VERSION}${EXE_SUFFIX} \
+ \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/wxrc${EXE_SUFFIX} \
)"
)
endif()

View File

@ -25,6 +25,7 @@ SRC_URI = " \
git://github.com/wxWidgets/wxWidgets.git;branch=master;protocol=https \
file://0001-wx-config.in-Disable-cross-magic-it-does-not-work-fo.patch \
file://fix-libdir-for-multilib.patch \
file://respect-DESTDIR-when-create-link.patch \
"
PV = "3.1.4"
SRCREV= "6cdaedd42ba59331b3dc4ead50e0bac76ae14c19"
@ -103,4 +104,7 @@ FILES:${PN} += " \
${libdir}/wx/ \
"
FILES:${PN}-dev += "${libdir}/wx/include/"
FILES:${PN}-dev += " \
${libdir}/wx/include/ \
${libdir}/wx/config/ \
"