#### this file is sourced not run
PKGVER=0.9.6
PKGBUILD=1
PKGARCH=x86_64

# source: james
TARBALL=mlt-$PKGVER.tar.gz
MD5SUM=92bcc95af44ff086df0a0ce17a201d1c
SRC_URL=http://downloads.sourceforge.net/mlt/$TARBALL
BUNDLE=

SLACKREQ='ffmpeg libxml2 libvorbis libSDL libsamplerate qt5-common gtk2 \
libjack2 sox libfrei0r libmovit libexif' # swig built-time only, python too
SLACKDESC="mlt: mlt $PKGVER (Multimedia Framework)  
mlt:  
mlt: MLT is an open source multimedia framework, designed and developed for 
mlt: television broadcasting. It provides a toolkit for broadcasters, video 
mlt: editors, media players, transcoders, web streamers and many more types of 
mlt: applications. The functionality of the system is provided via an 
mlt: assortment of ready to use tools, XML authoring components, and an 
mlt: extensible plug-in based API.  
mlt: The Qt plugin is for qt5, install mlt-qt4 if you want Qt4 plugin.
mlt: 
mlt: http://www.mltframework.org/  
"

### default pkg_download
### default pkg_prepare
pkg_prepare() {
	pkg_prepare_default &&
	cp $CHROOT_DIR/tmp/pkg/ladspa.h usr/include
}

### default pkg_package
### build
pkg_build() {
	# qt5
	export PATH="$PATH:/opt/qt5/bin"
	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/qt5/$LIBDIR"
	export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/opt/qt5/$LIBDIR/pkgconfig"
	export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/opt/qt5/include"
	export QT5_PATH="/opt/qt5/bin"
	export QT5_LD_LIBRARY_PATH="/opt/qt5/$LIBDIR"
	export QT5_PKG_CONFIG_PATH="/opt/qt5/$LIBDIR/pkgconfig"
	export QT5_CPLUS_INCLUDE_PATH="/opt/qt5/include" 

	cd /tmp/mlt*
	CONFFLAGS="$CONFFLAGS --enable-gpl --enable-gpl3 --swig-languages=python"
	pkg_build_autoconf &&
	pkg_build_slackdesc &&
	
	# install python modules
	rm -f /usr/include/ladspa.h &&
	cp src/swig/python/mlt.py /usr/$LIBDIR/python* &&
	cp src/swig/python/_mlt.so /usr/$LIBDIR/python*/lib-dynload &&
	
	# Qt4/5 compatibility
	mv /usr/share/mlt/qt /usr/share/mlt/qt5 &&
	ln -sf qt5 /usr/share/mlt/qt &&
	mv /usr/$LIBDIR/mlt/libmltqt.so /usr/$LIBDIR/mlt/libmltqt-qt5.so &&
	ln -sf libmltqt-qt5.so /usr/$LIBDIR/mlt/libmltqt.so
}

<< "EOF"
sh-4.2# ./configure --help
Non-autotool config script for MLT.

Help options:

  --help                  - this information

General build options:

  --prefix=directory         - install prefix for path (default: /usr/local)
  --libdir=directory         - lib directory (default: /usr/local/lib)
  --datadir=directory        - data directory (default: /usr/local/share)
  --mandir=directory         - man documentation directory (default: /usr/local/share/man)
  --rename-melt              - Give melt executable a different name (it will not be versioned)
  --enable-extra-versioning  - Version melt and the data and modules directories
  --enable-gpl               - Enable GPLv2 components
  --enable-gpl3              - Enable GPLv3 components
  --enable-debug             - Compile without optimizations support (default: off)
  --disable-debug            - Compile without debug support (default: on)
  --disable-mmx              - Compile without MMX support (default: on)
  --disable-sse              - Compile without SSE support (default: on)
  --disable-sse2             - Compile without SSE2 support (default: on)
  --arch='arch'              - Compile for a specific architecture (default: none)
  --cpu='cpu'                - Compile for a specific CPU (default: none)
  --target-os='os'           - Cross-compile to a specific OS (default: Linux)
  --target-arch='arch'       - Cross-compile to a specific CPU architecture

Module disable options:

  --disable-avformat      - Disable the avformat module 
  --disable-core          - Disable the core module 
  --disable-decklink      - Disable the decklink module 
  --disable-dv            - Disable the dv module 
  --disable-feeds         - Disable the feeds module 
  --disable-frei0r        - Disable the frei0r module 
  --disable-gtk2          - Disable the gtk2 module 
  --disable-jackrack      - Disable the jackrack module 
  --disable-kdenlive      - Disable the kdenlive module 
  --disable-kino          - Disable the kino module [GPL]
  --disable-linsys        - Disable the linsys module [GPL]
  --disable-lumas         - Disable the lumas module 
  --disable-motion_est    - Disable the motion_est module [GPL]
  --disable-normalize     - Disable the normalize module [GPL]
  --disable-oldfilm       - Disable the oldfilm module 
  --disable-opengl        - Disable the opengl module 
  --disable-plus          - Disable the plus module 
  --disable-plusgpl       - Disable the plusgpl module [GPL]
  --disable-qt            - Disable the qt module [GPL]
  --disable-resample      - Disable the resample module [GPL]
  --disable-rtaudio       - Disable the rtaudio module 
  --disable-sdl           - Disable the sdl module 
  --disable-sox           - Disable the sox module 
  --disable-swfdec        - Disable the swfdec module 
  --disable-vid.stab      - Disable the vid.stab module [GPL]
  --disable-videostab     - Disable the videostab module [GPL]
  --disable-vmfx          - Disable the vmfx module 
  --disable-vorbis        - Disable the vorbis module 
  --disable-xine          - Disable the xine module [GPL]
  --disable-xml           - Disable the xml module 

  NOTE: libraries marked [GPL] will not be built unless --enable-gpl is stipulated.

FFmpeg/avformat options:

  --avformat-shared=path  - Link against a shared installation of libavformat (default)
  --avformat-static=path  - Link against a static build of libavformat
  --avformat-ldextra=libs - Provide additional libs to link with
  --avformat-suffix=suff  - Specify a custom suffix
  --avformat-no-codecs    - Disable the producer and consumer to avoid the codecs
  --avformat-no-filters   - Disable the filters to make a codecs+muxers-only plugin
  --avformat-no-devices   - Disable support for libavdevice
  --avformat-vdpau        - Enable support for NVIDIA VDPAU

  NOTE: The recommended version of FFmpeg is 1.2 or libav 0.8.7.

GTK+ options:

  --gtk2-prefix=path      - Override the gtk+-2.0 prefix for pkg-config

JACK Rack options:

  --gtk2-prefix=path      - Override the gtk+-2.0 prefix for pkg-config

Linsys options:

  --linsys-with-jpeg      - Enable the option to export JPEGs (disabled by default)

Luma options:

  --luma-compress         - Produce compressed (png) lumas
  --luma-8bpp             - Produce 8 bit pgm lumas (defaut is 16 bit)

Qt options:

  --qt-libdir             - Location of Qt lib directory [/usr/lib/qt4]
  --qt-includedir         - Location of Qt include directory [/usr/include/qt4]
  --kde-libdir            - Location of KDE lib directory [/usr/lib]
  --kde-includedir        - Location of KDE include directory [/usr/include/kde]
  --exif-libdir           - Location of libexif lib directory [/usr/lib]
  --exif-includedir       - Location of libexif include directory [/usr/include/libexif]
  --without-kde           - Don't link to KDE libraries

SWIG options:

  --swig-languages=[all | [csharp | java | lua | perl | php | python | ruby | tcl]*]
                          - High level language bindings (default: none)
EOF
