From 8087789e6734c8f712cb7a2fdc45acc7d430ed6e Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sun, 6 Oct 2019 14:53:59 +0200 Subject: [PATCH] signalwire-client-c: new package signalwire-client-c is a dependency of mod-signalwire. Signed-off-by: Sebastian Kemper --- libs/signalwire-client-c/Makefile | 66 +++++++++++++++++++ .../patches/01-set-libks-cmake-dir.patch | 11 ++++ 2 files changed, 77 insertions(+) create mode 100644 libs/signalwire-client-c/Makefile create mode 100644 libs/signalwire-client-c/patches/01-set-libks-cmake-dir.patch 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) -- 2.30.2