biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / audio / munt / mt32emu-qt.nix
blob9ebb59ddafdde92409bb1600f3c6f44cbf99fd04
1 { lib
2 , stdenv
3 , mkDerivation
4 , fetchFromGitHub
5 , alsa-lib
6 , cmake
7 , libpulseaudio
8 , libmt32emu
9 , pkg-config
10 , portaudio
11 , qtbase
12 , qtmultimedia
13 , withJack ? stdenv.hostPlatform.isUnix, libjack2
16 let
17   char2underscore = char: str: lib.replaceStrings [ char ] [ "_" ] str;
19 mkDerivation rec {
20   pname = "mt32emu-qt";
21   version = "1.11.1";
23   src = fetchFromGitHub {
24     owner = "munt";
25     repo = "munt";
26     rev = "${char2underscore "-" pname}_${char2underscore "." version}";
27     sha256 = "sha256-PqYPYnKPlnU3PByxksBscl4GqDRllQdmD6RWpy/Ura0=";
28   };
30   postPatch = ''
31     sed -i -e '/add_subdirectory(mt32emu)/d' CMakeLists.txt
32   '';
34   nativeBuildInputs = [
35     cmake
36     pkg-config
37   ];
39   buildInputs = [
40     libmt32emu
41     portaudio
42     qtbase
43     qtmultimedia
44   ]
45   ++ lib.optionals stdenv.hostPlatform.isLinux [
46     alsa-lib
47     libpulseaudio
48   ]
49   ++ lib.optional withJack libjack2;
51   dontFixCmake = true;
53   cmakeFlags = [
54     "-Dmt32emu-qt_USE_PULSEAUDIO_DYNAMIC_LOADING=OFF"
55     "-Dmunt_WITH_MT32EMU_QT=ON"
56     "-Dmunt_WITH_MT32EMU_SMF2WAV=OFF"
57   ];
59   postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
60     mkdir $out/Applications
61     mv $out/bin/${pname}.app $out/Applications/
62     ln -s $out/{Applications/${pname}.app/Contents/MacOS,bin}/${pname}
63   '';
65   meta = with lib; {
66     homepage = "https://munt.sourceforge.net/";
67     description = "A synthesizer application built on Qt and libmt32emu";
68     mainProgram = "mt32emu-qt";
69     longDescription = ''
70       mt32emu-qt is a synthesiser application that facilitates both realtime
71       synthesis and conversion of pre-recorded SMF files to WAVE making use of
72       the mt32emu library and the Qt framework.
73     '';
74     license = with licenses; [ gpl3Plus ];
75     maintainers = with maintainers; [ OPNA2608 ];
76     platforms = platforms.all;
77   };