diff --git a/net-p2p/amule/Makefile b/net-p2p/amule/Makefile index 98c203d9b474..7f9757a0dc8f 100644 --- a/net-p2p/amule/Makefile +++ b/net-p2p/amule/Makefile @@ -1,73 +1,67 @@ PORTNAME= amule DISTVERSION= 3.0.0 +PORTREVISION= 1 CATEGORIES= net-p2p MAINTAINER= eduardo@FreeBSD.org COMMENT= All-platform P2P client based on eMule WWW= https://github.com/amule-project/amule LICENSE= GPLv2+ LICENSE_FILE= ${WRKSRC}/docs/COPYING -LIB_DEPENDS= libcryptopp.so:security/cryptopp \ - libcurl.so:ftp/curl \ - libzstd.so:archivers/zstd +BUILD_DEPENDS= cryptopp-modern>0:security/cryptopp-modern +LIB_DEPENDS= libcurl.so:ftp/curl USES= cmake:testing gettext-runtime gnome localbase:ldflags pkgconfig \ readline USE_GITHUB= yes GH_ACCOUNT= amule-org USE_GNOME= glib20 -USE_WX= 3.2 USE_RC_SUBR= amuled +USE_WX= 3.2 CMAKE_ON= BUILD_ALC BUILD_ALCC BUILD_AMULECMD BUILD_DAEMON BUILD_ED2K \ BUILD_WXCAS CMAKE_OFF= BUILD_TESTING ENABLE_IP2COUNTRY HAVE_BFD OPTIONS_DEFINE= CAS DOCS FILEVIEW NLS UPNP WEBSERVER OPTIONS_DEFAULT= AMULEGUI CAS FILEVIEW MONOLITHIC WEBSERVER OPTIONS_MULTI= COMPONENTS OPTIONS_MULTI_COMPONENTS= AMULEGUI MONOLITHIC OPTIONS_SUB= yes AMULEGUI_DESC= Build aMule remote GUI CAS_DESC= Build aMule Statistics for console FILEVIEW_DESC= Build file viewer for console MONOLITHIC_DESC= Build monolithic aMule AMULEGUI_CMAKE_BOOL= BUILD_REMOTEGUI CAS_LIB_DEPENDS= libgd.so:graphics/gd CAS_CMAKE_BOOL= BUILD_CAS FILEVIEW_CMAKE_BOOL= BUILD_FILEVIEW MONOLITHIC_USES= desktop-file-utils MONOLITHIC_CMAKE_BOOL= BUILD_MONOLITHIC NLS_USES= gettext-tools NLS_CMAKE_BOOL= ENABLE_NLS UPNP_LIB_DEPENDS= libupnp.so:devel/upnp UPNP_CMAKE_BOOL= ENABLE_UPNP WEBSERVER_LIB_DEPENDS= libpng.so:graphics/png WEBSERVER_USES= readline WEBSERVER_CMAKE_BOOL= BUILD_WEBSERVER .include .if ${PORT_OPTIONS:MAMULEGUI} || ${PORT_OPTIONS:MMONOLITHIC} PLIST_SUB+= AMULESKIN="" .else PLIST_SUB+= AMULESKIN="@comment " .endif -# Fix segmentation fault, PR 266866 -# See also 5a19c08: ("security/cryptopp: Update to 8.7.0") -.if ${ARCH} == i386 || ${ARCH} == amd64 -CXXFLAGS+= -DCRYPTOPP_DISABLE_ASM -.endif - .include diff --git a/net-p2p/amule/files/patch-fix-cryptopp-modern-version b/net-p2p/amule/files/patch-fix-cryptopp-modern-version new file mode 100644 index 000000000000..a14c646b75e7 --- /dev/null +++ b/net-p2p/amule/files/patch-fix-cryptopp-modern-version @@ -0,0 +1,78 @@ +From ad4dacd28d0510f2bfaa4dd8a38c6b24844de85e Mon Sep 17 00:00:00 2001 +From: got3nks +Date: Tue, 16 Jun 2026 00:56:34 +0200 +Subject: [PATCH] cmake: accept cryptopp-modern's calendar CRYPTOPP_VERSION + +Two CRYPTOPP_VERSION encodings exist in the wild: + + - Classic Crypto++ (weidai11/cryptopp/config_ver.h:53): + MAJOR*100 + MINOR*10 + REVISION + so 8.9.0 -> 890, max for v1.x..v9.x is 999. + + - cryptopp-modern (https://github.com/cryptopp-modern/cryptopp-modern, + calendar versioning per config_ver.h:50): + YEAR*10000 + MONTH*100 + INCREMENT + so the 2026.6 build is 20260600. Always >= 20,240,000 for any + release from 2024 onwards. + +The previous regex pass parsed 20260600 as "2.0.26.0.600" and tripped +MIN_CRYPTOPP_VERSION ("5.6"), making cryptopp-modern unbuildable +against aMule -- the symptom reported in issue #167. + +The gap between 9,999 and 20,000,000 makes a single magnitude check +enough to disambiguate the two encodings without collision risk now +or in any realistic future, and would also gracefully accept a +hypothetical classic Crypto++ 10.x.y in the 1000-9999 range as +"clearly newer than MIN_CRYPTOPP_VERSION". + +Refs: #167 +--- + cmake/cryptopp.cmake | 35 ++++++++++++++++++++++++++++------- + 1 file changed, 28 insertions(+), 7 deletions(-) + +diff --git cmake/cryptopp.cmake cmake/cryptopp.cmake +index 722d8646be..ac5421a80b 100644 +--- cmake/cryptopp.cmake ++++ cmake/cryptopp.cmake +@@ -158,13 +158,34 @@ if (NOT CRYPTOPP_VERSION)# AND CRYPTO_COMPLETE) + RUN_OUTPUT_VARIABLE CRYPTOPP_VERSION + ) + +- string (REGEX REPLACE "([0-9])([0-9])([0-9])" "\\1.\\2.\\3" CRYPTOPP_VERSION "${CRYPTOPP_VERSION}") +- +- if (${CRYPTOPP_VERSION} VERSION_LESS ${MIN_CRYPTOPP_VERSION}) +- message (FATAL_ERROR "crypto++ version ${CRYPTOPP_VERSION} is too old") ++ # Two CRYPTOPP_VERSION encodings exist in the wild: ++ # ++ # - Classic Crypto++ (weidai11/cryptopp/config_ver.h:53): ++ # MAJOR*100 + MINOR*10 + REVISION ++ # so 8.9.0 → 890, max for v1.x..v9.x is 999. ++ # ++ # - cryptopp-modern (cryptopp-modern/cryptopp-modern, calendar ++ # versioning per their config_ver.h:50 doc comment): ++ # YEAR*10000 + MONTH*100 + INCREMENT ++ # so the 2026.6 build is 20260600. Always ≥ 20,240,000 for any ++ # release from 2024 onwards. ++ # ++ # The gap between 9,999 and 20,000,000 is enormous, so a single ++ # numeric threshold disambiguates without risk of collision either ++ # now or in any realistic future (and would also gracefully accept ++ # a hypothetical classic Crypto++ 10.x.y in the 1000-9999 range as ++ # "clearly newer than MIN_CRYPTOPP_VERSION"). ++ if (CRYPTOPP_VERSION GREATER_EQUAL 10000) ++ MESSAGE (STATUS "crypto++ version ${CRYPTOPP_VERSION} (calendar / cryptopp-modern variant) -- OK") + else() +- MESSAGE (STATUS "crypto++ version ${CRYPTOPP_VERSION} -- OK") +- set (CRYPTOPP_CONFIG_FILE ${CRYPTOPP_CONFIG_FILE} CACHE STRING "Path to config.h of crypto-lib" FORCE) +- set (CRYPTOPP_VERSION ${CRYPTOPP_VERSION} CACHE STRING "Version of cryptopp" FORCE) ++ string (REGEX REPLACE "([0-9])([0-9])([0-9])" "\\1.\\2.\\3" CRYPTOPP_VERSION "${CRYPTOPP_VERSION}") ++ ++ if (${CRYPTOPP_VERSION} VERSION_LESS ${MIN_CRYPTOPP_VERSION}) ++ message (FATAL_ERROR "crypto++ version ${CRYPTOPP_VERSION} is too old") ++ else() ++ MESSAGE (STATUS "crypto++ version ${CRYPTOPP_VERSION} -- OK") ++ endif() + endif() ++ set (CRYPTOPP_CONFIG_FILE ${CRYPTOPP_CONFIG_FILE} CACHE STRING "Path to config.h of crypto-lib" FORCE) ++ set (CRYPTOPP_VERSION ${CRYPTOPP_VERSION} CACHE STRING "Version of cryptopp" FORCE) + endif()