1 { lib, stdenv, fetchFromGitHub, writeTextFile, cmake, alsa-lib, OpenAL, freepats }:
4 defaultCfgPath = "${placeholder "out"}/etc/wildmidi/wildmidi.cfg";
6 stdenv.mkDerivation rec {
10 src = fetchFromGitHub {
13 rev = "${pname}-${version}";
14 sha256 = "sha256-5El8aDpAgjrW0/4lphZEF+Hfv9Xr7J4DMk1b/Tb+0TU=";
17 nativeBuildInputs = [ cmake ];
19 buildInputs = lib.optionals stdenv.buildPlatform.isLinux [
20 alsa-lib stdenv.cc.libc/*couldn't find libm*/
21 ] ++ lib.optionals stdenv.buildPlatform.isDarwin [
26 # https://github.com/Mindwerks/wildmidi/issues/236
27 substituteInPlace src/wildmidi.pc.in \
28 --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \
29 --replace '$'{exec_prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@
33 "-DWILDMIDI_CFG=${defaultCfgPath}"
37 defaultCfg = writeTextFile {
38 name = "wildmidi.cfg";
41 source ${freepats}/freepats.cfg
45 mkdir -p "$(dirname ${defaultCfgPath})"
46 ln -s ${defaultCfg} ${defaultCfgPath}
50 description = "Software MIDI player and library";
52 WildMIDI is a simple software midi player which has a core softsynth
53 library that can be use with other applications.
55 homepage = "https://wildmidi.sourceforge.net/";
56 # The library is LGPLv3, the wildmidi executable is GPLv3
57 license = licenses.lgpl3;
58 platforms = platforms.unix;
59 maintainers = [ maintainers.bjornfor ];