Page MenuHomeFreeBSD

D56907.id177503.diff
No OneTemporary

D56907.id177503.diff

diff --git a/devel/libks/Makefile b/devel/libks/Makefile
new file mode 100644
--- /dev/null
+++ b/devel/libks/Makefile
@@ -0,0 +1,29 @@
+PORTNAME= libks
+DISTVERSIONPREFIX= v
+DISTVERSION= 2.0.10
+CATEGORIES= devel
+
+MAINTAINER= hayzam@alchemilla.io
+COMMENT= Foundational support library for SignalWire C products
+WWW= https://github.com/signalwire/libks
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/copyright
+
+LIB_DEPENDS= libuuid.so:misc/libuuid
+
+USES= cmake compiler:c11 pkgconfig ssl
+USE_GITHUB= yes
+GH_ACCOUNT= signalwire
+GH_PROJECT= libks
+
+USE_LDCONFIG= yes
+
+DOCSDIR= ${PREFIX}/share/doc/libks2
+
+CMAKE_OFF= WITH_PACKAGING
+
+post-patch:
+ @${FIND} ${WRKSRC} -name '*.orig' -delete
+
+.include <bsd.port.mk>
diff --git a/devel/libks/distinfo b/devel/libks/distinfo
new file mode 100644
--- /dev/null
+++ b/devel/libks/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1778345457
+SHA256 (signalwire-libks-v2.0.10_GH0.tar.gz) = cd0d8504870c2e0e1306e55fd27dede976ab9f3a919487bc10b526576d24d568
+SIZE (signalwire-libks-v2.0.10_GH0.tar.gz) = 258971
diff --git a/devel/libks/files/patch-CMakeLists.txt b/devel/libks/files/patch-CMakeLists.txt
new file mode 100644
--- /dev/null
+++ b/devel/libks/files/patch-CMakeLists.txt
@@ -0,0 +1,24 @@
+--- CMakeLists.txt.orig 2026-05-09 17:08:09 UTC
++++ CMakeLists.txt
+@@ -14,10 +14,6 @@ option(WITH_PACKAGING "Enable packaging" ON)
+ # Must include cotire before anything else for auto pch setup
+ #include(cmake/cotire.cmake)
+
+-# Load our common utility api and setup the platfomrm and build
+-include(cmake/ksutil.cmake)
+-ksutil_setup_platform()
+-
+ # Find stuff we need for packaging on UNIX
+ if(KS_PLAT_LIN AND WITH_PACKAGING)
+ find_package(Git)
+@@ -45,6 +41,10 @@ message("LibKS2 Version ${PROJECT_VERSION_MAJOR}.${PRO
+ # Declare our project, libks2
+ project(LibKS2 VERSION 2.0.10 LANGUAGES C CXX)
+ message("LibKS2 Version ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
++
++# Load our common utility api and setup the platfomrm and build
++include(cmake/ksutil.cmake)
++ksutil_setup_platform()
+
+ # Set package version
+ set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
diff --git a/devel/libks/files/patch-cmake_ksutil.cmake b/devel/libks/files/patch-cmake_ksutil.cmake
new file mode 100644
--- /dev/null
+++ b/devel/libks/files/patch-cmake_ksutil.cmake
@@ -0,0 +1,21 @@
+--- cmake/ksutil.cmake.orig 2026-05-09 17:13:27 UTC
++++ cmake/ksutil.cmake
+@@ -130,6 +130,18 @@ macro(ksutil_setup_platform)
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
++ elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
++ message("Platform is FreeBSD")
++ set(KS_PLAT_FBSD 1 CACHE INTERNAL "Platform definition" FORCE)
++ set(CMAKE_POSITION_INDEPENDENT_CODE YES)
++
++ add_definitions("-DKS_PLAT_FBSD=1")
++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
++
++ if (NOT CMAKE_INSTALL_PREFIX)
++ set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE INTERNAL "Prefix prepended to install directories" FORCE)
++ set(CMAKE_PREFIX_PATH "/usr/local" CACHE INTERNAL "Prefix search path" FORCE)
++ endif()
+ else()
+ message("Platform is linux")
+ set(KS_PLAT_LIN 1 CACHE INTERNAL "Platform definition" FORCE)
diff --git a/devel/libks/files/patch-src_include_libks_ks__platform.h b/devel/libks/files/patch-src_include_libks_ks__platform.h
new file mode 100644
--- /dev/null
+++ b/devel/libks/files/patch-src_include_libks_ks__platform.h
@@ -0,0 +1,22 @@
+--- src/include/libks/ks_platform.h.orig 2026-05-09 17:13:32 UTC
++++ src/include/libks/ks_platform.h
+@@ -25,7 +25,7 @@ KS_BEGIN_EXTERN_C
+
+ KS_BEGIN_EXTERN_C
+
+-#if !defined(KS_PLAT_LIN) && !defined(KS_PLAT_WIN) && !defined(KS_PLAT_MAC)
++#if !defined(KS_PLAT_LIN) && !defined(KS_PLAT_WIN) && !defined(KS_PLAT_MAC) && !defined(KS_PLAT_FBSD)
+ #ifdef __linux__
+ #define KS_PLAT_LIN
+ #else
+@@ -34,6 +34,10 @@ KS_BEGIN_EXTERN_C
+ #else
+ #ifdef __APPLE__
+ #define KS_PLAT_MAC
++#else
++#ifdef __FreeBSD__
++#define KS_PLAT_FBSD
++#endif
+ #endif
+ #endif
+ #endif
diff --git a/devel/libks/files/patch-src_include_libks_ks__types.h b/devel/libks/files/patch-src_include_libks_ks__types.h
new file mode 100644
--- /dev/null
+++ b/devel/libks/files/patch-src_include_libks_ks__types.h
@@ -0,0 +1,16 @@
+--- src/include/libks/ks_types.h.orig 2026-05-09 17:13:40 UTC
++++ src/include/libks/ks_types.h
+@@ -161,8 +161,12 @@ KS_BEGIN_EXTERN_C
+ #include <Rpc.h>
+ typedef UUID ks_uuid_t;
+ #else
++ #ifdef KS_PLAT_FBSD
++ #include <uuid.h>
++ #else
+ #include <uuid/uuid.h>
+-
++ #endif
++
+ /* Use a structure rather then uuids char array, that way
+ * we can return it by value*/
+ typedef struct ks_uuid_s {
diff --git a/devel/libks/files/patch-src_ks__json__check.c b/devel/libks/files/patch-src_ks__json__check.c
new file mode 100644
--- /dev/null
+++ b/devel/libks/files/patch-src_ks__json__check.c
@@ -0,0 +1,16 @@
+--- src/ks_json_check.c.orig 2026-05-09 17:13:46 UTC
++++ src/ks_json_check.c
+@@ -23,8 +23,13 @@
+ *
+ */
+ #include "libks/ks.h"
++
+ #ifndef KS_PLAT_WIN
++#ifdef KS_PLAT_FBSD
++#include <uuid.h>
++#else
+ #include <uuid/uuid.h>
++#endif
+ #endif
+ #include "cJSON/cJSON.h"
+
diff --git a/devel/libks/files/patch-src_ks__thread.c b/devel/libks/files/patch-src_ks__thread.c
new file mode 100644
--- /dev/null
+++ b/devel/libks/files/patch-src_ks__thread.c
@@ -0,0 +1,11 @@
+--- src/ks_thread.c.orig 2026-05-09 17:13:52 UTC
++++ src/ks_thread.c
+@@ -76,6 +76,8 @@ KS_DECLARE(ks_pid_t) ks_thread_self_id(void)
+ return GetCurrentThreadId();
+ #elif defined(KS_PLAT_LIN)
+ return syscall(SYS_gettid);
++#elif defined(KS_PLAT_FBSD)
++ return pthread_getthreadid_np();
+ #elif defined(KS_PLAT_MAC)
+ uint64_t tid;
+ int r = pthread_threadid_np(NULL, &tid);
diff --git a/devel/libks/pkg-descr b/devel/libks/pkg-descr
new file mode 100644
--- /dev/null
+++ b/devel/libks/pkg-descr
@@ -0,0 +1,4 @@
+libks is a foundational C support library used by SignalWire projects.
+
+It provides common platform, threading, networking, JSON, UUID, and utility
+helpers used by software such as FreeSWITCH and related SignalWire components.
diff --git a/devel/libks/pkg-plist b/devel/libks/pkg-plist
new file mode 100644
--- /dev/null
+++ b/devel/libks/pkg-plist
@@ -0,0 +1,42 @@
+include/libks2/libks/cmake/AddLibBacktrace.cmake
+include/libks2/libks/cmake/FindPCRE.cmake
+include/libks2/libks/cmake/LibKS2Config-release.cmake
+include/libks2/libks/cmake/LibKS2Config.cmake
+include/libks2/libks/cmake/ksutil.cmake
+include/libks2/libks/ks.h
+include/libks2/libks/ks_acl.h
+include/libks2/libks/ks_atomic.h
+include/libks2/libks/ks_base64.h
+include/libks2/libks/ks_buffer.h
+include/libks2/libks/ks_config.h
+include/libks2/libks/ks_debug.h
+include/libks2/libks/ks_dso.h
+include/libks2/libks/ks_env.h
+include/libks2/libks/ks_hash.h
+include/libks2/libks/ks_hep.h
+include/libks2/libks/ks_json.h
+include/libks2/libks/ks_json_check.h
+include/libks2/libks/ks_json_schema.h
+include/libks2/libks/ks_log.h
+include/libks2/libks/ks_metrics.h
+include/libks2/libks/ks_platform.h
+include/libks2/libks/ks_pool.h
+include/libks2/libks/ks_printf.h
+include/libks2/libks/ks_q.h
+include/libks2/libks/ks_sb.h
+include/libks2/libks/ks_socket.h
+include/libks2/libks/ks_ssl.h
+include/libks2/libks/ks_string.h
+include/libks2/libks/ks_thread_pool.h
+include/libks2/libks/ks_threadmutex.h
+include/libks2/libks/ks_time.h
+include/libks2/libks/ks_tls.h
+include/libks2/libks/ks_types.h
+include/libks2/libks/ks_utf8.h
+include/libks2/libks/ks_uuid.h
+include/libks2/libks/kws.h
+include/libks2/libks/simclist.h
+lib/libks2.so
+lib/libks2.so.2
+libdata/pkgconfig/libks2.pc
+%%DOCSDIR%%/copyright

File Metadata

Mime Type
text/plain
Expires
Tue, May 19, 10:31 AM (3 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33307875
Default Alt Text
D56907.id177503.diff (7 KB)

Event Timeline