]> git.sesse.net Git - mlt/commitdiff
Make jack consumer LGPLv2.1 license.
authorDan Dennedy <dan@dennedy.org>
Thu, 4 Aug 2011 06:26:21 +0000 (23:26 -0700)
committerDan Dennedy <dan@dennedy.org>
Thu, 4 Aug 2011 06:26:21 +0000 (23:26 -0700)
This change allows the module to be built in either GPL or LGPL mode
where GPL mode also adds the jackrack and ladspa filters.

src/modules/jackrack/Makefile
src/modules/jackrack/configure
src/modules/jackrack/consumer_jack.c
src/modules/jackrack/factory.c
src/modules/jackrack/gpl [deleted file]

index e1ee9948d77b7c753b8c9f270c079b0bc6e0d0e9..77b3ab2723c34facd70a991b0d35e4e79222a2ee 100644 (file)
@@ -3,30 +3,43 @@ CFLAGS += -I../..
 LDFLAGS += -L../../framework -lmlt -lpthread -lm
 
 include ../../../config.mak
+include config.mak
 
 TARGET = ../libmltjackrack$(LIBSUF)
 
+GPL_OBJS = jack_rack.o \
+       lock_free_fifo.o \
+       plugin.o \
+       plugin_desc.o \
+       plugin_mgr.o \
+       plugin_settings.o \
+       process.o \
+       filter_jackrack.o \
+       filter_ladspa.o
+
 OBJS = factory.o \
-          jack_rack.o \
-          lock_free_fifo.o \
-          plugin.o \
-          plugin_desc.o \
-          plugin_mgr.o \
-          plugin_settings.o \
-          process.o \
-          filter_jackrack.o \
-          filter_ladspa.o \
           consumer_jack.o
 
 CFLAGS += `pkg-config --cflags jack`
+LDFLAGS += `pkg-config --libs jack`
+
+ifdef GPL
+OBJS += $(GPL_OBJS)
+CFLAGS += -DGPL
 CFLAGS += `pkg-config --cflags libxml-2.0`
 CFLAGS += `pkg-config --cflags glib-2.0`
 
 LDFLAGS += $(LIBDL)
-LDFLAGS += `pkg-config --libs jack`
 LDFLAGS += `pkg-config --libs libxml-2.0`
 LDFLAGS += `pkg-config --libs glib-2.0`
 
+YML_FILES = *.yml
+BLACKLIST = blacklist.txt
+else
+YML_FILES = consumer_jack.yml
+BLACKLIST = dummy
+endif
+
 SRCS := $(OBJS:.o=.c)
 
 all:   $(TARGET)
@@ -46,8 +59,8 @@ clean:
 install: all
        install -m 755 $(TARGET) "$(DESTDIR)$(libdir)/mlt"
        install -d "$(DESTDIR)$(datadir)/mlt/jackrack"
-       install -m 644 *.yml "$(DESTDIR)$(datadir)/mlt/jackrack"
-       install -m 644 blacklist.txt "$(DESTDIR)$(datadir)/mlt/jackrack"
+       install -m 644 $(YML_FILES) "$(DESTDIR)$(datadir)/mlt/jackrack"
+       [ -f $(BLACKLIST) ] && install -m 644 $(BLACKLIST) "$(DESTDIR)$(datadir)/mlt/jackrack" || true
 
 uninstall:
        rm "$(DESTDIR)$(libdir)/mlt/libmltjackrack$(LIBSUF)" 2> /dev/null || true
index b39d183f2be939b28b556e2d545cc1d7cc7836e1..22f57615b27bf800ddc9fc9e957e09063c5f8f6c 100755 (executable)
@@ -6,18 +6,24 @@ then
        pkg-config jack
        disable_jack=$?
 
-       pkg-config libxml-2.0 > /dev/null 2>&1
-       disable_xml2=$?
+       echo > config.mak
 
-       ladspa_prefix=`which listplugins 2> /dev/null`
-       if [ "$ladspa_prefix" != "" ]
+       if [ "$gpl" = "true" ]
        then
-               ladspa_prefix=`dirname "$ladspa_prefix"`
-               ladspa_prefix=`dirname "$ladspa_prefix"`
-       else
-               ladspa_prefix=`pkg-config --variable=prefix jack`
+               pkg-config libxml-2.0 > /dev/null 2>&1
+               disable_xml2=$?
+
+               ladspa_prefix=`which listplugins 2> /dev/null`
+               if [ "$ladspa_prefix" != "" ]
+               then
+                       ladspa_prefix=`dirname "$ladspa_prefix"`
+                       ladspa_prefix=`dirname "$ladspa_prefix"`
+               else
+                       ladspa_prefix=`pkg-config --variable=prefix jack`
+               fi
+               disable_ladspa=`[ -f "$ladspa_prefix/include/ladspa.h" ] && echo 0 || echo 1`
+               echo GPL=1 > config.mak
        fi
-       disable_ladspa=`[ -f "$ladspa_prefix/include/ladspa.h" ] && echo 0 || echo 1`
 
        if [ "$disable_jack" = "1" -o "$disable_xml2" = "1" -o "$disable_ladspa" = "1" ]
        then
index 74f3ea349e921620d4183c3ec84b0eb29f318994..06efb3759cc70b9712b7f1266ad46bb6ff2a436d 100644 (file)
@@ -2,19 +2,19 @@
  * consumer_jack.c -- a JACK audio consumer
  * Copyright (C) 2011 Dan Dennedy <dan@dennedy.org>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
  *
- * This program is distributed in the hope that it will be useful,
+ * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 #include <framework/mlt.h>
index a5787d5563363be4c2bf289893a25559fcf09d8f..3958f7fba2064efb3f6678071560faa5aadbdec3 100644 (file)
 #include <limits.h>
 #include <float.h>
 
+
+extern mlt_consumer consumer_jack_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+
+#ifdef GPL
 #include "plugin_mgr.h"
 
 extern mlt_filter filter_jackrack_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 extern mlt_filter filter_ladspa_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
-extern mlt_consumer consumer_jack_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
 plugin_mgr_t *g_jackrack_plugin_mgr = NULL;
+#endif
 
 static mlt_properties metadata( mlt_service_type type, const char *id, char *data )
 {
@@ -42,6 +46,7 @@ static mlt_properties metadata( mlt_service_type type, const char *id, char *dat
                          mlt_environment( "MLT_DATA" ), strncmp( id, "ladspa.", 7 ) ? data : "ladspa" );
        mlt_properties result = mlt_properties_parse_yaml( file );
 
+#ifdef GPL
        if ( !strncmp( id, "ladspa.", 7 ) )
        {
                // Annotate the yaml properties with ladspa control port info.
@@ -120,12 +125,14 @@ static mlt_properties metadata( mlt_service_type type, const char *id, char *dat
                        mlt_properties_set_double( p, "maximum", 1 );
                }
        }
+#endif
 
        return result;
 }
 
 MLT_REPOSITORY
 {
+#ifdef GPL
        GSList *list;
        g_jackrack_plugin_mgr = plugin_mgr_new();
 
@@ -144,6 +151,7 @@ MLT_REPOSITORY
        MLT_REGISTER_METADATA( filter_type, "jackrack", metadata, "filter_jackrack.yml" );
        MLT_REGISTER( filter_type, "ladspa", filter_ladspa_init );
        MLT_REGISTER_METADATA( filter_type, "ladspa", metadata, "filter_ladspa.yml" );
+#endif
        MLT_REGISTER( consumer_type, "jack", consumer_jack_init );
        MLT_REGISTER_METADATA( consumer_type, "jack", metadata, "consumer_jack.yml" );
 }
diff --git a/src/modules/jackrack/gpl b/src/modules/jackrack/gpl
deleted file mode 100644 (file)
index e69de29..0000000