summary refs log tree commit diff
path: root/pkgs/development/libraries/wildmidi/default.nix
blob: 85e5726f8636292f1f1f85eada32433b487ca713 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ stdenv, fetchurl, alsaLib, freepats }:

stdenv.mkDerivation rec {
  name = "wildmidi-0.2.3.5";

  src = fetchurl {
    url = "mirror://sourceforge/project/wildmidi/wildmidi/${name}.tar.gz";
    sha256 = "0m75753mn0rbwja180c2qk53s149wp4k35dijr2i6pa7sc12fr00";
  };

  # NOTE: $out in configureFlags, like this:
  #   configureFlags = "--disable-werror --with-wildmidi-cfg=$out/etc/wildmidi.cfg";
  # is not expanded, so use this workaround:
  preConfigure = ''
    configureFlags="--disable-werror --with-wildmidi-cfg=$out/etc/wildmidi.cfg"
  '';

  buildInputs = [ alsaLib ];

  postInstall = ''
    mkdir "$out"/etc
    echo "dir ${freepats}" > "$out"/etc/wildmidi.cfg
    echo "source ${freepats}/freepats.cfg" >> "$out"/etc/wildmidi.cfg
  '';

  meta = with stdenv.lib; {
    description = "Software MIDI player and library";
    longDescription = ''
      WildMIDI is a simple software midi player which has a core softsynth
      library that can be use with other applications.
    '';
    homepage = http://wildmidi.sourceforge.net/;
    # The library is LGPLv3, the wildmidi executable is GPLv3
    license = licenses.lgpl3;
    platforms = platforms.linux;
    maintainers = [maintainers.bjornfor];
  };
}