diff --git a/security/libhydrogen/Makefile b/security/libhydrogen/Makefile index 0a4b7110e4b3..21d1bf578eec 100644 --- a/security/libhydrogen/Makefile +++ b/security/libhydrogen/Makefile @@ -1,18 +1,19 @@ PORTNAME= libhydrogen PORTVERSION= 0.0.0.g20240509 +PORTREVISION= 1 CATEGORIES= security MAINTAINER= sunpoet@FreeBSD.org COMMENT= Lightweight, secure, easy-to-use crypto library for constrained environments WWW= https://github.com/jedisct1/libhydrogen LICENSE= ISCL LICENSE_FILE= ${WRKSRC}/LICENSE USES= cmake USE_GITHUB= yes GH_ACCOUNT= jedisct1 GH_TAGNAME= c18e510 .include diff --git a/security/libhydrogen/files/patch-CMakeLists.txt b/security/libhydrogen/files/patch-CMakeLists.txt index ea713881a2a4..c5a4a0d946a6 100644 --- a/security/libhydrogen/files/patch-CMakeLists.txt +++ b/security/libhydrogen/files/patch-CMakeLists.txt @@ -1,36 +1,48 @@ --- CMakeLists.txt.orig 2024-05-09 19:42:48 UTC +++ CMakeLists.txt -@@ -89,8 +89,9 @@ set(compile_options +@@ -39,11 +39,6 @@ set(arduino_files "library.properties") + + # Compile options + +-get_setting(target_arch STRING "Target system architecture (fed to the compiler's -march=XXX).") +-if(NOT target_arch AND NOT CMAKE_CROSSCOMPILING) +- set(target_arch native) +-endif() +- + get_setting(target_device STRING "Target device identifier (defines HYDRO_TARGET_DEVICE_XXX).") + + set(compile_options +@@ -89,8 +84,9 @@ set(compile_options # Main library -add_library("${PROJECT_NAME}") +add_library("${PROJECT_NAME}" SHARED) add_library("${PROJECT_NAME}::${PROJECT_NAME}" ALIAS "${PROJECT_NAME}") +add_library("${PROJECT_NAME}_static" STATIC) target_sources("${PROJECT_NAME}" PRIVATE ${source_files}) -@@ -100,11 +101,21 @@ target_compile_options("${PROJECT_NAME}" PRIVATE ${com +@@ -100,11 +96,21 @@ target_compile_options("${PROJECT_NAME}" PRIVATE ${com target_compile_options("${PROJECT_NAME}" PRIVATE ${compile_options}) +target_sources("${PROJECT_NAME}_static" PRIVATE ${source_files}) + +target_include_directories("${PROJECT_NAME}_static" + PUBLIC $ + $) + +target_compile_options("${PROJECT_NAME}_static" PRIVATE ${compile_options}) + +set_target_properties("${PROJECT_NAME}_static" PROPERTIES OUTPUT_NAME "${PROJECT_NAME}") + # Installation set(targets_export_name "${PROJECT_NAME}-targets") -install(TARGETS "${PROJECT_NAME}" +install(TARGETS "${PROJECT_NAME}" "${PROJECT_NAME}_static" EXPORT "${targets_export_name}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")