SUMMARY="A simple software MIDI keyboard"
DESCRIPTION="MidiSynth is a simple software MIDI keyboard using Haiku's \
built-in synthesizer or any connected MIDI In or Out device. It can be played \
with the mouse and/or the computer's keyboard, and also has an interface \
(In and Out) to MIDI hardware and any apps that use MidiKit2.

You can choose the SoundFont to use, or disable the Haiku synthesizer \
altogether when you connect to some other Midi Out device.

MidiSynth supports chords, which are defined in a file and can be enabled by \
selecting a chord from a the Chords menu. You can even remap the keys on your \
keyboard."
HOMEPAGE="https://github.com/HaikuArchives/MidiSynth"
COPYRIGHT="2000-2013 Michael Pfeiffer
	2013 Pete Goodeve
	2021 Humdinger"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="$HOMEPAGE/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="f789243eb047b7b09ca07bd085e01ec0a6b89ff7e6360a6d485ef7594cad5a69"
SOURCE_DIR="MidiSynth-$portVersion"
ADDITIONAL_FILES="midisynth_install_chord_keymapping.sh"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86"

USER_SETTINGS_FILES="settings/MidiSynth/KeyMappings directory
	settings/MidiSynth/KeyMappings/Default template data/MidiSynth/KeyMappings/Default
	settings/MidiSynth/Chords template data/MidiSynth/Chords
	"
POST_INSTALL_SCRIPTS="$relativePostInstallDir/midisynth_install_chord_keymapping.sh"

PROVIDES="
	midisynth$secondaryArchSuffix = $portVersion
	app:MidiSynth = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	makefile_engine
	cmd:g++$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	cd src
	make $jobArgs
	make bindcatalogs
}

INSTALL()
{
	mkdir -p $appsDir $dataDir/MidiSynth
	cp -a MidiSynth $appsDir
	cp -rf KeyMappings $dataDir/MidiSynth
	cp -a Chords $dataDir/MidiSynth

	addAppDeskbarSymlink $appsDir/MidiSynth

	mkdir -p $postInstallDir
	cp $portDir/additional-files/midisynth_install_chord_keymapping.sh $postInstallDir
}
