package/hiredis: do not install nuget packaging file

The NuGet packaging description file is installed as:
    $(DEST_DIR)/build/native/hiredis.targets

This is a sprurious file that has nothing to do on a Linux system,
whether that be in host/, staging/, or target/.

Backport an upstream patch to get rid of it.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Fabrice Fontaine <fontaine.fabrice@gmail.com>
This commit is contained in:
Yann E. MORIN 2024-01-20 14:28:40 +01:00
parent c4abff80b0
commit 52f3793d46
2 changed files with 53 additions and 2 deletions

View File

@ -0,0 +1,51 @@
From ff7a064490e0aacf718a5263b25b2ddaad0d245e Mon Sep 17 00:00:00 2001
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
Date: Sat, 20 Jan 2024 13:53:39 +0100
Subject: [PATCH] CMakeList: add option to not install NuGet packaging
The NuGet hiredis.target packaging description file is of no use on
systems that are not using NuGet, like Linux systems, and the spurious
presence of that file is not "clean".
Add a cmake option to allow users to disable installation of that file.
As some people may have relied on that file to be installed, continue to
install it by default.
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Upstream: https://github.com/redis/hiredis/commit/ff7a064490e0aacf718a5263b25b2ddaad0d245e
---
CMakeLists.txt | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b7d6ee8..0fcf29b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,6 +6,9 @@ OPTION(DISABLE_TESTS "If tests should be compiled or not" OFF)
OPTION(ENABLE_SSL_TESTS "Should we test SSL connections" OFF)
OPTION(ENABLE_EXAMPLES "Enable building hiredis examples" OFF)
OPTION(ENABLE_ASYNC_TESTS "Should we run all asynchronous API tests" OFF)
+# Historically, the NuGet file was always install; default
+# to ON for those who rely on that historical behaviour.
+OPTION(ENABLE_NUGET "Install NuGET packaging details" ON)
MACRO(getVersionBit name)
SET(VERSION_REGEX "^#define ${name} (.+)$")
@@ -105,9 +108,11 @@ if (MSVC AND BUILD_SHARED_LIBS)
CONFIGURATIONS Debug RelWithDebInfo)
endif()
-# For NuGet packages
-INSTALL(FILES hiredis.targets
- DESTINATION build/native)
+if (ENABLE_NUGET)
+ # For NuGet packages
+ INSTALL(FILES hiredis.targets
+ DESTINATION build/native)
+endif()
INSTALL(FILES hiredis.h read.h sds.h async.h alloc.h sockcompat.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredis)
--
2.43.0

View File

@ -12,8 +12,8 @@ HIREDIS_LICENSE_FILES = COPYING
HIREDIS_CPE_ID_VENDOR = redislabs
HIREDIS_INSTALL_STAGING = YES
HIREDIS_CONF_OPTS = -DDISABLE_TESTS=ON
HOST_HIREDIS_CONF_OPTS = -DDISABLE_TESTS=ON -DENABLE_SSL=OFF
HIREDIS_CONF_OPTS = -DENABLE_NUGET=OFF -DDISABLE_TESTS=ON
HOST_HIREDIS_CONF_OPTS = -DENABLE_NUGET=OFF -DDISABLE_TESTS=ON -DENABLE_SSL=OFF
# Set CMAKE_BUILD_TYPE to Release or the libraries will be suffixed with "d"
# resulting in build failures when linking.