databases/hiredis: update to 1.3.0 and add static library support
- Update version from 1.2.0 to 1.3.0 - Add patch to build both static and shared libraries - Install both libhiredis.a and libhiredis_ssl.a static libraries PR: 286958 Submitted by: adamw
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
PORTNAME= hiredis
|
||||
DISTVERSIONPREFIX= v
|
||||
DISTVERSION= 1.2.0-15
|
||||
DISTVERSION= 1.3.0-15
|
||||
CATEGORIES= databases
|
||||
|
||||
MAINTAINER= olgeni@FreeBSD.org
|
||||
@@ -12,13 +12,14 @@ LICENSE_FILE= ${WRKSRC}/COPYING
|
||||
|
||||
USES= cmake cpe pathfix ssl
|
||||
CPE_VENDOR= redislabs
|
||||
USE_LDCONFIG= yes
|
||||
|
||||
USE_GITHUB= yes
|
||||
GH_ACCOUNT= redis
|
||||
GH_TAGNAME= 7ab6b82
|
||||
|
||||
CMAKE_OFF= ENABLE_NUGET
|
||||
USE_LDCONFIG= yes
|
||||
|
||||
CMAKE_ON= DISABLE_TESTS ENABLE_SSL
|
||||
CMAKE_OFF= ENABLE_NUGET
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
TIMESTAMP = 1711298380
|
||||
SHA256 (redis-hiredis-v1.2.0-15-7ab6b82_GH0.tar.gz) = fb136fc3f5bce774eb92709e1d041fa851e1130e95cc3aea5b871b91ff0ce4c5
|
||||
SIZE (redis-hiredis-v1.2.0-15-7ab6b82_GH0.tar.gz) = 128129
|
||||
TIMESTAMP = 1747769473
|
||||
SHA256 (redis-hiredis-v1.3.0-15-7ab6b82_GH0.tar.gz) = fb136fc3f5bce774eb92709e1d041fa851e1130e95cc3aea5b871b91ff0ce4c5
|
||||
SIZE (redis-hiredis-v1.3.0-15-7ab6b82_GH0.tar.gz) = 128129
|
||||
|
||||
89
databases/hiredis/files/patch-CMakeLists.txt
Normal file
89
databases/hiredis/files/patch-CMakeLists.txt
Normal file
@@ -0,0 +1,89 @@
|
||||
--- CMakeLists.txt.orig 2025-05-20 19:09:59 UTC
|
||||
+++ CMakeLists.txt
|
||||
@@ -46,13 +46,19 @@ ENDIF()
|
||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -DWIN32_LEAN_AND_MEAN)
|
||||
ENDIF()
|
||||
|
||||
-ADD_LIBRARY(hiredis ${hiredis_sources})
|
||||
-ADD_LIBRARY(hiredis::hiredis ALIAS hiredis)
|
||||
-set(hiredis_export_name hiredis CACHE STRING "Name of the exported target")
|
||||
-set_target_properties(hiredis PROPERTIES EXPORT_NAME ${hiredis_export_name})
|
||||
+# Static lib
|
||||
+ADD_LIBRARY(hiredis_static STATIC ${hiredis_sources})
|
||||
+SET_TARGET_PROPERTIES(hiredis_static PROPERTIES OUTPUT_NAME hiredis)
|
||||
|
||||
-SET_TARGET_PROPERTIES(hiredis
|
||||
- PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE
|
||||
+# Shared lib
|
||||
+ADD_LIBRARY(hiredis_shared SHARED ${hiredis_sources})
|
||||
+ADD_LIBRARY(hiredis::hiredis ALIAS hiredis_shared)
|
||||
+set(hiredis_export_name hiredis_shared CACHE STRING "Name of the exported target")
|
||||
+SET_TARGET_PROPERTIES(hiredis_shared PROPERTIES EXPORT_NAME ${hiredis_export_name})
|
||||
+
|
||||
+SET_TARGET_PROPERTIES(hiredis_shared
|
||||
+ PROPERTIES OUTPUT_NAME hiredis
|
||||
+ WINDOWS_EXPORT_ALL_SYMBOLS TRUE
|
||||
VERSION "${HIREDIS_SONAME}")
|
||||
IF(MSVC)
|
||||
SET_TARGET_PROPERTIES(hiredis
|
||||
@@ -61,12 +67,12 @@ ELSEIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||
IF(WIN32)
|
||||
TARGET_LINK_LIBRARIES(hiredis PUBLIC ws2_32 crypt32)
|
||||
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||
- TARGET_LINK_LIBRARIES(hiredis PUBLIC m)
|
||||
+ TARGET_LINK_LIBRARIES(hiredis_shared PUBLIC m)
|
||||
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
|
||||
TARGET_LINK_LIBRARIES(hiredis PUBLIC socket)
|
||||
ENDIF()
|
||||
|
||||
-TARGET_INCLUDE_DIRECTORIES(hiredis PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
||||
+TARGET_INCLUDE_DIRECTORIES(hiredis_shared PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
||||
|
||||
CONFIGURE_FILE(hiredis.pc.in hiredis.pc @ONLY)
|
||||
|
||||
@@ -96,7 +102,7 @@ include(CPack)
|
||||
|
||||
include(CPack)
|
||||
|
||||
-INSTALL(TARGETS hiredis
|
||||
+INSTALL(TARGETS hiredis_static hiredis_shared
|
||||
EXPORT hiredis-targets
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
@@ -159,28 +165,31 @@ IF(ENABLE_SSL)
|
||||
FIND_PACKAGE(OpenSSL REQUIRED)
|
||||
SET(hiredis_ssl_sources
|
||||
ssl.c)
|
||||
- ADD_LIBRARY(hiredis_ssl ${hiredis_ssl_sources})
|
||||
- ADD_LIBRARY(hiredis::hiredis_ssl ALIAS hiredis_ssl)
|
||||
+ ADD_LIBRARY(hiredis_ssl_static STATIC ${hiredis_ssl_sources})
|
||||
+ ADD_LIBRARY(hiredis_ssl_shared ${hiredis_ssl_sources})
|
||||
+ ADD_LIBRARY(hiredis::hiredis_ssl ALIAS hiredis_ssl_shared)
|
||||
|
||||
IF (APPLE AND BUILD_SHARED_LIBS)
|
||||
SET_PROPERTY(TARGET hiredis_ssl PROPERTY LINK_FLAGS "-Wl,-undefined -Wl,dynamic_lookup")
|
||||
ENDIF()
|
||||
|
||||
- SET_TARGET_PROPERTIES(hiredis_ssl
|
||||
+ SET_TARGET_PROPERTIES(hiredis_ssl_static PROPERTIES OUTPUT_NAME hiredis_ssl)
|
||||
+ SET_TARGET_PROPERTIES(hiredis_ssl_shared
|
||||
PROPERTIES
|
||||
+ OUTPUT_NAME hiredis_ssl
|
||||
WINDOWS_EXPORT_ALL_SYMBOLS TRUE
|
||||
VERSION "${HIREDIS_SONAME}")
|
||||
IF(MSVC)
|
||||
SET_TARGET_PROPERTIES(hiredis_ssl
|
||||
PROPERTIES COMPILE_FLAGS /Z7)
|
||||
ENDIF()
|
||||
- TARGET_LINK_LIBRARIES(hiredis_ssl PRIVATE OpenSSL::SSL)
|
||||
+ TARGET_LINK_LIBRARIES(hiredis_ssl_shared PRIVATE OpenSSL::SSL)
|
||||
IF(WIN32)
|
||||
TARGET_LINK_LIBRARIES(hiredis_ssl PRIVATE hiredis)
|
||||
ENDIF()
|
||||
CONFIGURE_FILE(hiredis_ssl.pc.in hiredis_ssl.pc @ONLY)
|
||||
|
||||
- INSTALL(TARGETS hiredis_ssl
|
||||
+ INSTALL(TARGETS hiredis_ssl_shared hiredis_ssl_static
|
||||
EXPORT hiredis_ssl-targets
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
@@ -24,8 +24,10 @@ lib/cmake/hiredis/hiredis-targets.cmake
|
||||
lib/cmake/hiredis_ssl/hiredis_ssl-config.cmake
|
||||
lib/cmake/hiredis_ssl/hiredis_ssl-targets-%%CMAKE_BUILD_TYPE%%.cmake
|
||||
lib/cmake/hiredis_ssl/hiredis_ssl-targets.cmake
|
||||
lib/libhiredis.a
|
||||
lib/libhiredis.so
|
||||
lib/libhiredis.so.1.2.1
|
||||
lib/libhiredis_ssl.a
|
||||
lib/libhiredis_ssl.so
|
||||
lib/libhiredis_ssl.so.1.2.1
|
||||
libdata/pkgconfig/hiredis.pc
|
||||
|
||||
Reference in New Issue
Block a user