spandsp3: new package 563/head
authorSebastian Kemper <sebastian_ml@gmx.net>
Wed, 19 Aug 2020 19:43:23 +0000 (21:43 +0200)
committerSebastian Kemper <sebastian_ml@gmx.net>
Wed, 19 Aug 2020 20:07:29 +0000 (22:07 +0200)
This commit adds an updated spandsp library. This is not a drop-in
replacement for the "old" spandsp library. Applications that want to use
it need to be updated a bit, according to upstream info [1].

In an effort to not cause any problems for OpenWrt, this package
installs the library and headers in the staging directory into
non-standard paths:

Library: $(STAGING_DIR/usr/lib/spandsp3/lib
Headers: $(STAGING_DIR/usr/lib/spandsp3/include

This way they are hidden aways from all normal users (like asterisk,
baresip etc.) and won't interfere.

To use the new spandsp library users can look for the spandsp3
pkg-config file (the regular spandsp installs spandsp.pc, this package
installs spandsp3.pc). This should be enough. The first such user will
likely be the freeswitch package, once it gets updated to 1.10.5.

[1] https://github.com/freeswitch/spandsp/issues/5

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
libs/spandsp3/Makefile [new file with mode: 0644]
libs/spandsp3/patches/01-spandsp3-pkg-config.patch [new file with mode: 0644]

diff --git a/libs/spandsp3/Makefile b/libs/spandsp3/Makefile
new file mode 100644 (file)
index 0000000..7563996
--- /dev/null
@@ -0,0 +1,74 @@
+#
+# Copyright (C) 2020 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:=spandsp3
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/freeswitch/spandsp.git
+PKG_SOURCE_DATE=2020-08-14
+PKG_SOURCE_VERSION:=6ec23e5a7e411a22d59e5678d12c4d2942c4a4b6
+PKG_RELEASE:=1
+PKG_MIRROR_HASH:=fcfa13576a25ff27e3746c3db30de89d2afceb963072b352a34e7a4a9f492ae5
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+PKG_FIXUP:=autoreconf
+
+PKG_LICENSE:=LGPL-2.1-or-later GPL-2.0-or-later
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:= \
+       Jiri Slachta <jiri@slachta.eu> \
+       Sebastian Kemper <sebastian_ml@gmx.net>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libspandsp3
+  SUBMENU:=Telephony
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=spandsp3 library
+  DEPENDS:=+libjpeg-turbo +libtiff
+  URL:=https://github.com/freeswitch/spandsp
+  ABI_VERSION:=3
+endef
+
+# Use fixed point math when soft float support is enabled for target devices.
+ifeq ($(CONFIG_SOFT_FLOAT),y)
+CONFIGURE_ARGS+= \
+       --enable-fixed-point
+endif
+
+define Build/InstallDev
+       $(INSTALL_DIR) \
+               $(1)/usr/lib/spandsp3/{include/spandsp/private,lib}
+
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspandsp* \
+               $(1)/usr/lib/spandsp3/lib
+
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/spandsp.h \
+               $(1)/usr/lib/spandsp3/include
+
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/spandsp/*.h \
+               $(1)/usr/lib/spandsp3/include/spandsp
+
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/spandsp/private/*.h \
+               $(1)/usr/lib/spandsp3/include/spandsp/private
+
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/spandsp.pc \
+               $(1)/usr/lib/pkgconfig/spandsp3.pc
+endef
+
+define Package/libspandsp3/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspandsp.so.$(ABI_VERSION)* \
+               $(1)/usr/lib
+endef
+
+$(eval $(call BuildPackage,libspandsp3))
diff --git a/libs/spandsp3/patches/01-spandsp3-pkg-config.patch b/libs/spandsp3/patches/01-spandsp3-pkg-config.patch
new file mode 100644 (file)
index 0000000..c7ae5a3
--- /dev/null
@@ -0,0 +1,18 @@
+--- a/spandsp.pc.in
++++ b/spandsp.pc.in
+@@ -1,12 +1,12 @@
+ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+-libdir=@libdir@
+-includedir=@includedir@
++libdir=${exec_prefix}/lib/spandsp3/lib
++includedir=${prefix}/lib/spandsp3/include
+ Name: spandsp
+ Description: A DSP library for telephony.
+ Requires:
+ Version: @VERSION@
+-Libs: -L${libdir} -lspandsp
++Libs: -L${libdir} -l:libspandsp.so.3
+ Libs.private: -ltiff -lm
+ Cflags: -I${includedir}