[meta-oe,08/17] redis-plus-plus: Use GNUInstallDirs in cmake

Message ID 20220320080815.825928-8-raj.khem@gmail.com
State New
Headers show
Series [meta-oe,01/17] librdkafka: Use CMAKE_INSTALL_LIBDIR | expand

Commit Message

Khem Raj March 20, 2022, 8:08 a.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...E_INSTALL_LIBDIR-from-GNUInstallDirs.patch | 45 +++++++++++++++++++
 .../redis-plus-plus/redis-plus-plus_1.3.3.bb  |  4 +-
 2 files changed, 48 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-extended/redis-plus-plus/redis-plus-plus/0001-cmake-Use-CMAKE_INSTALL_LIBDIR-from-GNUInstallDirs.patch

Patch

diff --git a/meta-oe/recipes-extended/redis-plus-plus/redis-plus-plus/0001-cmake-Use-CMAKE_INSTALL_LIBDIR-from-GNUInstallDirs.patch b/meta-oe/recipes-extended/redis-plus-plus/redis-plus-plus/0001-cmake-Use-CMAKE_INSTALL_LIBDIR-from-GNUInstallDirs.patch
new file mode 100644
index 0000000000..9ce39f3f77
--- /dev/null
+++ b/meta-oe/recipes-extended/redis-plus-plus/redis-plus-plus/0001-cmake-Use-CMAKE_INSTALL_LIBDIR-from-GNUInstallDirs.patch
@@ -0,0 +1,45 @@ 
+From fbb13cdb0b3591616c3f77b6bc76e75af8906cda Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 19 Mar 2022 22:59:58 -0700
+Subject: [PATCH] cmake: Use CMAKE_INSTALL_LIBDIR from GNUInstallDirs
+
+makes it portable across platforms e.g. ppc64/linux uses usr/lib64 for
+system libs
+
+Upstream-Status: Submitted [https://github.com/sewenew/redis-plus-plus/pull/344]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ CMakeLists.txt | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4f28ee4..8150f5c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -239,10 +239,12 @@ if(REDIS_PLUS_PLUS_BUILD_TEST)
+     add_subdirectory(test)
+ endif()
+ 
++include(GNUInstallDirs)
++
+ install(TARGETS ${REDIS_PLUS_PLUS_TARGETS}
+         EXPORT redis++-targets
+-        LIBRARY DESTINATION lib
+-        ARCHIVE DESTINATION lib
++        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+         RUNTIME DESTINATION bin
+         INCLUDES DESTINATION include)
+ 
+@@ -284,7 +286,7 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/redis++.pc.in"
+         "${CMAKE_CURRENT_BINARY_DIR}/cmake/redis++.pc" @ONLY)
+ 
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/cmake/redis++.pc"
+-        DESTINATION "lib/pkgconfig")
++        DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
+ 
+ # All the Debian-specific cpack defines.
+ if(${CMAKE_VERSION} VERSION_GREATER 3.6)
+-- 
+2.35.1
+
diff --git a/meta-oe/recipes-extended/redis-plus-plus/redis-plus-plus_1.3.3.bb b/meta-oe/recipes-extended/redis-plus-plus/redis-plus-plus_1.3.3.bb
index c135105f90..575443f0e5 100644
--- a/meta-oe/recipes-extended/redis-plus-plus/redis-plus-plus_1.3.3.bb
+++ b/meta-oe/recipes-extended/redis-plus-plus/redis-plus-plus_1.3.3.bb
@@ -4,7 +4,9 @@  SECTION = "libs"
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
 
-SRC_URI = "git://github.com/sewenew/redis-plus-plus;branch=master;protocol=https"
+SRC_URI = "git://github.com/sewenew/redis-plus-plus;branch=master;protocol=https \
+           file://0001-cmake-Use-CMAKE_INSTALL_LIBDIR-from-GNUInstallDirs.patch \
+          "
 SRCREV = "389ffdf9e72035ea2096b03cda7f4a6809ae6363"
 
 S = "${WORKDIR}/git"