git: 6338d2b2a5c8 - main - devel/libcbor: Build and install static library
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 18 May 2025 03:36:58 UTC
The branch main has been updated by sunpoet:
URL: https://cgit.FreeBSD.org/ports/commit/?id=6338d2b2a5c83184eb06ee27f23640ed20ac4bd6
commit 6338d2b2a5c83184eb06ee27f23640ed20ac4bd6
Author: Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2025-05-18 03:15:43 +0000
Commit: Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2025-05-18 03:32:11 +0000
devel/libcbor: Build and install static library
- Disable CMAKE_INTERPROCEDURAL_OPTIMIZATION to avoid LLVM IR bitcode
- Bump PORTREVISION for package change
PR: 286487
Requested by: olivier
Tested by: olivier
---
devel/libcbor/Makefile | 15 +++++++++++--
devel/libcbor/files/patch-src-CMakeLists.txt | 33 ++++++++++++++++++++++++++--
devel/libcbor/pkg-plist | 1 +
3 files changed, 45 insertions(+), 4 deletions(-)
diff --git a/devel/libcbor/Makefile b/devel/libcbor/Makefile
index 6e9fd56750fb..aad94b0a4ec0 100644
--- a/devel/libcbor/Makefile
+++ b/devel/libcbor/Makefile
@@ -1,6 +1,7 @@
PORTNAME= libcbor
PORTVERSION= 0.12.0
DISTVERSIONPREFIX= v
+PORTREVISION= 1
CATEGORIES= devel
MAINTAINER= sunpoet@FreeBSD.org
@@ -14,8 +15,18 @@ LIB_DEPENDS= libcjson.so:devel/libcjson
USES= cmake pathfix
-CMAKE_OFF= CBOR_CUSTOM_ALLOC COVERAGE HUGE_FUZZ PRINT_FUZZ SANE_MALLOC SANITIZE WITH_EXAMPLES WITH_TESTS
-CMAKE_ON= BUILD_SHARED_LIBS CBOR_PRETTY_PRINTER CMAKE_SKIP_INSTALL_ALL_DEPENDENCY
+CMAKE_OFF= CBOR_CUSTOM_ALLOC \
+ CMAKE_INTERPROCEDURAL_OPTIMIZATION \
+ COVERAGE \
+ HUGE_FUZZ \
+ PRINT_FUZZ \
+ SANE_MALLOC \
+ SANITIZE \
+ WITH_EXAMPLES \
+ WITH_TESTS
+CMAKE_ON= BUILD_SHARED_LIBS \
+ CBOR_PRETTY_PRINTER \
+ CMAKE_SKIP_INSTALL_ALL_DEPENDENCY
PLIST_SUB= PORTVERSION=${PORTVERSION}
diff --git a/devel/libcbor/files/patch-src-CMakeLists.txt b/devel/libcbor/files/patch-src-CMakeLists.txt
index 66d7bece4669..c185c1e95c59 100644
--- a/devel/libcbor/files/patch-src-CMakeLists.txt
+++ b/devel/libcbor/files/patch-src-CMakeLists.txt
@@ -1,6 +1,26 @@
---- src/CMakeLists.txt.orig 2025-03-16 19:29:33 UTC
+--- src/CMakeLists.txt.orig 2025-05-06 17:51:02 UTC
+++ src/CMakeLists.txt
-@@ -62,7 +62,7 @@ set_target_properties(
+@@ -29,12 +29,19 @@ add_library(cbor ${SOURCES})
+ endif()
+
+ add_library(cbor ${SOURCES})
++add_library(cbor_static STATIC ${SOURCES})
+ target_include_directories(cbor PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
+ $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
++target_include_directories(cbor_static PUBLIC
++ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
++ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
++ $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
++ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
+ set_target_properties(cbor PROPERTIES EXPORT_NAME libcbor)
++set_target_properties(cbor_static PROPERTIES OUTPUT_NAME cbor)
+ # For vendored builds
+ add_library(libcbor::libcbor ALIAS cbor)
+
+@@ -62,7 +69,7 @@ set_target_properties(
PROPERTIES VERSION ${CBOR_VERSION}
MACHO_COMPATIBILITY_VERSION
${CBOR_VERSION_MAJOR}.${CBOR_VERSION_MINOR}.0
@@ -9,3 +29,12 @@
join_paths(libdir_for_pc_file "\${prefix}" "${CMAKE_INSTALL_LIBDIR}")
join_paths(includedir_for_pc_file "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}")
+@@ -70,7 +77,7 @@ install(
+
+ # http://www.cmake.org/Wiki/CMake:Install_Commands
+ install(
+- TARGETS cbor
++ TARGETS cbor cbor_static
+ EXPORT libcborTargets
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
diff --git a/devel/libcbor/pkg-plist b/devel/libcbor/pkg-plist
index 2d3669f157c2..cfbb3567abaa 100644
--- a/devel/libcbor/pkg-plist
+++ b/devel/libcbor/pkg-plist
@@ -24,6 +24,7 @@ lib/cmake/libcbor/libcborConfig.cmake
lib/cmake/libcbor/libcborConfigVersion.cmake
lib/cmake/libcbor/libcborTargets-%%CMAKE_BUILD_TYPE%%.cmake
lib/cmake/libcbor/libcborTargets.cmake
+lib/libcbor.a
lib/libcbor.so
lib/libcbor.so.0
lib/libcbor.so.%%PORTVERSION%%