Rename miracle, valerie, humperdink, and albino.
[melted] / src / swig / python / build
diff --git a/src/swig/python/build b/src/swig/python/build
new file mode 100755 (executable)
index 0000000..7c7ff23
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+path=`which python 2> /dev/null`
+
+if [ $? = 0 ]
+then
+       # Change this as needed
+       export PYTHON_INCLUDE=`python -c "import sys;print \"%s/include/python%d.%d\"%(sys.prefix,sys.version_info[0],sys.version_info[1])"`
+
+       [ ! -d "$PYTHON_INCLUDE" ] && echo python development missing && exit 1
+
+       ln -sf ../mltpp.i .
+
+       # Invoke swig
+       swig -c++ -I../../src `pkg-config mlt-framework --cflags` -python mltpp.i || exit $?
+
+       # Compile the wrapper
+       g++ -fPIC -D_GNU_SOURCE -c -rdynamic -pthread `pkg-config mlt-framework --cflags` -I$PYTHON_INCLUDE mltpp_wrap.cxx || exit $?
+
+       # Create the module
+       gcc -shared mltpp_wrap.o -L../../src -lmlt++ -o _mltpp.so || exit $?
+else
+       echo Python not installed.
+       exit 1
+fi