From dbd3584590a5beca5358df8354de90230446e5ae Mon Sep 17 00:00:00 2001 From: Thomas Strobel Date: Wed, 26 Aug 2015 22:15:31 +0200 Subject: [PATCH] mediastreamer: introduce environment variable to set plugins directory --- .../libraries/mediastreamer/default.nix | 5 +++- .../libraries/mediastreamer/plugins_dir.patch | 24 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/libraries/mediastreamer/plugins_dir.patch diff --git a/pkgs/development/libraries/mediastreamer/default.nix b/pkgs/development/libraries/mediastreamer/default.nix index ed81eb94185b..4a672b226ea6 100644 --- a/pkgs/development/libraries/mediastreamer/default.nix +++ b/pkgs/development/libraries/mediastreamer/default.nix @@ -11,11 +11,12 @@ stdenv.mkDerivation rec { sha256 = "1g6gawrlz1lixzs1kzckm3rxc401ww8pi00x7r5kb84bdijb02cc"; }; + patches = [ ./plugins_dir.patch ]; + postPatch = '' sed -i "s/\(SRTP_LIBS=\"\$SRTP_LIBS -lsrtp\"\)/SRTP_LIBS=\"$(pkg-config --libs-only-l libsrtp)\"/g" configure ''; - # TODO: make it load plugins from *_PLUGIN_PATH nativeBuildInputs = [ pkgconfig intltool ]; propagatedBuildInputs = [ @@ -28,6 +29,8 @@ stdenv.mkDerivation rec { configureFlags = [ "--enable-external-ortp" "--with-srtp=${srtp}" + "--enable-xv" + "--enable-glx" ]; meta = with stdenv.lib; { diff --git a/pkgs/development/libraries/mediastreamer/plugins_dir.patch b/pkgs/development/libraries/mediastreamer/plugins_dir.patch new file mode 100644 index 000000000000..e64bfc5a43a1 --- /dev/null +++ b/pkgs/development/libraries/mediastreamer/plugins_dir.patch @@ -0,0 +1,24 @@ +diff -uNr mediastreamer2/src/base/msfactory.c mediastreamer2-new/src/base/msfactory.c +--- a/src/base/msfactory.c 2015-05-13 16:53:49.801113249 +0200 ++++ b/src/base/msfactory.c 2015-08-26 21:35:44.994724647 +0200 +@@ -630,12 +630,18 @@ + } + + void ms_factory_init_plugins(MSFactory *obj) { ++ char *package_plugins_dir; + if (obj->plugins_dir == NULL) { ++ package_plugins_dir=getenv("MEDIASTREAMER_PLUGINS_DIR"); ++ if (package_plugins_dir!=NULL){ ++ obj->plugins_dir = ms_strdup(package_plugins_dir); ++ } else { + #ifdef PACKAGE_PLUGINS_DIR +- obj->plugins_dir = ms_strdup(PACKAGE_PLUGINS_DIR); ++ obj->plugins_dir = ms_strdup(PACKAGE_PLUGINS_DIR); + #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);