Skip to content

Commit 9cb03ae

Browse files
author
Rob Goodall
committed
devel/libks: Add libks version 2.0.6
Foundational support for signalwire C products Packaged in wip by Rob Goodall
1 parent 199aac5 commit 9cb03ae

File tree

9 files changed

+151
-0
lines changed

9 files changed

+151
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2071,6 +2071,7 @@ SUBDIR+= libjdksmidi
20712071
SUBDIR+= libjingle
20722072
SUBDIR+= libjxl
20732073
SUBDIR+= libkml
2074+
SUBDIR+= libks
20742075
SUBDIR+= liblingoteach
20752076
SUBDIR+= libltc
20762077
SUBDIR+= libm4ri

libks/DESCR

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Foundational support for signalwire C products

libks/Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# $NetBSD$
2+
3+
GITHUB_TAG= v${PKGVERSION_NOREV}
4+
DISTNAME= libks-2.0.6
5+
CATEGORIES= devel
6+
MASTER_SITES= ${MASTER_SITE_GITHUB:=signalwire/}
7+
8+
MAINTAINER= [email protected]
9+
HOMEPAGE= https://github.com/signalwire/libks/
10+
COMMENT= Foundational support for signalwire C products
11+
LICENSE= mit AND public-domain AND modified-bsd
12+
13+
USE_TOOLS+= cmake pkg-config
14+
USE_LANGUAGES= c c++
15+
WRKSRC= ${WRKDIR}/${DISTNAME}
16+
PKGCONFIG_OVERRIDE+= libks.pc.in
17+
MAKE_ENV+= GCC=yes
18+
19+
CMAKE_ARGS+= -DCMAKE_BUILD_TYPE=Release
20+
CMAKE_ARGS+= -DCMAKE_INSTALL_PREFIX:PATH=/usr/pkg
21+
22+
23+
.include "../../devel/libuuid/buildlink3.mk"
24+
.include "../../misc/rhash/buildlink3.mk"
25+
.include "../../devel/cmake/build.mk"
26+
.include "../../mk/pthread.builtin.mk"
27+
.include "../../mk/bsd.pkg.mk"

libks/PLIST

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
@comment $NetBSD$
2+
include/libks2/libks/cmake/AddLibBacktrace.cmake
3+
include/libks2/libks/cmake/FindPCRE.cmake
4+
include/libks2/libks/cmake/LibKS2Config-release.cmake
5+
include/libks2/libks/cmake/LibKS2Config.cmake
6+
include/libks2/libks/cmake/ksutil.cmake
7+
include/libks2/libks/ks.h
8+
include/libks2/libks/ks_acl.h
9+
include/libks2/libks/ks_atomic.h
10+
include/libks2/libks/ks_base64.h
11+
include/libks2/libks/ks_buffer.h
12+
include/libks2/libks/ks_config.h
13+
include/libks2/libks/ks_debug.h
14+
include/libks2/libks/ks_dso.h
15+
include/libks2/libks/ks_env.h
16+
include/libks2/libks/ks_hash.h
17+
include/libks2/libks/ks_json.h
18+
include/libks2/libks/ks_json_check.h
19+
include/libks2/libks/ks_log.h
20+
include/libks2/libks/ks_metrics.h
21+
include/libks2/libks/ks_platform.h
22+
include/libks2/libks/ks_pool.h
23+
include/libks2/libks/ks_printf.h
24+
include/libks2/libks/ks_q.h
25+
include/libks2/libks/ks_sb.h
26+
include/libks2/libks/ks_socket.h
27+
include/libks2/libks/ks_ssl.h
28+
include/libks2/libks/ks_string.h
29+
include/libks2/libks/ks_thread_pool.h
30+
include/libks2/libks/ks_threadmutex.h
31+
include/libks2/libks/ks_time.h
32+
include/libks2/libks/ks_types.h
33+
include/libks2/libks/ks_utf8.h
34+
include/libks2/libks/ks_uuid.h
35+
include/libks2/libks/kws.h
36+
include/libks2/libks/simclist.h
37+
lib/libks2.so
38+
lib/libks2.so.2
39+
lib/pkgconfig/libks2.pc
40+
share/doc/libks2/copyright

libks/buildlink3.mk

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# $NetBSD: buildlink3.mk,v 1.6 2023/10/21 17:09:53 gdt Exp $
2+
3+
BUILDLINK_TREE+= libks
4+
5+
.if !defined(LIBKS_BUILDLINK3_MK)
6+
LIBKS_BUILDLINK3_MK:=
7+
8+
BUILDLINK_API_DEPENDS.libks+= libks>=2.0.6
9+
BUILDLINK_PKGSRCDIR.libks?= ../../wip/libks
10+
11+
.endif # LIBKS_BUILDLINK3_MK
12+
13+
BUILDLINK_TREE+= -libks

libks/distinfo

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
$NetBSD$
2+
3+
SHA1 (libks-2.0.6.tar.gz) = cce1f2f22586443fc70fcb6e1f97ffc86d5a321b
4+
RMD160 (libks-2.0.6.tar.gz) = 3c9bcf56c4c2c762d8d094d0a7a3726436523e2a
5+
Size (libks-2.0.6.tar.gz) = 238880 bytes
6+
SHA1 (patch-CMakeLists.txt) = d019b9c8f46a01a87394c5aa3f4eed071d14be25
7+
SHA1 (patch-cmake_ksutil.cmake) = e4ab71a407582c954a9f929e4e6d6192831b0d4e
8+
SHA1 (patch-src_ks__thread.c) = 6180a7e02f68377ba4fd3e287ffffe7a35063f9d

libks/patches/patch-CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
$NetBSD$
2+
3+
Work around. Skip tests.
4+
5+
--- CMakeLists.txt.orig 2024-07-23 20:48:07.000000000 +0000
6+
+++ CMakeLists.txt 2024-09-19 17:08:21.421459585 +0000
7+
@@ -610,7 +610,6 @@
8+
9+
# Add tests
10+
enable_testing()
11+
-add_subdirectory(tests)
12+
13+
if (WITH_KS_TEST)
14+
enable_testing()
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
$NetBSD$
2+
3+
Added options for UNIX (not Mac, Windows or Linux).
4+
5+
--- cmake/ksutil.cmake.orig 2024-07-23 20:48:07.000000000 +0000
6+
+++ cmake/ksutil.cmake
7+
@@ -114,6 +114,25 @@ macro(ksutil_setup_platform)
8+
set(CMAKE_POSITION_INDEPENDENT_CODE YES)
9+
add_definitions("-DKS_PLAT_MAC=1")
10+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
11+
+ elseif (UNIX)
12+
+ message("Platform is UNIX")
13+
+ set(KS_PLAT_UNIX 1 CACHE INTERNAL "Platform definition" FORCE)
14+
+ add_compile_options("$<$<CONFIG:Release>:-O2>")
15+
+ add_compile_options("$<$<CONFIG:Release>:-g>")
16+
+ add_compile_options("$<$<CONFIG:Release>:-Wno-parentheses>")
17+
+ add_compile_options("$<$<CONFIG:Release>:-Wno-pointer-sign>")
18+
+ add_compile_options("$<$<CONFIG:Release>:-Wno-switch>")
19+
+
20+
+ add_compile_options("$<$<CONFIG:Debug>:-O0>")
21+
+ add_compile_options("$<$<CONFIG:Debug>:-g>")
22+
+ add_compile_options("$<$<CONFIG:Debug>:-DKS_BUILD_DEBUG=1>")
23+
+ add_compile_options("$<$<CONFIG:Debug>:-Wno-parentheses>")
24+
+ add_compile_options("$<$<CONFIG:Debug>:-Wno-pointer-sign>")
25+
+ add_compile_options("$<$<CONFIG:Debug>:-Wno-switch>")
26+
+
27+
+ set(CMAKE_POSITION_INDEPENDENT_CODE YES)
28+
+ add_definitions("-DKS_PLAT_UNIX=1")
29+
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
30+
elseif (WIN32)
31+
message("Platform is windows")
32+
set(KS_PLAT_WIN 1 CACHE INTERNAL "Platform definition" FORCE)

libks/patches/patch-src_ks__thread.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
$NetBSD$
2+
3+
Add extra field required by pthread_setname_np.
4+
5+
--- src/ks_thread.c.orig 2024-07-23 20:48:07.000000000 +0000
6+
+++ src/ks_thread.c
7+
@@ -169,7 +169,7 @@ static void *KS_THREAD_CALLING_CONVENTIO
8+
pthread_setname_np(thread->tag);
9+
#else
10+
if (thread->tag && pthread_setname_np)
11+
- pthread_setname_np(pthread_self(), thread->tag);
12+
+ pthread_setname_np(pthread_self(), thread->tag, NULL);
13+
#endif
14+
15+
ks_log(KS_LOG_DEBUG, "START call user thread callback with address: %p, tid: %8.8x\n", (void *)thread, thread->id);

0 commit comments

Comments
 (0)