diff --git a/net/libyang2/Makefile b/net/libyang2/Makefile index 252d2da1f7b4..cd4184c804af 100644 --- a/net/libyang2/Makefile +++ b/net/libyang2/Makefile @@ -1,31 +1,31 @@ PORTNAME= libyang PORTVERSION= 2.1.148 DISTVERSIONPREFIX= v CATEGORIES= net PKGNAMESUFFIX= 2 MAINTAINER= olivier@FreeBSD.org COMMENT= YANG data modeling language library, version 2 WWW= https://github.com/CESNET/libyang LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE LIB_DEPENDS= libpcre2-8.so:devel/pcre2 TEST_DEPENDS= cmocka>0:sysutils/cmocka -USES= cmake compiler:c++11-lang pkgconfig +USES= cmake compiler:c++11-lang localbase:ldflags pkgconfig USE_LDCONFIG= yes USE_GITHUB= yes GH_ACCOUNT= CESNET CONFLICTS= libyang libyang3 TEST_TARGET= test OPTIONS_DEFINE= TEST TEST_CMAKE_BOOL= ENABLE_TESTS .include diff --git a/net/libyang2/files/patch-CMakeLists.txt b/net/libyang2/files/patch-CMakeLists.txt index 727e627c9a7e..23f118c0688c 100644 --- a/net/libyang2/files/patch-CMakeLists.txt +++ b/net/libyang2/files/patch-CMakeLists.txt @@ -1,11 +1,20 @@ ---- CMakeLists.txt.orig 2022-05-06 06:57:14 UTC +--- CMakeLists.txt.orig 2024-01-11 08:52:00 UTC +++ CMakeLists.txt +@@ -1,7 +1,7 @@ else() + if(WIN32) + cmake_minimum_required(VERSION 3.22.0) + else() +- cmake_minimum_required(VERSION 2.8.12) ++ cmake_minimum_required(VERSION 2.8.12...3.28.1) + endif() + + # force out-of-source build @@ -31,7 +31,7 @@ if ("${BUILD_TYPE_UPPER}" STREQUAL "RELEASE") string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_UPPER) if ("${BUILD_TYPE_UPPER}" STREQUAL "RELEASE") set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build Type" FORCE) - set(CMAKE_C_FLAGS "-DNDEBUG -O2 ${CMAKE_C_FLAGS}") + set(CMAKE_C_FLAGS "-DNDEBUG ${CMAKE_C_FLAGS}") elseif("${BUILD_TYPE_UPPER}" STREQUAL "DEBUG") set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Type" FORCE) set(CMAKE_C_FLAGS "-g3 -O0 ${CMAKE_C_FLAGS}") diff --git a/net/pimd/files/patch-src_main.c b/net/pimd/files/patch-src_main.c new file mode 100644 index 000000000000..df9ab9d89d0d --- /dev/null +++ b/net/pimd/files/patch-src_main.c @@ -0,0 +1,56 @@ +--- src/main.c.orig 2026-09-18 05:38:16 UTC ++++ src/main.c +@@ -362,9 +362,31 @@ int main(int argc, char *argv[]) + } + + if (!foreground) { +- if (fork()) ++ pid_t pid; ++ ++ pid = fork(); ++ if (pid == -1) ++ err(1, "Failed forking to the background"); ++ if (pid) + exit(0); + ++ /* ++ * Leave the session, the controlling terminal and the process ++ * group of whoever started us, before the standard descriptors ++ * go to /dev/null, so that a failure can still be reported. ++ * ++ * setsid() is the portable primitive for this. The TIOCNOTTY ++ * ioctl that used to be preferred here cannot do it: the kernel ++ * refuses it to anyone but a session leader, which the child of ++ * a fork() never is, and pimd threw the error away. A daemon ++ * started from an rc script on a console was left in the ++ * terminal's foreground process group, where an INTR character ++ * typed on that console killed it. setpgrp(), taken on Linux, ++ * left the session and the terminal attached for their part. ++ */ ++ if (setsid() == -1) ++ perror("setsid"); ++ + close(STDIN_FILENO); + close(STDOUT_FILENO); + close(STDERR_FILENO); +@@ -376,20 +398,6 @@ int main(int argc, char *argv[]) + dup2(fd, STDERR_FILENO); + close(fd); + } +-#if defined(SYSV) || defined(__linux__) +- setpgrp(); +-#else +-#ifdef TIOCNOTTY +- fd = open("/dev/tty", 2); +- if (fd >= 0) { +- (void)ioctl(fd, TIOCNOTTY, NULL); +- close(fd); +- } +-#else +- if (setsid() < 0) +- perror("setsid"); +-#endif +-#endif + } + + /*