From 2a423cf35013be2fcdbcb8d610a64adaaa488c6a Mon Sep 17 00:00:00 2001 From: Christopher Brannon Date: Wed, 9 Dec 2015 01:19:29 -0800 Subject: [PATCH] New package: pjproject-2.4.5 --- common/shlibs | 14 +++++ srcpkgs/pjproject-devel | 1 + srcpkgs/pjproject/patches/musl-fixes.patch | 62 +++++++++++++++++++ .../pjproject/patches/no-third-party.patch | 19 ++++++ srcpkgs/pjproject/template | 62 +++++++++++++++++++ 5 files changed, 158 insertions(+) create mode 120000 srcpkgs/pjproject-devel create mode 100644 srcpkgs/pjproject/patches/musl-fixes.patch create mode 100644 srcpkgs/pjproject/patches/no-third-party.patch create mode 100644 srcpkgs/pjproject/template diff --git a/common/shlibs b/common/shlibs index 66b3f37e8b..f364216412 100644 --- a/common/shlibs +++ b/common/shlibs @@ -2289,3 +2289,17 @@ libkqueue.so.0 libkqueue-2.0.3_1 libfdk-aac.so.1 fdk-aac-0.1.4_1 libyubikey.so.0 libyubikey-1.13_1 libykpers-1.so.1 libykpers-1.17.2_1 +libg7221codec.so.2 pjproject-2.4.5_1 +libilbccodec.so.2 pjproject-2.4.5_1 +libpj.so.2 pjproject-2.4.5_1 +libpjlib-util.so.2 pjproject-2.4.5_1 +libpjmedia-audiodev.so.2 pjproject-2.4.5_1 +libpjmedia-codec.so.2 pjproject-2.4.5_1 +libpjmedia-videodev.so.2 pjproject-2.4.5_1 +libpjmedia.so.2 pjproject-2.4.5_1 +libpjnath.so.2 pjproject-2.4.5_1 +libpjsip-simple.so.2 pjproject-2.4.5_1 +libpjsip-ua.so.2 pjproject-2.4.5_1 +libpjsip.so.2 pjproject-2.4.5_1 +libpjsua.so.2 pjproject-2.4.5_1 +libpjsua2.so.2 pjproject-2.4.5_1 diff --git a/srcpkgs/pjproject-devel b/srcpkgs/pjproject-devel new file mode 120000 index 0000000000..91dce6638f --- /dev/null +++ b/srcpkgs/pjproject-devel @@ -0,0 +1 @@ +pjproject \ No newline at end of file diff --git a/srcpkgs/pjproject/patches/musl-fixes.patch b/srcpkgs/pjproject/patches/musl-fixes.patch new file mode 100644 index 0000000000..c6b64c4e9c --- /dev/null +++ b/srcpkgs/pjproject/patches/musl-fixes.patch @@ -0,0 +1,62 @@ +--- pjsip-apps/src/samples/siprtp.c ++++ pjsip-apps/src/samples/siprtp.c +@@ -1133,7 +1133,7 @@ + PJ_RETURN_OS_ERROR(rc)); + return; + } +- tp.__sched_priority = max_prio; ++ tp.sched_priority = max_prio; + + rc = sched_setscheduler(0, POLICY, &tp); + if (rc != 0) { +@@ -1142,7 +1142,7 @@ + } + + PJ_LOG(4, (THIS_FILE, "New process policy=%d, priority=%d", +- policy, tp.__sched_priority)); ++ policy, tp.sched_priority)); + + /* + * Adjust thread scheduling algorithm and priority +@@ -1155,10 +1155,10 @@ + } + + PJ_LOG(4, (THIS_FILE, "Old thread policy=%d, priority=%d", +- policy, tp.__sched_priority)); ++ policy, tp.sched_priority)); + + policy = POLICY; +- tp.__sched_priority = max_prio; ++ tp.sched_priority = max_prio; + + rc = pthread_setschedparam(pthread_self(), policy, &tp); + if (rc != 0) { +@@ -1168,7 +1168,7 @@ + } + + PJ_LOG(4, (THIS_FILE, "New thread policy=%d, priority=%d", +- policy, tp.__sched_priority)); ++ policy, tp.sched_priority)); + } + + #else +--- ./pjlib/src/pj/os_core_unix.c ++++ pjlib/src/pj/os_core_unix.c +@@ -1104,7 +1104,7 @@ + if (type == PJ_MUTEX_SIMPLE) { + #if (defined(PJ_LINUX) && PJ_LINUX!=0) || \ + defined(PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE) +- rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_FAST_NP); ++ rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL); + #elif (defined(PJ_RTEMS) && PJ_RTEMS!=0) || \ + defined(PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE) + /* Nothing to do, default is simple */ +@@ -1114,7 +1114,7 @@ + } else { + #if (defined(PJ_LINUX) && PJ_LINUX!=0) || \ + defined(PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE) +- rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP); ++ rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + #elif (defined(PJ_RTEMS) && PJ_RTEMS!=0) || \ + defined(PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE) + // Phil Torre : diff --git a/srcpkgs/pjproject/patches/no-third-party.patch b/srcpkgs/pjproject/patches/no-third-party.patch new file mode 100644 index 0000000000..46724eb583 --- /dev/null +++ b/srcpkgs/pjproject/patches/no-third-party.patch @@ -0,0 +1,19 @@ +--- third_party/build/os-linux.mak ++++ third_party/build/os-linux.mak +@@ -1,9 +1,9 @@ +-DIRS += gsm +-DIRS += ilbc +-DIRS += speex +-DIRS += portaudio +-DIRS += g7221 +-DIRS += srtp +-DIRS += resample ++#DIRS += gsm ++#DIRS += ilbc ++#DIRS += speex ++#DIRS += portaudio ++#DIRS += g7221 ++#DIRS += srtp ++#DIRS += resample + + diff --git a/srcpkgs/pjproject/template b/srcpkgs/pjproject/template new file mode 100644 index 0000000000..66f6983160 --- /dev/null +++ b/srcpkgs/pjproject/template @@ -0,0 +1,62 @@ +# Template file for 'pjproject' +# musl-fixes.patch and no-third-party.patch come from Alpine, +# and this template is heavily based on Alpine's APKBUILD. +pkgname=pjproject +version=2.4.5 +revision=1 +build_style=gnu-configure +configure_args="--enable-shared \ + --enable-libsamplerate \ + --with-external-speex \ + --with-external-gsm \ + --with-external-srtp \ + --with-external-pa" +makedepends="libressl-devel alsa-lib-devel libgsm-devel speex-devel speexdsp-devel + portaudio-devel libsrtp-devel libsamplerate-devel" +short_desc="Open source SIP and media stack" +maintainer="Christopher Brannon " +license="GPL-2" +homepage="http://www.pjsip.org/pjsua.htm" +distfiles="http://www.pjsip.org/release/${version}/${pkgname}-${version}.tar.bz2" +checksum=086f5e70dcaee312b66ddc24dac6ef85e6f1fec4eed00ff2915cebe0ee3cdd8d + +pre_configure() { + # Remove target name from lib names + sed -i -e 's/-$(TARGET_NAME)//g' \ + -e 's/= $(TARGET_NAME).a/= .a/g' \ + -e 's/-$(LIB_SUFFIX)/$(LIB_SUFFIX)/g' \ + $(find . -name '*.mak*' -o -name Makefile) || return 1 + + # Fix hardcoded prefix and flags + sed -i \ + -e 's/poll@/poll@\nexport PREFIX := @prefix@\n/g' \ + -e 's!prefix = /usr/local!prefix = $(PREFIX)!' \ + -e '/PJLIB_CFLAGS/ s/(_CFLAGS)/(_CFLAGS) -fPIC/g' \ + -e '/PJLIB_UTIL_CFLAGS/ s/(_CFLAGS)/(_CFLAGS) -fPIC/g' \ + Makefile \ + build.mak.in || return 1 + + # Use libsamplerate instead of bundled resample + sed -i -e "s/resample//" third_party/build/Makefile + sed -i -e "s#../../third_party/libsamplerate/src/samplerate.h#samplerate.h#" pjmedia/src/pjmedia/resample_libsamplerate.c +} + +do_build() { + make dep LD=$CC + make -j1 LD=$CC +} + +post_install() { + vbin pjsip-apps/bin/pjsua +} + +pjproject-devel_package() { + depends="${makedepends} pjproject>=${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove usr/include + vmove "usr/lib/*.a" + vmove "usr/lib/*.so" + vmove usr/lib/pkgconfig + } +}