mediastreamer: 2.16.1 -> unstable-2020-03-20

This commit is contained in:
Jaakko Luttinen 2020-03-20 17:04:15 +02:00
parent 7c5bff5428
commit d4988c7c31
No known key found for this signature in database
GPG Key ID: 7B1CE13152E6B964
2 changed files with 95 additions and 40 deletions

View File

@ -1,37 +1,97 @@
{ stdenv, pkgconfig, intltool, alsaLib, libpulseaudio, speex, gsm { alsaLib
, libopus, ffmpeg, libX11, libXv, libGLU, libGL, glew, libtheora, libvpx, SDL, libupnp , bctoolbox
, ortp, libv4l, libpcap, srtp, fetchFromGitHub, cmake, bctoolbox, doxygen , bzrtp
, python, libXext, libmatroska, fetchpatch , cmake
, doxygen
, fetchFromGitLab
, fetchpatch
, ffmpeg
, glew
, gsm
, intltool
, libGL
, libGLU
, libX11
, libXext
, libXv
, libmatroska
, libopus
, libpcap
, libpulseaudio
, libtheora
, libupnp
, libv4l
, libvpx
, ortp
, pkgconfig
, python
, SDL
, speex
, srtp
, stdenv
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "mediastreamer2"; pname = "mediastreamer2";
version = "2.16.1"; # Using master branch for linphone-desktop caused a chain reaction that many
# of its dependencies needed to use master branch too.
version = "unstable-2020-03-20";
src = fetchFromGitHub { src = fetchFromGitLab {
owner = "BelledonneCommunications"; domain = "gitlab.linphone.org";
owner = "public";
group = "BC";
repo = pname; repo = pname;
rev = version; rev = "c5eecb72cb44376d142949051dd0cb7c982608fb";
sha256 = "02745bzl2r1jqvdqzyv94fjd4w92zr976la4c4nfvsy52waqah7j"; sha256 = "1vp260jxvjlmrmjdl4p23prg4cjln20a7z6zq8dqvfh4iq3ya033";
}; };
patches = [ patches = [
(fetchpatch { # Plugins directory is normally fixed during compile time. This patch makes
name = "allow-build-without-git.patch"; # it possible to set the plugins directory run time with an environment
url = "https://github.com/BelledonneCommunications/mediastreamer2/commit/de3a24b795d7a78e78eab6b974e7ec5abf2259ac.patch"; # variable MEDIASTREAMER_PLUGINS_DIR. This makes it possible to construct a
sha256 = "1zqkrab42n4dha0knfsyj4q0wc229ma125gk9grj67ps7r7ipscy"; # plugin directory with desired plugins and wrap executables so that the
}) # environment variable points to that directory.
./plugins_dir.patch ./plugins_dir.patch
]; ];
nativeBuildInputs = [ pkgconfig intltool cmake doxygen python ]; nativeBuildInputs = [
cmake
doxygen
intltool
pkgconfig
python
];
propagatedBuildInputs = [ propagatedBuildInputs = [
alsaLib libpulseaudio speex gsm libopus alsaLib
ffmpeg libX11 libXv libGLU libGL glew libtheora libvpx SDL libupnp bctoolbox
ortp libv4l libpcap srtp bctoolbox libXext libmatroska bzrtp
ffmpeg
glew
gsm
libGL
libGLU
libX11
libXext
libXv
libmatroska
libopus
libpcap
libpulseaudio
libtheora
libupnp
libv4l
libvpx
ortp
SDL
speex
srtp
]; ];
# Do not build static libraries
cmakeFlags = [ "-DENABLE_STATIC=NO" ];
NIX_CFLAGS_COMPILE = toString [ NIX_CFLAGS_COMPILE = toString [
"-DGIT_VERSION=\"v${version}\"" "-DGIT_VERSION=\"v${version}\""
"-Wno-error=deprecated-declarations" "-Wno-error=deprecated-declarations"
@ -43,8 +103,9 @@ stdenv.mkDerivation rec {
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A powerful and lightweight streaming engine specialized for voice/video telephony applications"; description = "A powerful and lightweight streaming engine specialized for voice/video telephony applications";
homepage = http://www.linphone.org/technical-corner/mediastreamer2; homepage = "http://www.linphone.org/technical-corner/mediastreamer2";
license = licenses.gpl2; license = licenses.gpl3;
platforms = platforms.linux; platforms = platforms.linux;
maintainers = with maintainers; [ jluttine ];
}; };
} }

View File

@ -1,24 +1,18 @@
diff -uNr mediastreamer2/src/base/msfactory.c mediastreamer2-new/src/base/msfactory.c diff --git a/src/base/msfactory.c b/src/base/msfactory.c
--- a/src/base/msfactory.c 2015-05-13 16:53:49.801113249 +0200 index 14f868e3..2e3445a1 100644
+++ b/src/base/msfactory.c 2015-08-26 21:35:44.994724647 +0200 --- a/src/base/msfactory.c
@@ -630,12 +630,18 @@ +++ b/src/base/msfactory.c
@@ -770,7 +770,12 @@ void ms_factory_uninit_plugins(MSFactory *factory){
} }
void ms_factory_init_plugins(MSFactory *obj) { void ms_factory_init_plugins(MSFactory *obj) {
- if (obj->plugins_dir == NULL) {
+ char *package_plugins_dir; + char *package_plugins_dir;
if (obj->plugins_dir == NULL) { + // Force plugin dir from environment variable if set
+ package_plugins_dir = getenv("MEDIASTREAMER_PLUGINS_DIR"); + package_plugins_dir = getenv("MEDIASTREAMER_PLUGINS_DIR");
+ if (package_plugins_dir != NULL) { + if (package_plugins_dir != NULL) {
+ obj->plugins_dir = ms_strdup(package_plugins_dir); + ms_factory_set_plugins_dir(obj, package_plugins_dir);
+ } else { + } else if (obj->plugins_dir == NULL) {
#ifdef PACKAGE_PLUGINS_DIR #ifdef __APPLE__
- obj->plugins_dir = ms_strdup(PACKAGE_PLUGINS_DIR); char *dir = getPluginsDir();
+ obj->plugins_dir = ms_strdup(PACKAGE_PLUGINS_DIR); if (dir != NULL) {
#else
- obj->plugins_dir = ms_strdup("");
+ obj->plugins_dir = ms_strdup("");
#endif
+ }
}
if (strlen(obj->plugins_dir) > 0) {
ms_message("Loading ms plugins from [%s]",obj->plugins_dir);