Skip to contentSkip to conversation

libyui: make resulting cmake config relocatable

PATCH New Pascal Bach 1 participant 2 messages Oct 30, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 libyui: make resulting cmake config relocatable

---
 ...0001-Use-relative-install-paths-for-CMake.patch | 130 +++++++++++++++++++++
 meta-oe/recipes-graphics/libyui/libyui_git.bb      |   1 +
 2 files changed, 131 insertions(+)
 create mode 100644 meta-oe/recipes-graphics/libyui/libyui/0001-Use-relative-install-paths-for-CMake.patch
meta-oe/recipes-graphics/libyui/libyui/0001-Use-relative-install-paths-for-CMake.patch new file +130 -0
new file mode 100644
index 000000000..11a1678a4
@@ -0,0 +1,130 @@
+From d24c2516ae25d0ee180c1020e52114ea32230585 Mon Sep 17 00:00:00 2001
+From: Pascal Bach <[email protected]>
+Date: Mon, 29 Oct 2018 18:03:43 +0100
+Subject: [PATCH] Use relative install paths for CMake
+
+Files are installed via a special _PREFIX variant of the INSTALL_???_DIR
+variable which is an absolute path.
+
+This not only is redundant if CMAKE_INTALL_PREFIX is set but it even causes
+the resulting Config.cmake to be non relocatable. This means it contains absolute
+paths to the build host. This is a problem for cross compilation in Yocto.
+
+This change gets rid of the absolute path and removes the no longer needed
+_PREFIX variants.
+
+Upstream-Status: Submitted [https://github.com/libyui/libyui/pull/140]
+Signed-off-by: Pascal Bach <[email protected]>
+---
+ buildtools/LibyuiCommon.cmake | 35 ++++++++++++++---------------------
+ 1 file changed, 14 insertions(+), 21 deletions(-)
+
+diff --git a/buildtools/LibyuiCommon.cmake b/buildtools/LibyuiCommon.cmake
+index e6fbefd..5e2fc0d 100644
+--- a/buildtools/LibyuiCommon.cmake
++++ b/buildtools/LibyuiCommon.cmake
+@@ -258,13 +258,6 @@ MACRO( SET_ENVIRONMENT )	# setup the environment vars
+ 
+   SET( INSTALL_DOC_DIR "${DOC_DIR}" )
+ 
+-  FOREACH( p "DOC" LIB INCLUDE CMAKE PKGCONFIG BUILDTOOLS )
+-    SET( var "INSTALL_${p}_DIR" )
+-    IF( NOT IS_ABSOLUTE "${${var}}" )
+-      SET( ${var}_PREFIX "${YPREFIX}/${${var}}" )
+-    ENDIF( NOT IS_ABSOLUTE "${${var}}" )
+-  ENDFOREACH()
+-
+ ENDMACRO( SET_ENVIRONMENT )
+ 
+ MACRO( SET_SONAME )
+@@ -359,7 +352,7 @@ MACRO( SET_AUTODOCS )		# looks for doxygen, dot and latex and setup autodocs acc
+       IF( INSTALL_DOCS OR DOCS_ONLY )
+         INSTALL(
+           FILES "${CMAKE_BINARY_DIR}/doc/latex/refman.pdf"
+-          DESTINATION "${INSTALL_DOC_DIR_PREFIX}"
++          DESTINATION "${INSTALL_DOC_DIR}"
+         )
+       ENDIF( INSTALL_DOCS OR DOCS_ONLY )
+ 
+@@ -379,7 +372,7 @@ MACRO( SET_AUTODOCS )		# looks for doxygen, dot and latex and setup autodocs acc
+       FOREACH( p css gif html jpg js png tag )
+         INSTALL(
+           DIRECTORY "${CMAKE_BINARY_DIR}/doc/html"
+-          DESTINATION "${INSTALL_DOC_DIR_PREFIX}"
++          DESTINATION "${INSTALL_DOC_DIR}"
+           FILES_MATCHING PATTERN "*.${p}"
+         )
+       ENDFOREACH()
+@@ -638,32 +631,32 @@ MACRO( SET_INSTALL_TARGET )
+ 
+ INSTALL(
+   EXPORT ${PROJECTNAME_UC}LibraryDepends
+-  DESTINATION "${INSTALL_CMAKE_DIR_PREFIX}"
++  DESTINATION "${INSTALL_CMAKE_DIR}"
+   COMPONENT dev
+ )
+ 
+ FOREACH( p Config.cmake ConfigVersion.cmake )
+   INSTALL(
+     FILES "${CMAKE_BINARY_DIR}/${PROJECTNAME_UC}${p}"
+-    DESTINATION "${INSTALL_CMAKE_DIR_PREFIX}"
++    DESTINATION "${INSTALL_CMAKE_DIR}"
+ )
+ ENDFOREACH( p Config.cmake ConfigVersion.cmake )
+ 
+ INSTALL(
+   FILES "${CMAKE_BINARY_DIR}/${PROJECTNAME}.pc"
+-  DESTINATION "${INSTALL_PKGCONFIG_DIR_PREFIX}"
++  DESTINATION "${INSTALL_PKGCONFIG_DIR}"
+ )
+ 
+ IF( NOT PLUGINNAME AND NOT EXTENSIONNAME )
+   INSTALL(
+     DIRECTORY "${BUILDTOOLS_DIR}"
+-    DESTINATION "${INSTALL_BUILDTOOLS_DIR_PREFIX}"
++    DESTINATION "${INSTALL_BUILDTOOLS_DIR}"
+   )
+ ENDIF( NOT PLUGINNAME AND NOT EXTENSIONNAME )
+ 
+ INSTALL(
+   FILES ${BUILDTOOLS_LIST}
+-  DESTINATION "${INSTALL_BUILDTOOLS_DIR_PREFIX}"
++  DESTINATION "${INSTALL_BUILDTOOLS_DIR}"
+ )
+ 
+ ENDMACRO( SET_INSTALL_TARGET )
+@@ -724,9 +717,9 @@ MACRO( PROCESS_SOURCES )
+   INSTALL(
+     TARGETS ${TARGETLIB}
+     EXPORT ${PROJECTNAME_UC}LibraryDepends
+-    LIBRARY DESTINATION "${INSTALL_LIB_DIR_PREFIX}"
+-    ARCHIVE DESTINATION "${INSTALL_LIB_DIR_PREFIX}"
+-    PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDE_DIR_PREFIX}"
++    LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
++    ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
++    PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDE_DIR}"
+     COMPONENT dev
+   )
+ 
+@@ -746,9 +739,9 @@ MACRO( PROCESS_SOURCES )
+     INSTALL(
+       TARGETS ${TARGETLIB}_static
+       EXPORT ${PROJECTNAME_UC}LibraryDepends
+-      LIBRARY DESTINATION "${INSTALL_LIB_DIR_PREFIX}"
+-      ARCHIVE DESTINATION "${INSTALL_LIB_DIR_PREFIX}"
+-      PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDE_DIR_PREFIX}"
++      LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
++      ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
++      PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDE_DIR}"
+       COMPONENT dev
+      )
+ 
+@@ -776,7 +769,7 @@ MACRO( PROCESS_EXAMPLES )
+ 
+   INSTALL(
+     FILES ${EXAMPLES_LIST}
+-    DESTINATION "${INSTALL_DOC_DIR_PREFIX}/examples"
++    DESTINATION "${INSTALL_DOC_DIR}/examples"
+   )
+ 
+ ENDMACRO( PROCESS_EXAMPLES )
meta-oe/recipes-graphics/libyui/libyui_git.bb +1 -0
index 2826652cb..d313fb02d 100644
@@ -8,6 +8,7 @@ LIC_FILES_CHKSUM = "file://COPYING.gpl-3;md5=d32239bcb673463ab874e80d47fae504 \
 SRC_URI = "git://github.com/libyui/libyui.git \
            file://0001-Fix-build-with-clang.patch \
            file://0001-Use-curly-braces-for-MAKE-variable.patch \
+           file://0001-Use-relative-install-paths-for-CMake.patch \
            "
 
 PV = "3.3.3+git"
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/2 libyui-ncurses: fix ncurses find module

This makes the module look in the standard locations instead of only some hard coded ones.

---
 .../0003-Simplify-ncurses-finding-module.patch     | 35 ++++++++++++++++++++++
 .../recipes-graphics/libyui/libyui-ncurses_git.bb  |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 meta-oe/recipes-graphics/libyui/libyui-ncurses/0003-Simplify-ncurses-finding-module.patch
meta-oe/recipes-graphics/libyui/libyui-ncurses/0003-Simplify-ncurses-finding-module.patch new file +35 -0
new file mode 100644
index 000000000..2520ac46f
@@ -0,0 +1,35 @@
+From c2291fe28dc5682f81804941512431642975cf21 Mon Sep 17 00:00:00 2001
+From: Pascal Bach <[email protected]>
+Date: Mon, 29 Oct 2018 18:17:32 +0100
+Subject: [PATCH] Simplify ncurses finding module
+
+CMake will automatically look in the right locations, there is no need to
+re-implement the logic with a for loop and NO_DEFAULT_PATH.
+
+It is already done like this to file the headers.
+
+Upstream-Status: Submitted [https://github.com/libyui/libyui-ncurses/pull/73]
+Signed-off-by: Pascal Bach <[email protected]>
+---
+ cmake/Modules/FindCurses6.cmake | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/cmake/Modules/FindCurses6.cmake b/cmake/Modules/FindCurses6.cmake
+index 0bf02c3..e298d5d 100644
+--- a/cmake/Modules/FindCurses6.cmake
++++ b/cmake/Modules/FindCurses6.cmake
+@@ -5,11 +5,9 @@
+ #  CURSES6_LIBRARIES - The libraries needed to use Curses6
+ #  CURSES6_DEFINITIONS - Compiler switches required for using Curses6
+ 
+-FOREACH(path ${CMAKE_LIBRARY_PATH} /usr/${LIB_DIR})
+-  FIND_LIBRARY(CURSES6_NCURSESW_LIBRARY NAMES ncursesw PATHS ${path}/ncurses6 ${path} NO_DEFAULT_PATH)
+-  FIND_LIBRARY(CURSES6_PANELW_LIBRARY NAMES panelw PATHS ${path}/ncurses6 ${path} NO_DEFAULT_PATH)
+-  FIND_LIBRARY(CURSES6_TINFO_LIBRARY NAMES tinfo PATHS ${path}/ncurses6 ${path} NO_DEFAULT_PATH)
+-ENDFOREACH()
++FIND_LIBRARY(CURSES6_NCURSESW_LIBRARY NAMES ncursesw PATH_SUFFIXES ncurses6)
++FIND_LIBRARY(CURSES6_PANELW_LIBRARY NAMES panelw PATH_SUFFIXES ncurses6)
++FIND_LIBRARY(CURSES6_TINFO_LIBRARY NAMES tinfo PATH_SUFFIXES ncurses6)
+ 
+ SET(CURSES6_LIBRARIES ${CURSES6_NCURSESW_LIBRARY} ${CURSES6_PANELW_LIBRARY})
+ # tinfo is optional (in 12.1 is not there)
meta-oe/recipes-graphics/libyui/libyui-ncurses_git.bb +1 -0
index 4fafce166..18ea2e828 100644
@@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING.lgpl-3;md5=e6a600fd5e1d9cbde2d983680233ad02 \
 SRC_URI = "git://github.com/libyui/libyui-ncurses.git \
            file://0001-Use-override-consistently.patch \
            file://0002-Define-own-resize-in-NCPad-and-fix-param-type-of-Set.patch \
+           file://0003-Simplify-ncurses-finding-module.patch \
           "
 
 SRC_URI_append_class-target = " file://0001-Fix-the-error-of-can-t-find-header-file.patch"
Signature · 1 line
2.11.0