diff --git a/libs/libks/Makefile b/libs/libks/Makefile new file mode 100644 index 0000000..7dc82fc --- /dev/null +++ b/libs/libks/Makefile @@ -0,0 +1,66 @@ +# +# Copyright (C) 2019 Sebastian Kemper +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libks + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/signalwire/$(PKG_NAME).git +PKG_SOURCE_DATE=2019-09-18 +PKG_SOURCE_VERSION:=df72c4c61a2deed414541735086d03259aec9679 +PKG_RELEASE:=1 +PKG_MIRROR_HASH:=3005101d3c80ec7d03d2097e538506a5090ded65b71169c279194ab950fd7cb5 + +PKG_BUILD_PARALLEL:=1 +CMAKE_INSTALL:=1 + +PKG_LICENSE:= \ + BSD-1-Clause \ + BSD-3-Clause \ + ISC \ + MIT \ + PUBLICDOMAIN \ + twofish +PKG_LICENSE_FILES:=copyright + +PKG_MAINTAINER:=Sebastian Kemper + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/$(PKG_NAME) + SUBMENU:=Telephony + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Foundational support for SignalWire C products + URL:=https://github.com/signalwire/libks + ABI_VERSION:=1 + DEPENDS:=+libatomic +libopenssl +libuuid +endef + +# Otherwise OpenWrt's CPPFLAGS are ignored +TARGET_CFLAGS += $(TARGET_CPPFLAGS) + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/$(PKG_NAME) + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/$(PKG_NAME)/*.h \ + $(1)/usr/include/$(PKG_NAME) + $(INSTALL_DIR) $(1)/usr/lib/{cmake/$(PKG_NAME),pkgconfig} + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/$(PKG_NAME)/cmake/* \ + $(1)/usr/lib/cmake/$(PKG_NAME) + $(CP) $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME).so* $(1)/usr/lib + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/$(PKG_NAME).pc \ + $(1)/usr/lib/pkgconfig +endef + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME).so.$(ABI_VERSION)* $(1)/usr/lib +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/libs/libks/patches/01-find-libm.patch b/libs/libks/patches/01-find-libm.patch new file mode 100644 index 0000000..f1a021a --- /dev/null +++ b/libs/libks/patches/01-find-libm.patch @@ -0,0 +1,15 @@ +--- a/cmake/FindLibM.cmake ++++ b/cmake/FindLibM.cmake +@@ -8,11 +8,7 @@ + # A user may set ``LIBM_ROOT`` to a math library installation root to tell this + # module where to look. + +-find_path(LIBM_INCLUDE_DIRS +- NAMES math.h +- PATHS /usr/include /usr/local/include /usr/local/bic/include +- NO_DEFAULT_PATH +-) ++find_path(LIBM_INCLUDE_DIRS math.h) + find_library(LIBM_LIBRARIES m) + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(LibM DEFAULT_MSG LIBM_LIBRARIES LIBM_INCLUDE_DIRS) diff --git a/libs/libks/patches/02-correct-signal_h-include.patch b/libs/libks/patches/02-correct-signal_h-include.patch new file mode 100644 index 0000000..a128a8d --- /dev/null +++ b/libs/libks/patches/02-correct-signal_h-include.patch @@ -0,0 +1,11 @@ +--- a/src/include/libks/ks_platform.h ++++ b/src/include/libks/ks_platform.h +@@ -91,7 +91,7 @@ KS_BEGIN_EXTERN_C + #include + #include + #include +-#include ++#include + #include + #include + #include diff --git a/libs/libks/patches/03-fix-flags.patch b/libs/libks/patches/03-fix-flags.patch new file mode 100644 index 0000000..937e382 --- /dev/null +++ b/libs/libks/patches/03-fix-flags.patch @@ -0,0 +1,24 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -11,6 +11,10 @@ option(WITH_LIBBACKTRACE "Enables linkin + # Must include cotire before anything else for auto pch setup + include(cmake/cotire.cmake) + ++# Declare our project, libks ++project(LibKS VERSION 1.3.0 LANGUAGES C CXX) ++message("LibKS 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() +@@ -39,10 +43,6 @@ if (KS_PLAT_WIN OR WITH_KS_TEST) + endif() + endif() + +-# Declare our project, libks +-project(LibKS VERSION 1.3.0 LANGUAGES C CXX) +-message("LibKS Version ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}") +- + # Set package version + set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) + set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) diff --git a/libs/libks/patches/04-don_t-override-optimization.patch b/libs/libks/patches/04-don_t-override-optimization.patch new file mode 100644 index 0000000..32c5512 --- /dev/null +++ b/libs/libks/patches/04-don_t-override-optimization.patch @@ -0,0 +1,10 @@ +--- a/cmake/ksutil.cmake ++++ b/cmake/ksutil.cmake +@@ -135,7 +135,6 @@ macro(ksutil_setup_platform) + set(KS_PLAT_LIN 1 CACHE INTERNAL "Platform definition" FORCE) + set(CMAKE_POSITION_INDEPENDENT_CODE YES) + +- add_compile_options("$<$:-O2>") + add_compile_options("$<$:-g>") + + add_compile_options("$<$:-O0>") diff --git a/libs/signalwire-client-c/Makefile b/libs/signalwire-client-c/Makefile new file mode 100644 index 0000000..1255f11 --- /dev/null +++ b/libs/signalwire-client-c/Makefile @@ -0,0 +1,66 @@ +# +# Copyright (C) 2019 Sebastian Kemper +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=signalwire-client-c + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/signalwire/signalwire-c.git +PKG_SOURCE_DATE=2019-09-20 +PKG_SOURCE_VERSION:=4729b1552e5f3d8a414f5769f5ca85b4e7572305 +PKG_RELEASE:=1 +PKG_MIRROR_HASH:=eef97655caf076d35ee51b23de6a41b76becb6bf951348b9f981c35bb807d803 + +PKG_BUILD_PARALLEL:=1 +CMAKE_INSTALL:=1 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=copyright + +PKG_MAINTAINER:=Sebastian Kemper + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/$(PKG_NAME) + SUBMENU:=Telephony + SECTION:=libs + CATEGORY:=Libraries + TITLE:=SignalWire C client library + URL:=https://github.com/signalwire/signalwire-c + ABI_VERSION:=1 + DEPENDS:=+libatomic +libks +libopenssl +endef + +# Otherwise OpenWrt's CPPFLAGS are ignored +TARGET_CFLAGS += $(TARGET_CPPFLAGS) + +define Package/$(PKG_NAME)/install/headers + $(INSTALL_DIR) $(1)/usr/include/$(PKG_NAME)/$(2) + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/include/$(PKG_NAME)/$(2)/*.h \ + $(1)/usr/include/$(PKG_NAME)/$(2) +endef + +define Build/InstallDev + $(foreach s,./ JSON blade signalwire transport,$(call Package/$(PKG_NAME)/install/headers,$(1),$(s));) + $(INSTALL_DIR) $(1)/usr/lib/{cmake/$(PKG_NAME),pkgconfig} + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/$(PKG_NAME)/cmake/* \ + $(1)/usr/lib/cmake/$(PKG_NAME) + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsignalwire_client.so* $(1)/usr/lib + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/signalwire_client.pc \ + $(1)/usr/lib/pkgconfig +endef + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsignalwire_client.so.$(ABI_VERSION)* \ + $(1)/usr/lib +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/libs/signalwire-client-c/patches/01-set-libks-cmake-dir.patch b/libs/signalwire-client-c/patches/01-set-libks-cmake-dir.patch new file mode 100644 index 0000000..c2a961f --- /dev/null +++ b/libs/signalwire-client-c/patches/01-set-libks-cmake-dir.patch @@ -0,0 +1,11 @@ +--- a/cmake/FindLibKS.cmake ++++ b/cmake/FindLibKS.cmake +@@ -19,7 +19,7 @@ if (NOT TARGET ks) + endif() + + # From here we can bootstrap into cmake stuff +- set(LIBKS_CMAKE_DIR ${LIBKS_INCLUDE_DIRS}/cmake) ++ set(LIBKS_CMAKE_DIR ${LIBKS_LIBRARY_DIRS}/cmake/libks) + + # Load ks utils for our build macros + include(${LIBKS_CMAKE_DIR}/ksutil.cmake) diff --git a/net/freeswitch-stable/Makefile b/net/freeswitch-stable/Makefile index 38b5737..18beb3f 100644 --- a/net/freeswitch-stable/Makefile +++ b/net/freeswitch-stable/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PRG_NAME:=freeswitch PKG_NAME:=$(PRG_NAME)-stable PKG_VERSION:=1.10.1 -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_MAINTAINER:=Sebastian Kemper PKG_SOURCE:=$(PRG_NAME)-$(PKG_VERSION).-release.tar.xz @@ -192,6 +192,7 @@ FS_STABLE_MOD_AVAILABLE:= \ say_zh \ shell_stream \ shout \ + signalwire \ skinny \ sms \ snapshot \ @@ -1100,6 +1101,7 @@ $(eval $(call Package/$(PKG_NAME)/Module,say_th,Thai Say,Uses prerecorded sounds $(eval $(call Package/$(PKG_NAME)/Module,say_zh,Chinese Say,Uses prerecorded sounds to read or say various things.,)) $(eval $(call Package/$(PKG_NAME)/Module,shell_stream,Shell stream,Allows to stream audio from an arbitrary shell command.,)) $(eval $(call Package/$(PKG_NAME)/Module,shout,Shout,Allows to stream audio from MP3s or Shoutcast streams.,+lame-lib +libmpg123 +libshout)) +$(eval $(call Package/$(PKG_NAME)/Module,signalwire,SignalWire,SignalWire CLOUD - FreeSWITCH connector.,+signalwire-client-c)) $(eval $(call Package/$(PKG_NAME)/Module,skinny,Skinny,Skinny Call Control Protocol endpoint support.,)) $(eval $(call Package/$(PKG_NAME)/Module,sms,SMS,This module provides an abstract facility for interfacing with SMS\nsystems.,)) $(eval $(call Package/$(PKG_NAME)/Module,snapshot,Snapshot,This module can record a sliding window of audio and take snapshots\nto disk.,))