#Packager: Dimitris Tzemos <dijemos~at~gmail~dot~com>

pkgname=mixxx
pkgver=2.5.6
pkgrel=1dj
KEYFVER=2.2.8
DJINVER=0.27.1
source=("https://github.com/mixxxdj/mixxx/archive/$pkgver/$pkgname-$pkgver.tar.gz"  
"https://github.com/mixxxdj/libkeyfinder/archive/2.2.8/libkeyfinder-$KEYFVER.zip" 
"https://github.com/xsco/libdjinterop/archive/0.27.1/libdjinterop-$DJINVER.tar.gz" 
"debc5051ddf02c4274cfe21eba3779a14a0fc55c.patch")
url='http://www.mixxx.org'
#options=('nosrcpack')

slackdesc=\
(
 #|-----handy-ruler------------------------------------------------------|
"Mixxx (open source DJ software for performing live mixes)"
"Mixxx is been created for DJs, by DJs. It has numerous features"
"including parallel waveform summaries and displays, MP3, OGG, WAVE"
"and FLAC playback, pitch independent time stretch, vinyl emulation,"
"wave recording, BPM detection, multichannel and multiple soundcard"
"support, MIDI controllers support and scripting engine, a skinnable"
"interface"
""
"http://www.mixxx.org"
)

build() {
cd $SRC/$pkgname-$pkgver
sed -i '/<QDomElement>/a #include <memory>' src/controllers/legacycontrollersettingsfactory.h || return 1
sed -i '/<QtDebug>/a #include <optional>' src/track/replaygain.h || return 1
patch -p1 -R < $SRC/debc5051ddf02c4274cfe21eba3779a14a0fc55c.patch || return 1

mkdir -p build
cd build
  mkdir -p downloads
  cp -a $SRC/libkeyfinder-*.zip $SRC/libdjinterop-*.tar.gz downloads/ || return 1
  cmake \
    -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
    -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release -W no-dev .. || return 1
  make || return 1
  make install DESTDIR=$PKG 
cd ..
          
}
