signalwire-client-c: new package
authorSebastian Kemper <sebastian_ml@gmx.net>
Sun, 6 Oct 2019 12:53:59 +0000 (14:53 +0200)
committerSebastian Kemper <sebastian_ml@gmx.net>
Tue, 17 Dec 2019 17:49:39 +0000 (18:49 +0100)
signalwire-client-c is a dependency of mod-signalwire.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
libs/signalwire-client-c/Makefile [new file with mode: 0644]
libs/signalwire-client-c/patches/01-set-libks-cmake-dir.patch [new file with mode: 0644]

diff --git a/libs/signalwire-client-c/Makefile b/libs/signalwire-client-c/Makefile
new file mode 100644 (file)
index 0000000..1255f11
--- /dev/null
@@ -0,0 +1,66 @@
+# 
+# Copyright (C) 2019 Sebastian Kemper <sebastian_ml@gmx.net>
+#
+# 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 <sebastian_ml@gmx.net>
+
+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 (file)
index 0000000..c2a961f
--- /dev/null
@@ -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)